storage_api.apis.common package

Submodules

storage_api.apis.common.auth module

storage_api.apis.common.auth.in_role(api, group_name)[source]

Decorator: call flask.abort(403) if user is not in the specified group, or if the session is unauthenticated.

Parameters:
  • api (flask_restplus.Api) – The API to signal errors to etc
  • group_name (str) – A group name to check for membership in

Example:

@in_group(api, group_name='it-db-storage')
def get(self):
    pass
storage_api.apis.common.auth.setup_oauth(app, login_endpoint, logout_endpoint)[source]

Setup OAuth2 aunhentication flow for the app with logins initiated by going to login_endpoint, and logouts done in logout_endpoint.

Must be called after the neccessary configuration options have been loaded into app.config.

storage_api.apis.common.auth.setup_roles_from_env(app)[source]

Configure an application’s roles from the environment.

Module contents