Skip to content

Commit

Permalink
fix: put api_credentials bool in api response (#1859)
Browse files Browse the repository at this point in the history
* fix: put api_credentials bool in api response

* fix: url fix for credentials url

* fix: version bump
  • Loading branch information
kiram15 committed Aug 31, 2023
1 parent 3c12242 commit b014ca8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Change Log
Unreleased
----------
[4.1.6]
-------
fix: putting api_credentials bool in api response to access in admin portal

[4.1.5]
-------
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Your project description goes here.
"""

__version__ = "4.1.5"
__version__ = "4.1.6"

default_app_config = "enterprise.apps.EnterpriseConfig"
2 changes: 1 addition & 1 deletion enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class Meta:
'enable_executive_education_2U_fulfillment', 'enable_portal_reporting_config_screen',
'enable_portal_saml_configuration_screen', 'contact_email',
'enable_portal_subscription_management_screen', 'hide_course_original_price', 'enable_analytics_screen',
'enable_integrated_customer_learner_portal_search',
'enable_integrated_customer_learner_portal_search', 'enable_generation_of_api_credentials',
'enable_portal_lms_configurations_screen', 'sender_alias', 'identity_providers',
'enterprise_customer_catalogs', 'reply_to', 'enterprise_notification_banner', 'hide_labor_market_data',
'modified', 'enable_universal_link', 'enable_browse_and_request', 'admin_users'
Expand Down
10 changes: 5 additions & 5 deletions enterprise/api/v1/views/enterprise_customer_api_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create(self, request, *args, **kwargs):
Method: POST
URL: /enterprise/api/v1/enterprise_customer_api_credentials/{enterprise_uuid}
URL: /enterprise/api/v1/enterprise-customer-api-credentials/{enterprise_uuid}
Returns 201 if a new API application credentials was created.
If an application already exists for the user, throw a 409.
Expand Down Expand Up @@ -94,7 +94,7 @@ def destroy(self, request, *args, **kwargs):
"""
Method: DELETE
URL: /enterprise/api/v1/enterprise_customer_api_credentials/{enterprise_uuid}
URL: /enterprise/api/v1/enterprise-customer-api-credentials/{enterprise_uuid}
"""
enterprise_uuid = kwargs['enterprise_uuid']
if not enterprise_uuid:
Expand All @@ -112,7 +112,7 @@ def retrieve(self, request, *args, **kwargs):
"""
Method: GET
URL: /enterprise/api/v1/enterprise_customer_api_credentials/{enterprise_uuid}
URL: /enterprise/api/v1/enterprise-customer-api-credentials/{enterprise_uuid}
"""
enterprise_uuid = kwargs['enterprise_uuid']
if not enterprise_uuid:
Expand All @@ -130,7 +130,7 @@ def update(self, request, *args, **kwargs):
"""
Method: PUT
URL: /enterprise/api/v1/enterprise_customer_api_credentials/{enterprise_uuid}
URL: /enterprise/api/v1/enterprise-customer-api-credentials/{enterprise_uuid}
"""
# Verifies the requesting user is connected to an enterprise that has API credentialing bool set to True
user = request.user
Expand Down Expand Up @@ -182,7 +182,7 @@ def update(self, request, *args, **kwargs):
"""
Method: PUT
URL: /enterprise/api/v1/enterprise_customer_api_credentials/{enterprise_uuid}/regenerate_credentials
URL: /enterprise/api/v1/enterprise-customer-api-credentials/{enterprise_uuid}/regenerate_credentials
"""
enterprise_uuid = kwargs['enterprise_uuid']

Expand Down
9 changes: 7 additions & 2 deletions tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,8 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'modified': '2021-10-20T19:01:31Z',
'enable_universal_link': False,
'enable_browse_and_request': False,
'admin_users': []
'admin_users': [],
'enable_generation_of_api_credentials': False,
}],
),
(
Expand Down Expand Up @@ -1232,6 +1233,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'hide_labor_market_data': False, 'modified': '2021-10-20T19:01:31Z',
'enable_universal_link': False, 'enable_browse_and_request': False,
'admin_users': [],
'enable_generation_of_api_credentials': False,
},
'active': True, 'user_id': 0, 'user': None,
'data_sharing_consent_records': [], 'groups': [],
Expand Down Expand Up @@ -1316,6 +1318,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_universal_link': False,
'enable_browse_and_request': False,
'admin_users': [],
'enable_generation_of_api_credentials': False,
}],
),
(
Expand Down Expand Up @@ -1376,6 +1379,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_universal_link': False,
'enable_browse_and_request': False,
'admin_users': [],
'enable_generation_of_api_credentials': False,
}],
),
(
Expand Down Expand Up @@ -1594,7 +1598,8 @@ def test_enterprise_customer_with_access_to(
'modified': '2021-10-20T19:32:12Z',
'enable_universal_link': False,
'enable_browse_and_request': False,
'admin_users': []
'admin_users': [],
'enable_generation_of_api_credentials': False,
}
else:
assert response == expected_error
Expand Down

0 comments on commit b014ca8

Please sign in to comment.