Exemple #1
0
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')
Exemple #2
0
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')
Exemple #3
0
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)
Exemple #4
0
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')
Exemple #5
0
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')
Exemple #6
0
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')
Exemple #7
0
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')
Exemple #8
0
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')
Exemple #9
0
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')
Exemple #10
0
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')
Exemple #11
0
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')