Skip to content
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

Tencent Cloud support #99

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

punmechanic
Copy link
Member

This PR re-implements Tencent Cloud support for KeyConjurer v2.

There are a few limitations to Tencent Cloud support which make it less-than-seamless to use:

  • Tencent Cloud applications cannot use the Token Exchange endpoint in Okta due to Okta limitations, which means that sessions must instead be initiated by directly visiting the application URL.
  • Consequently, the application URL and a type flag must be added to the returned applications from our API to indicate that an application is a Tencent Cloud application and stored within the configuration.
  • Because it's not possible to construct the link with just the application ID, the --bypass-cache flag cannot be used with Tencent applications; a Tencent Cloud application must be within the cache.

@punmechanic punmechanic changed the title Tencent Cloud suport Tencent Cloud support Sep 25, 2023
@@ -82,7 +85,6 @@ A role must be specified when using this command through the --role flag. You ma
outputType, _ := cmd.Flags().GetString(FlagOutputType)
shellType, _ := cmd.Flags().GetString(FlagShellType)
roleName, _ := cmd.Flags().GetString(FlagRoleName)
cloudType, _ := cmd.Flags().GetString(FlagCloudType)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now infer the cloud type from the application in the cache. Giving the user the option to specify this doesn't make much sense - They'll almost certainly get it wrong. As such, this is removed.

It'll be removed from switch.go as well.

cli/get.go Outdated
@@ -166,7 +211,8 @@ A role must be specified when using this command through the --role flag. You ma
ttl = config.TTL
}

if cloudType == cloudAws {
switch cloudType {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably fold this switch statement into the previous one if we're smart

return ApplicationTypeAWS, true
}

if strings.Contains(strings.ToLower(app.AppName), "tencent") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to be changed depending on our implementation -- Okta doesn't have good first-class support for Tencent Cloud so they don't have a defined naming scheme, but we need a naming scheme to identify them.

Most likely, app.AppName will be set to something like keyconjurer_tencent to be able to discern keyconjurer-enabled Tencent Cloud applications from ones that just take you to the console.

cli/get.go Outdated

// TODO: Spin up a web server that listens for a SAML callback.

// TODO: This only works for OSX.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the work we have to implement this to add a new flag, -b/--open-browser and add that to keyconjurer login so users don't need to copy/paste.

@punmechanic punmechanic force-pushed the dan/tencent-cloud branch 3 times, most recently from b1d461e to 3084bd1 Compare October 4, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant