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

Support OAuth Application Endpoints [AHOY-3610] #2526

Conversation

Annmary12
Copy link
Contributor

@Annmary12 Annmary12 commented Jan 24, 2025

Summary

Enhance the CMA JS Client to include support for the newly introduced OAuth application endpoints.

Description

Supports a new method called accessToken.

For a plain client, it has the following functions.

  • getOAuthApplication({userId: 'testUserID', oauthApplicationId: 'testOAuthApplicationId'})

For nonplain clients, it has the following functions

  • oauthApplication.get({userId: 'testUserID', oauthApplicationId: 'testOAuthApplicationId'})
  • oauthApplication.getManyForUser({userId: 'testUserID'})
  • oauthApplication.create({userId: 'testUserID'}, {name: 'Test-Name', description: 'Test-Desc', scopes: ['content_management_manage'], redirectUri: 'https://redirect.uri.com', confidential: true})
  • oauthApplication.update({userId: 'testUserID', oauthApplicationId: 'testOAuthApplicationId'}, {name: 'Updated name'})
  • oauthApplication.delete({userId: 'testUserID', oauthApplicationId: 'testOAuthApplicationId'})

Motivation and Context

Checklist (check all before merging)

  • Both unit and integration tests are passing
  • There are no breaking changes
  • Changes are reflected in the documentation

When adding a new method:

  • The new method is exported through the default and plain CMA client
  • All new public types are exported from ./lib/export-types.ts
  • Added a unit test for the new method
  • Added an integration test for the new method
  • The new method is added to the documentation

@Annmary12 Annmary12 requested a review from a team as a code owner January 24, 2025 14:50
@Annmary12 Annmary12 force-pushed the feat/AHOY-3610-support-cma-client-for-oauth-applications-endpoint branch from 202f6e9 to 686b07b Compare January 27, 2025 10:01
@Annmary12 Annmary12 requested a review from piankovev January 27, 2025 12:52
piankovev
piankovev previously approved these changes Jan 28, 2025
Copy link
Contributor

@whitelisab whitelisab left a comment

Choose a reason for hiding this comment

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

Looks great! 🎊 Just two small suggestions to update (renaming the endpoints file and fixing a small typo) and then two non-blocking questions

lib/common-types.ts Outdated Show resolved Hide resolved
lib/adapters/REST/endpoints/index.ts Outdated Show resolved Hide resolved
lib/create-contentful-api.ts Show resolved Hide resolved
test/unit/entities/oauth-application.ts Outdated Show resolved Hide resolved
@Annmary12 Annmary12 force-pushed the feat/AHOY-3610-support-cma-client-for-oauth-applications-endpoint branch 3 times, most recently from e964887 to 32c68a4 Compare January 30, 2025 12:45
@Annmary12 Annmary12 force-pushed the feat/AHOY-3610-support-cma-client-for-oauth-applications-endpoint branch from 32c68a4 to acb354f Compare January 30, 2025 13:03
@Annmary12 Annmary12 requested a review from whitelisab January 30, 2025 13:40
@Annmary12 Annmary12 merged commit 9e4a4ce into master Jan 30, 2025
7 checks passed
@Annmary12 Annmary12 deleted the feat/AHOY-3610-support-cma-client-for-oauth-applications-endpoint branch January 30, 2025 16:00
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.46.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants