-
Notifications
You must be signed in to change notification settings - Fork 511
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
Introduce env. variable NOTARY_AUTH for setting username & password #1246
Introduce env. variable NOTARY_AUTH for setting username & password #1246
Conversation
Can one of the admins verify this patch? |
a0a8ef4
to
21ee339
Compare
In case of automation it may not be possible to prompt the user for username and password. To provide a way to pass username and password we introduce the NOTARY_AUTH environment variable through which username and password can be passed. Username and password must be separated by ':' and base64 encoded. The following example shows how to set username and password: > export NOTARY_AUTH="$(echo -n "me:mysecretpassword" | base64)" Decoding: > echo $NOTARY_AUTH | base64 -d me:mysecretpassword Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
21ee339
to
6b49e10
Compare
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.
thank you @stefanberger this is very useful, LGTM!
return username, password | ||
} | ||
|
||
logrus.Error("Malformatted authentication string; format must be <username>:<password>") |
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'm debating whether it makes sense for this to be a fatal error here. This is only used in the CLI so it seems like it would be desirable to exit ASAP if we've made the decision the inputs are bad. Thoughts?
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.
Would be fine by me. I followed the existing pattern where we don't exit with fatal error on timeout from keyboard input, either. Maybe that should then be changed as well in either a preceding patch or one on top of this 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.
The test cases would not be able to test false inputs, though. Running into failures would exit the test case...
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.
hmmm yeah, definitely prefer having the tests work properly. We'll leave this as is 👍
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.
LGTM
In case of automation it may not be possible to prompt the user
for username and password. To provide a way to pass username and
password we introduce the NOTARY_AUTH environment variable through
which username and password can be passed. Username and password
must be separated by ':' and base64 encoded.
The following example shows how to set username and password:
Decoding:
Signed-off-by: Stefan Berger stefanb@linux.vnet.ibm.com