-
Notifications
You must be signed in to change notification settings - Fork 224
Helpful error when okta credentials not in keyring #238
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.
@pelletier looks good!
@@ -598,6 +598,9 @@ type OktaProvider struct { | |||
func (p *OktaProvider) Retrieve() (sts.Credentials, string, error) { | |||
log.Debugf("Using okta provider (%s)", p.OktaAccountName) | |||
item, err := p.Keyring.Get(p.OktaAccountName) | |||
if err == keyring.ErrKeyNotFound { |
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.
@pelletier on second thought, could we move this error handling into the cmd
package one level up where Retrieve
is called. This feels like something the CLI client should be responsible for.
If you like, you could just add it to one of the commands to start and have a TODO there.
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.
Put here because the same handling was performed a few lines below. Happy to move both if you think it’s better.
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 think we can keep the unmarshal error here for now, and move the ErrKeyNotFound
outside. What do you think?
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.
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.
Yeah it's pretty minor, let's merge this in the meantime 👍
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.
One more comment
No description provided.