add apikey
This commit is contained in:
@@ -43,11 +43,9 @@ class CoursePayload(BaseModel):
|
||||
|
||||
@router.post('/', compress=True, tags=['Course'])
|
||||
def post_course(payload: CoursePayload):
|
||||
org = Org(id='*', name='EDUSEG')
|
||||
|
||||
create_course(
|
||||
course=payload.course,
|
||||
org=org,
|
||||
org=Org(id='*', name='default'),
|
||||
persistence_layer=course_layer,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ LIMIT = 25
|
||||
def me():
|
||||
user: AuthenticatedUser = router.context['user']
|
||||
acls = collect.get_items(
|
||||
KeyPair(user.id, PrefixKey('acls#')),
|
||||
KeyPair(user.id, PrefixKey('acls')),
|
||||
limit=LIMIT,
|
||||
)
|
||||
workspaces = collect.get_items(
|
||||
KeyPair(user.id, PrefixKey('orgs#')),
|
||||
KeyPair(user.id, PrefixKey('orgs')),
|
||||
limit=LIMIT,
|
||||
)
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class BadRequestError(MissingError, PowertoolsBadRequestError): ...
|
||||
|
||||
router = Router()
|
||||
user_layer = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
|
||||
collect = DynamoDBCollection(user_layer, exception_cls=BadRequestError)
|
||||
collect = DynamoDBCollection(user_layer, exc_cls=BadRequestError)
|
||||
elastic_client = Elasticsearch(**ELASTIC_CONN)
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ def get_idp(id: str):
|
||||
)
|
||||
def get_emails(id: str):
|
||||
return collect.get_items(
|
||||
KeyPair(id, PrefixKey('emails#')),
|
||||
KeyPair(id, PrefixKey('emails')),
|
||||
start_key=router.current_event.get_query_string_value('start_key', None),
|
||||
)
|
||||
|
||||
@@ -126,6 +126,6 @@ def get_logs(id: str):
|
||||
)
|
||||
def get_orgs(id: str):
|
||||
return collect.get_items(
|
||||
KeyPair(id, PrefixKey('orgs#')),
|
||||
KeyPair(id, PrefixKey('orgs')),
|
||||
start_key=router.current_event.get_query_string_value('start_key', None),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user