-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add default GitHub API URLs to SSO connector #31397
Conversation
`tctl sso configure github` was producing an untestable connector spec, or at least a spec that would _always fail_ when tested with `tctl ssl test`, due to missing GitHub endpoints in the generated spec. This change adds the default GitHub endpoint URLs as default values for the endpoint flags in `tctl sso configure github` so that the produces spec is valis and testable. Note: Our WebUI appears to magically add these values when saving a connector, so this issue only really effects `tctl sso test` Includes doc update to match new output. Fixes: #31396 Changelog: `tctl sso configure github` now includes default Github endpoints
@@ -279,12 +279,12 @@ func (c *GithubConnectorV3) SetDisplay(display string) { | |||
|
|||
// GetEndpointURL returns the endpoint URL | |||
func (c *GithubConnectorV3) GetEndpointURL() string { | |||
return githubURL | |||
return GithubURL |
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.
Is anyone else curious why this always returns a constant? Is this because SSO for self-hosted github is an enterprise-only feature?
I've given the old code a cursory look before and from my understanding the validation is being too strict here; in particular, you can expect there to be some existing configs that are correct (using public GitHub, so these fields can be empty) but will now be rejected. Sounds wrong, and I'd be curious to see where exactly the error is being thrown:
|
I don't think this is necessarily a validation problem, and I certainly didn't add any - I just changed the generated connector so that it works in the test.
Given your comments that it sounded wrong, I dug a bit deeper. Turns out this is what happens when you use an Enterprise The error was coming from deep inside the All in all it's a bit confusing confusing as a user, as both flavours of |
Agreed. I think @capnspacehook may have the best idea of what needs fixing in this context. |
sub.Flag("endpoint-url", "Endpoint URL for GitHub instance."). | ||
PlaceHolder("URL"). | ||
Default(types.GithubURL). | ||
StringVar(&spec.EndpointURL) |
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.
If it's a URL, should we use URLVar
instead of StringVar
?
tctl sso configure github
was producing an untestable connector spec, or at least a spec that would always fail when tested withtctl sso test
, due to missing GitHub endpoints in the generated spec.This change adds the default GitHub endpoint URLs as default values for the endpoint flags in
tctl sso configure github
so that the produces spec is valis and testable.Note: Our WebUI appears to magically add these values when saving
a connector, so this issue only really effects
tctl sso test
Includes doc update to match new output.
Fixes: #31396
Changelog:
tctl sso configure github
now includes default Github endpoints