MCPcopy Index your code
hub / github.com/coder/coder / AttemptLogin

Method AttemptLogin

coderd/coderdtest/oidctest/idp.go:611–627  ·  view source on GitHub ↗
(t testing.TB, client *codersdk.Client, idTokenClaims jwt.MapClaims, opts ...func(r *http.Request))

Source from the content-addressed store, hash-verified

609}
610
611func (f *FakeIDP) AttemptLogin(t testing.TB, client *codersdk.Client, idTokenClaims jwt.MapClaims, opts ...func(r *http.Request)) (*codersdk.Client, *http.Response) {
612 t.Helper()
613 var err error
614
615 cli := f.HTTPClient(client.HTTPClient)
616 shallowCpyCli := *cli
617
618 if shallowCpyCli.Jar == nil {
619 shallowCpyCli.Jar, err = cookiejar.New(nil)
620 require.NoError(t, err, "failed to create cookie jar")
621 }
622
623 unauthenticated := codersdk.New(client.URL)
624 unauthenticated.HTTPClient = &shallowCpyCli
625
626 return f.LoginWithClient(t, unauthenticated, idTokenClaims, opts...)
627}
628
629// LoginWithClient reuses the context of the passed in client. This means the same
630// cookies will be used. This should be an unauthenticated client in most cases.

Callers 4

TestUserOIDCFunction · 0.95
LoginMethod · 0.95
TestUserOIDCFunction · 0.45

Calls 5

HTTPClientMethod · 0.95
LoginWithClientMethod · 0.95
NewFunction · 0.92
HelperMethod · 0.65
NewMethod · 0.65

Tested by 3

TestUserOIDCFunction · 0.76
TestUserOIDCFunction · 0.36