-
Notifications
You must be signed in to change notification settings - Fork 141
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
If custom server url exists, use that instead of the default one. #1776
If custom server url exists, use that instead of the default one. #1776
Conversation
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1776 +/- ##
==========================================
- Coverage 57.93% 50.35% -7.58%
==========================================
Files 50 70 +20
Lines 3119 4184 +1065
==========================================
+ Hits 1807 2107 +300
- Misses 1154 1844 +690
- Partials 158 233 +75 ☔ View full report in Codecov by Sentry. |
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.
@@ -159,10 +161,16 @@ func WorkflowPrincipalFromIDToken(_ context.Context, token *oidc.IDToken) (ident | |||
return nil, errors.New("missing run_attempt claim in ID token") | |||
} | |||
|
|||
baseURL := `https://github.com/` | |||
|
|||
if claims.Enterprise != "" { |
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.
@javanlacerda Is this something we can add for the new configuration?
@kommendorkapten Is this something you want enabled for the public instance or is this just for the GitHub deployment?
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.
Yes, I think this template {{if .enterprise }}https://{{ .enterprise }.ghe.com{{else}}{{ .url }}{{end}}
should replace every place that the default {{url}} is used for github on identity/config.yaml.
Also, It could be defined in a variable for avoiding replicating it into the config.
And btw, I saw that this PR was recently merged, but this modifies will not work as we migrated github to use the new generic logic that is in pkg/identity/ciprovider/principal.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.
@haydentherapper this is only needed for our internal deployments as of now.
Summary
When producing certificates from ID Tokens issued by GitHub Actions, the server url is always hardcoded to
github.com
. This is not true for all cases, as custom domains may be possible. This PR modifies the behaviour to look for theenterprise
claim which indicates that a custom domain is used.Release Note
Documentation