Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose assignment remind api on Gateway #298

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/aws/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down
11 changes: 8 additions & 3 deletions swagger/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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":
Expand Down Expand Up @@ -233,3 +237,4 @@ x-edx-api-vendors:
- "enterprise_catalog_host"
- "authoring_host"
- "license_manager_host"
- "enterprise_access_host"
24 changes: 22 additions & 2 deletions tests/test_enterprise_access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand All @@ -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]