magpie.api.management.register.register_utils
¶
Module Contents¶
Classes¶
Supported operations by the temporary tokens. |
Functions¶
|
Handles the operation according to the provided temporary token. |
|
Get all existing group that are marked as publicly discoverable from the database. |
|
Obtains the requested discoverable group by name. |
-
class
magpie.api.management.register.register_utils.
TokenOperation
[source]¶ Bases:
magpie.utils.ExtendedEnum
Supported operations by the temporary tokens.
-
magpie.api.management.register.register_utils.
handle_temporary_token
(tmp_token: magpie.models.TemporaryToken, db_session: sqlalchemy.orm.session.Session) → None[source]¶ Handles the operation according to the provided temporary token.
-
magpie.api.management.register.register_utils.
get_discoverable_groups
(db_session: sqlalchemy.orm.session.Session) → List[models.Group][source]¶ Get all existing group that are marked as publicly discoverable from the database.
-
magpie.api.management.register.register_utils.
get_discoverable_group_by_name
(group_name: magpie.typedefs.Str, db_session: sqlalchemy.orm.session.Session) → magpie.models.Group[source]¶ Obtains the requested discoverable group by name.
Note
For security reason, an existing group that is NOT discoverable will return NotFound instead of Forbidden. Otherwise we give an indication to a potentially non-admin user that some group of that name exists.
- Returns
found group matched by name
- Raises
HTTPNotFound – if the group cannot be found or if matched group name is not discoverable.