def get(token_info: dict, resource_type_name): next_token, per_page = get_next_token(request.args) rt = ResourceType(resource_type_name) return get_page(rt.list_policies, next_token, per_page, content_key='policies')
def get(token_info: dict, resource_type_name, resource_id): next_token, per_page = get_next_token(request.args) return get_page( ResourceId(resource_type_name, resource_id).list_principals, next_token, per_page, content_key='members')
def get_users_owns(token_info: dict, user_id: str): next_token, per_page = get_next_token(request.args) user = User(user_id) content_key = "roles" if request.args[ 'resource_type'] == "role" else "groups" return get_page(user.get_owned, next_token, per_page, content_key, request.args['resource_type'], paged=True)
def get_roles(token_info: dict): next_token, per_page = get_next_token(request.args) return get_page(Role.list_all, next_token, per_page, 'roles')
def get(token_info: dict): next_token, per_page = get_next_token(request.args) return get_page(ResourceType.list_all, next_token, per_page, content_key='resources')
def get(token_info: dict, resource_type_name): next_token, per_page = get_next_token(request.args) return get_page(ResourceType(resource_type_name).list_ids, next_token, per_page, content_key='resource_ids')
def get_groups_roles(token_info: dict, group_id: str): next_token, per_page = get_next_token(request.args) group = Group(group_id) return get_page(group.get_roles, next_token, per_page, 'roles')
def get_group_users(token_info: dict, group_id: str): next_token, per_page = get_next_token(request.args) group = Group(group_id) return get_page(group.get_users_page, next_token, per_page, 'users')
def get_groups(token_info: dict): next_token, per_page = get_next_token(request.args) return get_page(Group.list_all, next_token, per_page, 'groups')
def get_users_roles(token_info: dict, user_id: str): next_token, per_page = get_next_token(request.args) user = User(user_id) return get_page(user.get_roles, next_token, per_page, 'roles')
def get_users(token_info: dict): next_token, per_page = get_next_token(request.args) return get_page(User.list_all, next_token, per_page, 'users')