From 4740d22a630ce7096c211ec752690f4b868d2292 Mon Sep 17 00:00:00 2001 From: Sameen Fatima Date: Wed, 8 May 2024 17:08:33 +0500 Subject: [PATCH] feat: expose assignment remind api on Gateway --- scripts/aws/deploy.py | 5 ++++- swagger/api.yaml | 11 ++++++++--- tests/test_enterprise_access.yaml | 24 ++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/scripts/aws/deploy.py b/scripts/aws/deploy.py index 2547c90..6b79f59 100755 --- a/scripts/aws/deploy.py +++ b/scripts/aws/deploy.py @@ -49,6 +49,8 @@ help="Location of Studio for authoring request routing") parser.add_argument('--license-manager-host', required=True, help="Location of License Manager IDA for request routing") + parser.add_argument('--enterprise-access-host', required=True, + help="Location of Enterprise Access IDA for request routing") cli_args = parser.parse_args() integration_settings = { @@ -62,7 +64,8 @@ 'registrar_host': cli_args.registrar_host, 'enterprise_catalog_host': cli_args.enterprise_catalog_host, 'authoring_host': cli_args.authoring_host, - 'license_manager_host': cli_args.license_manager_host + 'license_manager_host': cli_args.license_manager_host, + 'enterprise_access_host': cli_args.enterprise_access_host } stage_settings = { 'log_level': cli_args.log_level, diff --git a/swagger/api.yaml b/swagger/api.yaml index b83be0d..0b482c6 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -36,9 +36,7 @@ paths: "/catalog/v1/catalogs/{id}/courses": $ref: "https://raw.githubusercontent.com/edx/course-discovery/b5c52c8/api.yaml#/endpoints/v1/catalogCourses" - # Enterprise Access IDA - "/enterprise-access/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/cancel/": - $ref: "https://raw.githubusercontent.com/openedx/enterprise-access/31185ee/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest" + # Enterprise IDA "/enterprise/v1/enterprise-catalogs": @@ -65,6 +63,12 @@ paths: $ref: "https://raw.githubusercontent.com/edx/license-manager/b9e9ec9/api.yaml#/endpoints/v1/revokeLicenses" "/enterprise/v1/bulk-license-enrollment": $ref: "https://raw.githubusercontent.com/edx/license-manager/b9e9ec9/api.yaml#/endpoints/v1/bulkLicenseEnrollment" + # Enterprise Access IDA + # These are served from the enterprise-access IDA, but we surface them with the rest of the enterprise endpoints + "/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/cancel/": + $ref: "https://raw.githubusercontent.com/openedx/enterprise-access/747d8b9/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest" + "/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/remind/": + $ref: "https://raw.githubusercontent.com/openedx/enterprise-access/747d8b9/api.yaml#/endpoints/v1/learnerContentAssignmentRemindRequest" # Enterprise Catalog IDA # These are served from the enterprise catalog IDA, but we surface them with the rest of the enterprise endpoints "/enterprise/v2/enterprise-catalogs": @@ -233,3 +237,4 @@ x-edx-api-vendors: - "enterprise_catalog_host" - "authoring_host" - "license_manager_host" + - "enterprise_access_host" diff --git a/tests/test_enterprise_access.yaml b/tests/test_enterprise_access.yaml index 164efd9..a959cad 100644 --- a/tests/test_enterprise_access.yaml +++ b/tests/test_enterprise_access.yaml @@ -4,7 +4,7 @@ - test: - name: 'Assignment configuration cancel endpoint returns HTTP 200' - - url: '/enterprise-access/v1/assignment-configurations/9101d3de36156cba/admin/assignments/cancel/' + - url: '/enterprise/v1/assignment-configurations/9101d3de36156cba/admin/assignments/cancel/' - method: 'POST' - headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' } - body: > @@ -17,6 +17,26 @@ - test: - name: 'GET rejected without authorization' - - url: '/enterprise-access/v1/assignment-configurations/0123456789abcdefg/admin/assignments/cancel/' + - url: '/enterprise/v1/assignment-configurations/0123456789abcdefg/admin/assignments/cancel/' - method: 'POST' - expected_status: [400] + +- test: + - name: 'Assignment configuration remind endpoint returns HTTP 200' + - url: '/enterprise/v1/assignment-configurations/9101d3de36156cba/admin/assignments/remind/' + - method: 'POST' + - headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' } + - body: > + [ + { + "assignment_uuids": ["01234567-89ab-cdef-0123-456789abcdef", "abcdef01-2345-6789-abcd-ef0123456789"] + } + ] + - expected_status: [200] + +- test: + - name: 'GET rejected without authorization' + - url: '/enterprise/v1/assignment-configurations/0123456789abcdefg/admin/assignments/remind/' + - method: 'POST' + - expected_status: [400] +