Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string JWKSuri string `json:"jwks_uri"` TokenEP string `json:"token_endpoint"` // contains filtered or unexported fields }
Config contains the configuration information needed to do the initial setup and renewal of the HID service
type HID ¶
HID holds the configurations and keys neccessary to communicate with the HID service.
func (*HID) AuthorizeRequest ¶
AuthorizeRequest takes an incoming request on behalf of the service and extracts the token from the "Authorization" header. The token is then checked for authenticity, and then the claims of thet token is verified against the provided scope and audince.
func (*HID) ConnectToServer ¶ added in v0.3.9
ConnectToServer performs neccessary setup for connections to the external HID service
type IDManager ¶ added in v0.4.0
type IDManager interface { GetToken(user, secret string) (token *Token, err error) AuthorizeRequest(r *http.Request, audience, scope string) error }
IDManager represents a service that is able to provide clients with authoriation tokens with the GetToken function, and is capable of authorizing these incoming tokens for the server with the AuthorizeRequest function.
type PKS ¶ added in v0.4.0
type PKS struct { Keys []struct { KeyID string `json:"kid"` Algorithm string `json:"alg"` X5C []string `json:"x5c"` } `json:"keys"` }
PKS (Public Key Set) stores a slice of public keys and their metadata
type Token ¶
type Token struct { Raw string `json:"access_token"` Scope string `json:"scope"` Type string `json:"token_type"` Exp int `json:"expires_in"` }
Token exp
func (Token) AppendToRequest ¶ added in v0.4.0
AppendToRequest is a simple quality of life function that appends the raw token to the header of the provided request.