magpie.api.management.register.register_utils

Module Contents

Functions

handle_temporary_token(tmp_token: magpie.models.TemporaryToken, db_session: sqlalchemy.orm.session.Session) → None

Handles the operation according to the provided temporary token.

get_discoverable_groups(db_session: sqlalchemy.orm.session.Session) → List[magpie.models.Group]

Get all existing group that are marked as publicly discoverable from the database.

get_discoverable_group_by_name(group_name: magpie.typedefs.Str, db_session: sqlalchemy.orm.session.Session) → magpie.models.Group

Obtains the requested discoverable group by name.

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[magpie.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.