-
Notifications
You must be signed in to change notification settings - Fork 6
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
added an option to NewHCPConfig() to not auto login when no local aut… #182
added an option to NewHCPConfig() to not auto login when no local aut… #182
Conversation
…h method are found
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.
My main suggestion here is to move the logic entirely into the config package. My review is spread over a few comments, but to sum it up in one place:
- Instead of adding a
noBrowserLogin
flag to the config, we can "turn off" the existingoauth2Config
field. - In the config package, an empty
oauth2Config
can be detected and result in aNoValidAuthFound
.
auth/user.go
Outdated
"fmt" | ||
"log" | ||
"time" | ||
|
||
"golang.org/x/oauth2" | ||
) | ||
|
||
var ( | ||
// ErrorNoValidAuthFound is returned if no local auth methods were found and the invoker created the config with the option WithoutBrowserLogin | ||
ErrorNoValidAuthFound = errors.New("there were no valid auth methods found") |
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 would move this up into the config
package.
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
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.
Thanks for address my feedback! With a couple minor fixes, it's good to go!
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.
This is just a rubber stamp approval to +1
@bcmdarroch's review until we can remove @hashicorp/experiences-platform from this repo's CODEOWNERS
file.
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
Co-authored-by: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com>
…h method are found
🛠️ Description
🔗 External Links
👍 Definition of Done