-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 netrc as auth type #384
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, {PureComponent} from 'react'; | ||
|
||
class NetrcAuth extends PureComponent { | ||
render () { | ||
return ( | ||
<div className="vertically-center text-center"> | ||
<p className="pad super-faint text-sm text-center"> | ||
<br/> | ||
Your netrc file will be used to authenticate this request | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default NetrcAuth; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ declare class Curl { | |
HTTPPOST: number, | ||
INFILESIZE: number, | ||
KEYPASSWD: number, | ||
NETRC: number, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add these to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! The only test I could think of would be pulling creds out of a mocked There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking of something even simpler. If you look at the other tests in there, they basically just make sure the correct options are passed to libcurl. It's safe to assume that libcurl will do the right thing if it gets the correct options. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a simple test! |
||
NOBODY: number, | ||
NOPROGRESS: number, | ||
NOPROXY: number, | ||
|
@@ -49,6 +50,12 @@ declare class Curl { | |
CURLE_ABORTED_BY_CALLBACK: string | ||
}; | ||
|
||
static netrc: { | ||
IGNORED: number, | ||
OPTIONAL: number, | ||
REQUIRED: number, | ||
}; | ||
|
||
static info: { | ||
EFFECTIVE_URL: string, | ||
SIZE_DOWNLOAD: string, | ||
|
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 does
REQUIRED
mean here?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.
A user:password in the URL will be ignored. Unless one is set programmatically, the .netrc will be queried.
I thought this was a good way for it to behave, since falling back to the password in the URL might be werid behaviour. Could be set to Optional if you think that's better tho!