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: DEPR USE-JWT-COOKIE header #922

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 1 addition & 5 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ To get a JWT role defined inside your cookie, do the following:
"enterprise_learner:{another-enterprise-uuid}",
"enterprise_openedx_operator:*"
]
#. Soon, you'll make a request to e.g. http://localhost:18160/api/v1/enterprise-catalogs/?format=json. Before you do this,
it's important that you can make the request with an additional header: ``use_jwt_cookie: true`` This tells
our auth middleware to "reconstitute" the JWT cookie header and signature into a single JWT from which auth, roles, etc.
can be fetched. You can do this in your browser using a tool like ModHeader, or with something like Postman.
#. Make the request. For the example endpoint above, you should get a response payload that looks like::
#. Make a request to e.g. http://localhost:18160/api/v1/enterprise-catalogs/?format=json. For this example endpoint, you should get a response payload that looks like::

{
"count": 2,
Expand Down
4 changes: 1 addition & 3 deletions enterprise_catalog/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@

# Enable CORS
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_HEADERS = corsheaders_default_headers + (
'use-jwt-cookie',
)
CORS_ALLOW_HEADERS = corsheaders_default_headers
CORS_ORIGIN_WHITELIST = []

ROOT_URLCONF = 'enterprise_catalog.urls'
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ edx-auth-backends
edx-celeryutils
edx-django-release-util
edx-django-utils
edx-drf-extensions
edx-drf-extensions>=10.2.0 # removes use-jwt-cookie header
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewer: This is just to ensure this doesn't get downgraded later. This repo is already at 10.3.0.

edx_rbac
edx-rest-api-client
edx-toggles
Expand Down
Loading