Boundary auth without a keyring configured behaves like -keyring-type none (#4268)

pull/4270/head
Todd 2 years ago committed by GitHub
parent fa69ddcb8a
commit 0dac9005c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -102,7 +102,7 @@ func (w *CommandWrapper) addTokenToCache(ctx context.Context, token string) bool
return false
}
keyringType, tokName, err := w.BaseCommand().DiscoverKeyringTokenInfo()
if err != nil {
if err != nil && token == "" {
return false
}
if token != "" {

@ -98,6 +98,10 @@ func saveAndOrPrintToken(c *base.Command, result *authmethods.AuthenticateResult
switch {
case gotErr:
c.UI.Warn(fmt.Sprintf("The token was not successfully saved to a system keyring. The token is:\n\n%s\n\nIt must be manually passed in via the BOUNDARY_TOKEN env var or -token flag. Storing the token can also be disabled via -keyring-type=none.", token.Token))
if opts.WithInterceptedToken != nil {
*opts.WithInterceptedToken = token.Token
}
case c.FlagKeyringType == "none":
c.UI.Warn("\nStoring the token in a keyring was disabled. The token is:")
c.UI.Output(token.Token)

Loading…
Cancel
Save