Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Introspect ¶
Introspect posts token to Handler as RFC 7662 §2.1 describes. A token Handler would refuse for its size cannot exist, so it is not active, as RFC 7662 §2.2 says of such a token. Any status but 200, or an answer that does not decode, is an error.
type Result ¶
type Result struct {
Active bool `json:"active"`
Issuer string `json:"iss,omitempty"`
Subject string `json:"sub,omitempty"`
ClientID string `json:"client_id,omitempty"`
Expiry int64 `json:"exp,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`
Audience string `json:"aud,omitempty"`
Scope string `json:"scope,omitempty"`
Act json.RawMessage `json:"act,omitempty"`
Claims map[string]json.RawMessage `json:"-"`
}
Result is the RFC 7662 §2.2 answer package profile requires: empty when inactive, otherwise about a Bearer token. The act extension is defined by RFC 8693 §4.1.
func (Result) Check ¶
Check holds an active answer to the issuer the caller trusts, the exp and nbf of RFC 7662 §2.2, and the audiences the caller accepts, of which RFC 8707 §2.2 gives a token exactly one.
func (Result) MarshalJSON ¶
func (*Result) UnmarshalJSON ¶
UnmarshalJSON reads an RFC 7662 §2.2 answer as package profile requires it. An answer without active, or an active one lacking a required field or with a scope outside RFC 6749 §3.3, is an error. Only a Bearer token can be active: token_type compares as RFC 6749 §5.1 says, and any other type is not active whatever else the answer holds.