REST API - Auth

iceprod.rest.handlers.auth.setup(handler_cfg)[source]

Setup method for Config REST API.

Parameters:

handler_cfg (dict) – args to pass to the route

Returns:

routes, database, indexes

Return type:

dict

class iceprod.rest.handlers.auth.MultiRoleHandler(*args, **kwargs)[source]

Handle multi-role requests.

async get()[source]

Get a list of roles.

Returns:

{‘results’: list of roles}

Return type:

dict

class iceprod.rest.handlers.auth.MultiGroupHandler(*args, **kwargs)[source]

Handle multi-group requests.

async get()[source]

Get a list of groups.

Returns:

{‘results’: list of groups}

Return type:

dict

class iceprod.rest.handlers.auth.MultiUserHandler(*args, **kwargs)[source]

Handle multi-user requests.

async get()[source]

Get a list of users.

Returns:

{‘results’: list of users}

Return type:

dict

class iceprod.rest.handlers.auth.UserHandler(*args, **kwargs)[source]

Handle individual user requests.

async get(username)[source]

Get a user.

Parameters:

username (str) – the user to get

Returns:

user info

Return type:

dict

async put(username)[source]

Add a User.

Parameters:

username (str) – the user to delete

Returns:

empty dict

Return type:

dict

async delete(username)[source]

Delete a user.

Parameters:

username (str) – the user to delete

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.auth.UserPriorityHandler(*args, **kwargs)[source]

Handle individual user requests.

async put(username)[source]

Add a User.

Parameters:

username (str) – the user to modify

Body Args:

priority (float): the new priority

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.auth.AuthHandler(*args, **kwargs)[source]

Handle authorization requests.

async post()[source]

Do a remote auth lookup. Raises a 403 on auth failure.

Body Args:

name (str): name of attr value (str): value of attr role (str): the role to check (read | write) username (str): username groups (list): groups for user

Returns:

{result: ok}

Return type:

dict