-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add various cleanliness changes (#114)
* Use oauth2 package for the token exchange call This should also fix a bug where non-HTTP 200 responses are not caught and result in a cryptic error later in the exchange process * Use OAuth2 package more heavily to simplify code * Pass client through context. This would normally be frowned upon but we know we will only be using OAuth2's APIs to interact with Okta anyway. * Implement oauth2.TokenSource on TokenSet, which removes the need to manually construct *oauth2.Token. * Parse the ID token in LoginCommand, not in the Config The config shouldn't "know" anything about the minutae of the token it is receiving. * Move socket creation into LoginCommand Takes the HandlePendingSession function much simpler * Move port handling out of the oauth2 file * Use ClientContext() instead of the context key directly * Use slices.Contains() instead of our own custom function * Refactor Get to have a struct, like Login * Use a writer pattern for exporting environment variables * Move things around to reduce symbols in main package * Remove unused package go-rootcerts This was necessary due a bug in Go (golang/go#14514) that was resolved in Go 1.8. * Move oauth2 things of the command package * Remove partial Tencent Cloud support This will be reimplemented at some point in the future, but this has not been working since 85f224a and attempting to use it results in a run-time panic. * Use OIDC library for fetching UserInfo The UserInfo endpoint for Okta is standards-compliant, so we should use a standards-compliant library to access it * Use newer versions of Go & aws-lambda-go * Use the v2 AWS SDK * Use official Hashicorp SDK for Vault * Do not use AWS auth for Vault Instead of using AWS authentication for Vault, users should be instructed to use the Hashicorp Vault extension for AWS Lambda; KeyConjurer's Lambda functions are not made aware of any authentication details. https://developer.hashicorp.com/vault/docs/platform/aws/lambda-extension * Rename the environment variables VAULT_SECRET_PATH conflicts with the Lambda extension. * Correct key-value * Put binaries in bin/ * Remove unused packages * Disable CGO * Fix secret decoding * Remove the Lambdaify handler to simplify code * Convert Switch command to be struct-based * Update LoginCommand to match SwitchCommand * Remove flags and command from GetCommand * Hide OIDC flags * Update Windows and WSL usage instructions Co-authored-by: dpantry <[email protected]> Co-authored-by: ext-jmendes <[email protected]> --------- Co-authored-by: ext-jmendes <[email protected]>
- Loading branch information
1 parent
2801c91
commit 5ff3e2f
Showing
52 changed files
with
1,489 additions
and
2,020 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,3 +249,4 @@ cli/keyconjurer-darwin* | |
cli/keyconjurer-linux* | ||
cli/keyconjurer-windows.exe | ||
vendor | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.