-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/app api access #1384
Merged
Merged
Feature/app api access #1384
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
2 tasks
michaeljcollinsuk
force-pushed
the
feature/app-api-access
branch
from
November 25, 2024 11:45
cf24d7b
to
4c59e25
Compare
jamesstottmoj
previously approved these changes
Nov 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally. Followed instructions and could access API and customer endpoints.
Encountered no issues
michaeljcollinsuk
force-pushed
the
feature/app-api-access
branch
2 times, most recently
from
November 29, 2024 14:32
57c417c
to
b0e8005
Compare
Update Auth0 client to allow creation of M2M applications
One time display client credentials for M2M clients and allow the client secret to be rotated.
If the client secret rotation fails because the client cannot be found, remove the stored client ID and ask the user to try creating a new one.
Share behavious via a mixin rather than inheriting from the same view. Filter the app queryset to objects that the request user is an admin for.
To keep consistency with the rest of the views, allow permission checks to be done using rules.
michaeljcollinsuk
force-pushed
the
feature/app-api-access
branch
from
December 2, 2024 10:06
b0e8005
to
2c28654
Compare
jamesstottmoj
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Summary
This PR contains implementation of ministryofjustice/analytical-platform#5777
These changes will allow app admins to create a machine to machine Auth0 client that use the client credential grant flow to retrieve an access token for the Control Panel API. More details about m2m authorization via Auth0 can be found here https://auth0.com/blog/using-m2m-authorization/.
When a machine-to-machine client is created, it is granted specific permissions that only allow it access specific app-related endpoints. Apps will have access to endpoints that will allow them to:
The permissions that are granted to the M2M apps have been created manually in the auth0 dev tenant, for the Control Panel localhost and dev API applications. These will need to be added to the alpha auth0 tenant before deploying to production.
Merging this PR will have the following side-effects:
🔍 What should the reviewer concentrate on?
🧑💻 How should the reviewer test these changes?
OIDC_CPANEL_API_AUDIENCE
to"control-panel-localhost"
. This ensures that when the M2M client is created, it is granted permissions for the localhost API application in auth0, rather than the dev application.AppJwtPermissions
should be accessible.http://localhost:8000/api/cpanel/v1/apps/app_name/<app-name-here>/
📚 Documentation status