Documentation ¶
Overview ¶
Package fakeissuer provides a minimal fake OIDC issuer for testing purpose.
Example:
// Create a fake HTTP server and client. f, cleanup := fakehttp.New() defer cleanup() // Set the URL of the issuer to that of the fake HTTP server. issuer = testkeys.Keys[testkeys.VisaIssuer0] issuer.ID = f.Server.URL i := stubissuer.New(f.Server.URL, issuer) f.Handler = i.Handler // Override the context to tell the package to use the fake HTTP client. // Any HTTP calls to issuer by oidc using ctx will be handled by the fake. ctx := oidc.ClientContext(context.Background(), f.Client)
Index ¶
Constants ¶
View Source
const ( // OIDC URI. OIDC = "/oidc" // WellKnown URI. // https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml WellKnown = "/.well-known" // Configuration URI. Configuration = WellKnown + "/openid-configuration" // JWKS URI. JWKS = WellKnown + "/jwks" // Authorize URI. Authorize = "/authorize" // Token URI. Token = "/token" // UserInfo URI. UserInfo = "/userinfo" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetJWKSResp ¶
type GetJWKSResp = jose.JSONWebKeySet
GetJWKSResp is the type for GET JWKS Response
type GetWellKnownResp ¶
type GetWellKnownResp struct { Issuer string `json:"issuer"` AuthURL string `json:"authorization_endpoint"` TokenURL string `json:"token_endpoint"` JWKSURL string `json:"jwks_uri"` UserInfoURL string `json:"userinfo_endpoint"` }
GetWellKnownResp is the type for GET WellKnown Response.
type Issuer ¶
type Issuer struct { URL string Keys []testkeys.Key GetWellKnownResp GetWellKnownResp GetJWKSResp GetJWKSResp }
Issuer is a fake OIDC issuer.
Click to show internal directories.
Click to hide internal directories.