refactor InferSupervisorIssuerURL() func; remove a TODO

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
This commit is contained in:
Ryan Richard
2024-07-24 10:27:39 -07:00
parent 60f82d2a55
commit ca2dd2d476
5 changed files with 7 additions and 10 deletions

View File

@@ -84,10 +84,10 @@ type TestOIDCUpstream struct {
ExpectedGroups []string `json:"expectedGroups"`
}
// InferTheIssuerURL infers the downstream issuer URL from the callback associated with the upstream test client registration.
func (upstream *TestOIDCUpstream) InferTheIssuerURL(t *testing.T) (*url.URL, string) {
// InferSupervisorIssuerURL infers the downstream issuer URL from the callback associated with the upstream test client registration.
func (e *TestEnv) InferSupervisorIssuerURL(t *testing.T) (*url.URL, string) {
t.Helper()
issuerURL, err := url.Parse(upstream.CallbackURL)
issuerURL, err := url.Parse(e.SupervisorUpstreamOIDC.CallbackURL)
require.NoError(t, err)
require.True(t, strings.HasSuffix(issuerURL.Path, "/callback"))
issuerURL.Path = strings.TrimSuffix(issuerURL.Path, "/callback")