(t testing.TB, issuer string)
| 515 | } |
| 516 | |
| 517 | func (f *FakeIDP) updateIssuerURL(t testing.TB, issuer string) { |
| 518 | t.Helper() |
| 519 | |
| 520 | u, err := url.Parse(issuer) |
| 521 | require.NoError(t, err, "invalid issuer URL") |
| 522 | |
| 523 | f.locked.SetIssuer(issuer) |
| 524 | f.locked.SetIssuerURL(u) |
| 525 | // ProviderJSON is the JSON representation of the OpenID Connect provider |
| 526 | // These are all the urls that the IDP will respond to. |
| 527 | f.locked.SetProvider(ProviderJSON{ |
| 528 | Issuer: issuer, |
| 529 | AuthURL: u.ResolveReference(&url.URL{Path: authorizePath}).String(), |
| 530 | TokenURL: u.ResolveReference(&url.URL{Path: tokenPath}).String(), |
| 531 | JWKSURL: u.ResolveReference(&url.URL{Path: keysPath}).String(), |
| 532 | UserInfoURL: u.ResolveReference(&url.URL{Path: userInfoPath}).String(), |
| 533 | RevokeURL: u.ResolveReference(&url.URL{Path: revokeTokenPath}).String(), |
| 534 | DeviceCodeURL: u.ResolveReference(&url.URL{Path: deviceAuth}).String(), |
| 535 | Algorithms: []string{ |
| 536 | "RS256", |
| 537 | }, |
| 538 | ExternalAuthURL: u.ResolveReference(&url.URL{Path: "/external-auth-validate/user"}).String(), |
| 539 | }) |
| 540 | } |
| 541 | |
| 542 | // realServer turns the FakeIDP into a real http server. |
| 543 | func (f *FakeIDP) realServer(t testing.TB) *httptest.Server { |
no test coverage detected