-
Notifications
You must be signed in to change notification settings - Fork 233
Don't let .netrc take precedence in ApiClient #526
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
Codecov Report
@@ Coverage Diff @@
## main #526 +/- ##
==========================================
+ Coverage 60.93% 64.79% +3.86%
==========================================
Files 55 55
Lines 4669 4727 +58
==========================================
+ Hits 2845 3063 +218
+ Misses 1824 1664 -160
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
fjakobs
left a comment
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.
Fix looks reasonable but I'd like to get @pietern's opinion before merging since it would be a breaking change.
|
We can't merge this as is. Reading through the linked issues, there's an opportunity to do this in a non-breaking way. The default auth handler checks the host and overrides a token from |
|
This is a nice workaround. In the body we could check for the |
The cli checks that there should be atleast 1 form of accepted configuration methods (spark config, environment variables or databrickscfg) are present. So there should be no cli user directly dependent on a For users using the api client directly from the sdk, the fallback should provide them the similar experience as they have now, with the caveat that now other forms of configurations will take precedence (earlier |
pietern
left a comment
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.
Please add a couple tests:
.netrcexists with a valid entry, but auth is specified elsewhere..netrcexists with a valid entry, auth is not specified..netrcexists with an invalid entry.netrcdoes not exist
As is, I'm worried what would happen all cases but the first.
It's one we need to call out in the changelog / release notes though ;-) |
pietern
left a comment
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.
What happens if you have a netrc file with garbage / invalid content?
I expect the default behavior in the requests library is to ignore it. Can you confirm this implementation does the same?
pietern
left a comment
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.
Looks great, thank you!
.netrcconfigurations for authentication. (option to disable .netrc psf/requests#2773)