diff --git a/docs/openapi.yaml b/docs/openapi.yaml index bff5470..64a2301 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -81,7 +81,7 @@ paths: summary: Get Version tags: - System - /ga4gh-tes/v1/service-info: + /ga4gh/tes/v1/service-info: get: operationId: service_info_ga4gh_tes_v1_service_info_get responses: @@ -93,7 +93,7 @@ paths: summary: Service Info tags: - GA4GH TES - /ga4gh-tes/v1/tasks: + /ga4gh/tes/v1/tasks: get: operationId: list_tasks_ga4gh_tes_v1_tasks_get responses: @@ -120,7 +120,7 @@ paths: summary: Create Task tags: - GA4GH TES - /ga4gh-tes/v1/tasks/{task_id}: + /ga4gh/tes/v1/tasks/{task_id}: get: operationId: get_task_ga4gh_tes_v1_tasks__task_id__get parameters: @@ -147,7 +147,7 @@ paths: summary: Get Task tags: - GA4GH TES - /ga4gh-tes/v1/tasks/{task_id}:cancel: + /ga4gh/tes/v1/tasks/{task_id}:cancel: post: operationId: cancel_task_ga4gh_tes_v1_tasks__task_id__cancel_post parameters: @@ -174,3 +174,71 @@ paths: summary: Cancel Task tags: - GA4GH TES + /storage/credentials: + get: + operationId: get_user_keys_storage_credentials_get + responses: + '200': + content: + application/json: + schema: {} + description: Successful Response + security: + - HTTPBearer: [] + summary: Get User Keys + tags: + - Storage + post: + operationId: generate_user_key_storage_credentials_post + responses: + '200': + content: + application/json: + schema: {} + description: Successful Response + security: + - HTTPBearer: [] + summary: Generate User Key + tags: + - Storage + /storage/credentials/{key_id}: + delete: + operationId: delete_user_key_storage_credentials__key_id__delete + parameters: + - in: path + name: key_id + required: true + schema: + title: Key Id + type: string + responses: + '200': + content: + application/json: + schema: {} + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + summary: Delete User Key + tags: + - Storage + /storage/info: + get: + operationId: get_storage_info_storage_info_get + responses: + '200': + content: + application/json: + schema: {} + description: Successful Response + security: + - HTTPBearer: [] + summary: Get Storage Info + tags: + - Storage diff --git a/gen3workflow/aws_utils.py b/gen3workflow/aws_utils.py index d470cdd..46df3d3 100644 --- a/gen3workflow/aws_utils.py +++ b/gen3workflow/aws_utils.py @@ -15,7 +15,8 @@ def get_iam_user_name(user_id): """ Generate a valid IAM user name for the specified user. IAM user names can contain up to 64 characters. They can only contain alphanumeric characters - and/or the following: +=,.@_- + and/or the following: +=,.@_- (not enforced here since user IDs and hostname should not contain + special characters). Args: user_id (str): The user's unique Gen3 ID diff --git a/tests/test_storage.py b/tests/test_storage.py index 392a3f0..eaca6f6 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -51,7 +51,7 @@ async def test_create_and_list_user_keys(client, access_token_patcher): }, ] - # delete the 2st key + # delete the 1st key res = await client.delete( f"/storage/credentials/{keys[0]['aws_key_id']}", headers={"Authorization": f"bearer 123"}, @@ -102,7 +102,7 @@ async def test_list_user_keys_status(client, access_token_patcher): assert "aws_key_id" in key_data and "aws_key_secret" in key_data keys.append(key_data) - # list the user's key; the 1st key should show as expired + # list the user's keys; the 1st key should show as expired res = await client.get( "/storage/credentials", headers={"Authorization": f"bearer 123"} ) @@ -121,7 +121,7 @@ async def test_list_user_keys_status(client, access_token_patcher): ) access_key.deactivate() - # list the user's key; both keys should now show as expired + # list the user's keys; both keys should now show as expired res = await client.get( "/storage/credentials", headers={"Authorization": f"bearer 123"} )