DXCDT-294: Add all management API scopes #538
Merged
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.
🔧 Changes
Previously, only required scopes were requested during device flow authentication, which was a sensible decision given that the capabilities of the CLI were finite. However, now that the
api
command exists (docs), the Auth0 CLI now technically has the capability to execute any Auth0 Management API request. Because of this, we need to request all scopes during authentication.Otherwise, requests made to endpoints that lack sufficient scope will be greeted with an error.
Example:
While this seems like a possible over-provisioning of scopes, the precedent has already been set that all Auth0 CLI capabilities have the correlating scopes requested. This change is an acknowledgement that the Auth0 CLI has complete feature parity with the Management API now.
Perhaps in the future we will evaluate a mechanism for the user to specify the scopes that they want to grant, but that is way out the scope of this ticket.
This will also mean that as the Management API expands the available scopes due to expansion, the Auth0 CLI will also need to update this lists of scopes to enable those features to be used in this tool via the
api
command.📚 References
api
command PR: DXCDT-264: Add api command #531📝 Checklist