示例#1
0
文件: routes.py 项目: zms/scoutr
 def history(item):
     return api.history(
         request=build_oidc_request(request, group_attribute),
         key=partition_key,
         value=item,
         query_params=parse_query_params(request.query_string),
         actions=history_actions
     )
示例#2
0
文件: routes.py 项目: zms/scoutr
 def audit(item):
     search_params = {}
     if item:
         search_params = {f'resource.{partition_key}': item}
     return api.list_audit_logs(
         request=build_oidc_request(request, group_attribute),
         search_params=search_params,
         query_params=parse_query_params(request.query_string)
     )
示例#3
0
文件: routes.py 项目: zms/scoutr
    def check_user_permissions():
        if 'method' not in request.data or 'path' not in request.data:
            raise ParseError("Body should contain 'method' and 'path' keys")

        return {
            'authorized': api.can_access_endpoint(
                method=request.data['method'],
                path=request.data['path'],
                request=build_oidc_request(request, group_attribute)
            )
        }
示例#4
0
文件: routes.py 项目: zms/scoutr
 def search(search_key):
     return api.search(
         request=build_oidc_request(request, group_attribute),
         key=search_key,
         values=request.data
     )
示例#5
0
文件: routes.py 项目: zms/scoutr
 def list_items():
     return api.list_table(
         request=build_oidc_request(request, group_attribute),
         query_params=parse_query_params(request.query_string)
     )
示例#6
0
文件: main.py 项目: zms/scoutr
def create_item():
    """Create an item"""
    return api.create(request=build_oidc_request(request, 'groups'),
                      item=request.data)