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: add JWT support #109

Merged
merged 1 commit into from
Oct 2, 2024
Merged

feat: add JWT support #109

merged 1 commit into from
Oct 2, 2024

Conversation

bra-i-am
Copy link
Contributor

@bra-i-am bra-i-am commented Sep 25, 2024

Description

This PR allows you to make requests using a JWT

How to test

  1. Install the plugin with these changes
  2. Install the Forum Tutor Plugin with tutor plugins install forum && tutor plugins enable forum
  3. Create a new application from http://local.edly.io:8000/admin/oauth2_provider/application/. Associate a user with sufficient permissions and add to the Redirect uris field: http://local.edly.io:8000/
  4. Add the following setting to the tenant you are using:
"EOX_TAGGING_DEFINITIONS": [
       {
           "access": "public",
           "owner_object": "site",
           "tag_type": "subscription_level",
           "validate_target_object": "user"
       },
       {
           "access": "public",
           "owner_object": "site",
           "tag_type": "subscription_level_enrollment",
           "validate_target_object": "courseenrollment"
       },
       {
           "access": "public",
           "owner_object": "site",
           "tag_type": "subscription_level_course",
           "validate_target_object": "OpaqueKeyProxyModel"
       },
       {
           "access": "public",
           "owner_object": "user",
           "tag_type": "subscription_level_user",
           "validate_target_object": "user"
       }
   ]

Note

For more information about the eox-tagging configuration please follow the Test Cases Doc

  1. Open Postman and import the Collection and Environment at docs/resources adding the required env info according to the previously created application
  2. Generate a JWT using the Authorization POST route from the collection; the generated token will be added automatically to the environment
  3. Run the endpoints from the collection previously imported following the ascending numeration

JIRA ISSUE AP-1111

Copy link
Contributor

@magajh magajh left a comment

Choose a reason for hiding this comment

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

Thank you @bra-i-am!

docs/resources/eox-tagging-env.postman_environment.json Outdated Show resolved Hide resolved
docs/resources/eox-tagging.postman_collection.json Outdated Show resolved Hide resolved
requirements/constraints.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@BryanttV BryanttV left a comment

Choose a reason for hiding this comment

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

Hi @bra-i-am, I tested all the endpoints locally in Redwood, and it allows using JWT, thanks!. I just left a comment about the URL in the DELETE methods in the Postman collection.

docs/resources/eox-tagging.postman_collection.json Outdated Show resolved Hide resolved
docs/resources/eox-tagging.postman_collection.json Outdated Show resolved Hide resolved
docs/resources/eox-tagging.postman_collection.json Outdated Show resolved Hide resolved
Copy link
Contributor

@BryanttV BryanttV left a comment

Choose a reason for hiding this comment

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

@bra-i-am, Sorry for not noticing it before, but I think we should bump the version.

* docs: add Postman collection and env variables references
Copy link
Contributor

@BryanttV BryanttV left a comment

Choose a reason for hiding this comment

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

LGTM! thanks

@bra-i-am bra-i-am merged commit ca083fd into master Oct 2, 2024
11 checks passed
@bra-i-am bra-i-am deleted the bc/add-jwt-support branch October 2, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants