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 entity's collaborator removal filter to SearchAccounts #6926

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

nicholaspcr
Copy link
Contributor

@nicholaspcr nicholaspcr commented Feb 12, 2024

Summary

Closes #6908

Changes

  • Add new field complement_collaborators in SearchAccountsRequest.
  • Update bunstore to process new field in the SearchAccountsRequest message.
  • Add tests to validate new behavior

Testing

Unit tests and manual tests.

test steps

Testing the existence of the routes and their desired behavior.

  1. Start the stack
  2. create 2 users: [user-1,user-2]
  3. create one of: [ application, gateway, client, organization ]
  4. Add one of the users as a collaborator for each entity.

Do two HTTP requests for each of the entities, below are example with organizations:

First for accounts that are within an entity collaborator list:

curl -i -X GET "http://localhost:1885/api/v3/organizations/<org_id>/collaborators/search" \
        -H "Accept: application/json" \
        -H "Authorization: Bearer <token>"

Second for accounts that are outside the entity collaborator list:

curl -i -X GET "http://localhost:1885/api/v3/organizations/org-1/collaborators/search?complement_collaborators=true" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer <token>" 

Below is the list of Stack's URLs so that you can test it for each entity:

http://localhost:1885/api/v3/applications/<app_id>/collaborators/search
http://localhost:1885/api/v3/clients/<client_id>/collaborators/search
http://localhost:1885/api/v3/gateways/<gtw_id>/collaborators/search
http://localhost:1885/api/v3/organizations/<app_id>/collaborators/search

Notes for Reviewers

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • The steps/process to test this feature are clearly explained including testing for regressions.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@nicholaspcr nicholaspcr added this to the v3.29.1 milestone Feb 12, 2024
@nicholaspcr nicholaspcr self-assigned this Feb 12, 2024
@github-actions github-actions bot added c/identity server This is related to the Identity Server compat/db This could affect Database compatibility labels Feb 12, 2024
@nicholaspcr nicholaspcr marked this pull request as ready for review February 12, 2024 19:27
@nicholaspcr nicholaspcr requested review from a team as code owners February 12, 2024 19:27
@nicholaspcr nicholaspcr force-pushed the issue/6908-account-search-filter-collaborators branch from 6774118 to d3ff64b Compare February 15, 2024 15:43
@nicholaspcr
Copy link
Contributor Author

@adriansmares reminder of this PR

@nicholaspcr nicholaspcr merged commit a9ae3f7 into v3.29 Feb 20, 2024
16 checks passed
@nicholaspcr nicholaspcr deleted the issue/6908-account-search-filter-collaborators branch February 20, 2024 12:35
@KrishnaIyer
Copy link
Member

Does this need a changelog entry?

@nicholaspcr
Copy link
Contributor Author

Yeah, I'll open a PR with the changelog addition informing of the complement_collaborators field in the SearchAccounts method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/identity server This is related to the Identity Server compat/db This could affect Database compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow filtering an entity's collaborators when searching for accounts
3 participants