Documentation
¶
Index ¶
Constants ¶
const (
ErrMustCheckIssuer staticError = "must check issuer"
)
Variables ¶
This section is empty.
Functions ¶
func LocalTokenPath ¶ added in v0.2.0
LocalTokenPath returns the path on disk to the token for the given audience
Types ¶
type IssuerCallback ¶
An IssuerCallback is called whenever a token is verified to ensure it matches some expected criteria.
func AllowHerokuHost ¶
func AllowHerokuHost(host string) IssuerCallback
AllowHerokuHost verifies that the issuer is from Heroku for the given host domain
func AllowHerokuSpace ¶ added in v0.2.0
func AllowHerokuSpace(host string, spaceIDs ...string) IssuerCallback
AllowHerokuSpace verifies that the issuer is from Heroku for the given host and space id.
type MalformedTokenError ¶ added in v0.2.0
type MalformedTokenError struct {
// contains filtered or unexported fields
}
Returned when the token doesn't match the expected format
func (*MalformedTokenError) Error ¶ added in v0.2.0
func (e *MalformedTokenError) Error() string
func (*MalformedTokenError) Unwrap ¶ added in v0.2.0
func (e *MalformedTokenError) Unwrap() error
type Subject ¶ added in v0.2.0
type Subject struct { AppID string `json:"app_id"` AppName string `json:"app_name"` Dyno string `json:"dyno"` }
Subject contains information about the app and dyno the token was issued for
func (*Subject) MarshalText ¶ added in v0.2.0
func (*Subject) UnmarshalText ¶ added in v0.2.0
type Token ¶ added in v0.2.0
type Token struct { IDToken *oidc.IDToken `json:"-"` SpaceID string `json:"space_id"` Subject *Subject `json:"subject"` }
Token contains all of the token information stored by Heroku when it's issued
func ReadLocalToken ¶ added in v0.2.0
ReadLocalToken reads the local machines token for the given audience and parses it
type UntrustedIssuerError ¶ added in v0.2.0
type UntrustedIssuerError struct {
Issuer string
}
Returned by an IssuerCallback getting an issuer it doesn't trust
func (*UntrustedIssuerError) Error ¶ added in v0.2.0
func (e *UntrustedIssuerError) Error() string
type Verifier ¶
type Verifier struct { IssuerCallback IssuerCallback // contains filtered or unexported fields }
A Verifier verifies a raw token with it's oids issuer and uses the IssuerCallback to ensure it's from a trusted source.
func New ¶
Instantiate a new Verifier without an IssuerCallback set.
The IssuerCallback must be set before calling Verify or an error will be returned.
func NewWithCallback ¶ added in v0.2.0
func NewWithCallback(clientID string, callback IssuerCallback) *Verifier
Instantiate a new Verifier with the IssuerCallback set.