Documentation
¶
Overview ¶
Package ounauth implements the absolute bare minimum you need to get github.com/coreos/go-oidc/v3 to approve a JWT access token. It is for writing test suites for those of us stuck in the hell universe of systems which use OAuth Client Credentials to make bearer tokens for server-to-server authentication.
It is not secure; it should not be taken as any example of how to design a real OpenID/OAuth server or client; it has no persistence and no configuration available beyond what’s necessary to stub custom claims; it doesn't get happy, it doesn't get sad, it doesn't laugh at your jokes, it just generates tokens.
Index ¶
- type OP
- func (o *OP) Configuration(w http.ResponseWriter, r *http.Request)
- func (o *OP) JWKS(w http.ResponseWriter, r *http.Request)
- func (o *OP) Mux() *http.ServeMux
- func (o *OP) Route(mux *http.ServeMux)
- func (o *OP) StubClient(id, secret string, claims jwt.MapClaims)
- func (o *OP) TestServer(t interface{ ... }) *httptest.Server
- func (o *OP) Token(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OP ¶
type OP struct {
// contains filtered or unexported fields
}
OP is definitely not an OpenID Provider.
func (*OP) Configuration ¶
func (o *OP) Configuration(w http.ResponseWriter, r *http.Request)
Configuration implements the OpenID Configuration endpoint.
func (*OP) JWKS ¶
func (o *OP) JWKS(w http.ResponseWriter, r *http.Request)
JWKS implements the JWKS retrieval endpoint.
func (*OP) StubClient ¶
StubClient authorizes a client with an ID and secret, and any claims it should get. The only default claims are exp, iss, and aud, which are required to validate a token; any others (even normal ones like scopes) must be specified by calling this.
It is, unfortunately, safe for concurrent use.
func (*OP) TestServer ¶
TestServer returns an server bound to the provided test’s lifetime, implementing OP’s routes.