-
Notifications
You must be signed in to change notification settings - Fork 31
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
Allow credentials to be configured via an environment variable #70
Conversation
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.
Pretty much LGTM, Just some small comments. Approving in case you don't agree with those comments.
credentials.go
Outdated
at := strings.IndexRune(e.value, '@') | ||
colon := strings.IndexRune(e.value, ':') | ||
if at == -1 || colon == -1 || at > colon { | ||
return nil, errors.New("invalid $NTLM_CREDENTIALS, please run `alpaca -H`") |
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.
Technically, this bit of code has no idea about envvars or specifically the NTLM_CREDENTIALS
var. It really is just a string source, which could also be used later when implementing a config file.
Also I wonder whether the parsing of user@domain:hash belongs in authenticator
, much as I suggested elsewhere that the formatting of the three fields perhaps belongs in a String()
function on authenticator. At the moment, knowledge of this format is split between here and main()
.
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
This allows non-interactive use of Alpaca on Linux and Windows.