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

Add Organizations for Client Credentials #432

Merged
merged 11 commits into from
Aug 26, 2024

Conversation

duedares-rvj
Copy link
Contributor

@duedares-rvj duedares-rvj commented Aug 13, 2024

🔧 Changes

  1. Added new field calleddefault_organization to GET/PATCH endpoints /api/v2/clients/{id}
  2. Added new field calleddefault_organization to POST endpoints /api/v2/clients/
  3. Support query param q for GET /api/v2/clients
    • q=client_grant.organization_id:org_sampleorgid213
    • q=client_grant.allow_any_organization:true
  4. Support query param identifiers for GET /api/v2/organizations/{org_id}/client-grants
    • identifiers=https%3A%2F%2Fmy-api.example.com
  5. Support query param grant_ids for GET /api/v2/resource-servers
    • grant_ids=cgr_123456789012,cgr_abcdefghijkl

📚 References

Required changes have been made in line with the documentation here
Management API docs here

🔬 Testing

Relevant test cases and their recordings have been added to ensure changes as described above.
All created resources are cleaned up after the assertions are completed.

make test FILTER=TestOrganizationManager_ClientGrantsWithOrg

  • Create an Organization and ResourceServer
  • Create a client with DefaultOrganization parameter and set the org.
  • Create a clientGrant under the client created before.
  • Associate the clientGrant with the Organization created before.
  • List clients filtered with query param and assert.
  • List clientGrants filtered with query param and assert.
  • Remove the associated ClientGrants.
  • Re-list clientGrants filtered with query param and ensure length is 0.
  • Delete the clientGrant.
  • Retrieve the clientGrant and ensure error is return since grant has been deleted.
  • Delete all pending resources as part of the cleanup process.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@duedares-rvj duedares-rvj marked this pull request as ready for review August 16, 2024 07:45
@duedares-rvj duedares-rvj requested a review from a team as a code owner August 16, 2024 07:45
@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.65%. Comparing base (e219463) to head (6c537e9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #432   +/-   ##
=======================================
  Coverage   95.64%   95.65%           
=======================================
  Files          49       49           
  Lines        8158     8172   +14     
=======================================
+ Hits         7803     7817   +14     
  Misses        238      238           
  Partials      117      117           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@duedares-rvj duedares-rvj changed the title Organizations for Client Credentials Add Organizations for Client Credentials Aug 20, 2024
acwest
acwest previously approved these changes Aug 20, 2024
acwest
acwest previously approved these changes Aug 21, 2024
Copy link
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

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

LGTM

@developerkunal developerkunal merged commit 0c331b7 into main Aug 26, 2024
9 checks passed
@developerkunal developerkunal deleted the SDK-4915/client-credentials branch August 26, 2024 15:19
@developerkunal developerkunal mentioned this pull request Sep 3, 2024
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.

4 participants