-
Notifications
You must be signed in to change notification settings - Fork 59
Add custom scopes support in OAuth authentication methods #1374
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
Conversation
| ClientID: tc.clientID, | ||
| AccountID: tc.accountID, | ||
| Host: tc.host, | ||
| Scopes: []string{"all-apis"}, |
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.
This change is being made to an existing test that relied on "all-apis" being hard coded further downstream. The test exercises a part of the WIF flow that now expects the default scope of "all-apis" to already have been set if scopes are left empty.
3ce3b15 to
dab64d8
Compare
6bcf771 to
737f291
Compare
737f291 to
466fc83
Compare
466fc83 to
dab64d8
Compare
| } | ||
| } | ||
|
|
||
| func TestConfigFile_Scopes(t *testing.T) { |
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.
Should we remove this test? It looks redundant with the two tests we have added. If you decide to keep it, please update:
withMockEnv(t, map[string]string{})
t.Setenv("HOME", "testdata/scopes")to
withMockEnv(t, map[string]string{"HOME": "testdata/scopes"})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.
I would prefer keeping it as it acts as an integration test and ensures backwards compatibility (the first case checks that "all-apis" is used if no scopes are provided in the config file).
Made the change.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
## Summary One-line change passing configured scopes instead of hard-coded value "all-apis". You might also see changes from parent branch #1374 ## Testing Test the (mocked) authentication of requests configured for M2M with various different scopes (nil, empty, single, multiple unsorted). Custom scopes tested for both Account and Workspace level requests. --- NO_CHANGELOG=true
Summary
ScopesandDisableOAuthRefreshTokenfields.Notes
Testing
.databrickscfgfile.Subsequent PRs add support for custom scopes in OAuth authentication methods:
NO_CHANGELOG=true