Documentation
¶
Overview ¶
Package human verifies a Hydra ID token. The broker does not issue it.
Verifies with coreos/go-oidc, same check as workload. The subject is the human, not a bound agent. golang.org/x/oauth2 exchanges the code. PKCE, public client.
Index ¶
- Constants
- func AMR(raw string) ([]string, bool)
- func PKCE() (verifier, state string, err error)
- func RequireTOTP(raw string) error
- type Config
- type HTTPLogin
- type Verifier
- func (v *Verifier) Audience() string
- func (v *Verifier) AuthCodeURL(ctx context.Context, state, verifier string) (string, error)
- func (v *Verifier) Exchange(ctx context.Context, code, verifier string) (string, error)
- func (v *Verifier) Human(ctx context.Context, rawToken string) (protocol.Principal, error)
- func (v *Verifier) Issuer() string
- func (v *Verifier) LoginHTTP(ctx context.Context, in HTTPLogin) (string, error)
- func (v *Verifier) Redirect() string
- func (v *Verifier) Subject(ctx context.Context, rawToken string) (string, error)
Constants ¶
const ( // Deployed Hydra audience; renaming is a prod migration, not a string sweep. DefaultAudience = "veil" DefaultRedirect = "http://127.0.0.1:4460/oidc/callback" )
Variables ¶
This section is empty.
Functions ¶
func RequireTOTP ¶
RequireTOTP rejects an id token whose amr skipped TOTP. Opaque test tokens are not JWTs and are left alone.
Types ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
func (*Verifier) AuthCodeURL ¶
AuthCodeURL is the Hydra authorize URL. PKCE S256. prompt=login so Hydra cannot skip on a remembered session (Kratos would then accept aal1).
func (*Verifier) Exchange ¶
Exchange trades an authorization code for an ID token. Access and refresh stay here; the caller only gets the ID token to verify.
func (*Verifier) Human ¶
Human verifies rawToken against the configured Hydra issuer. Subject is the human id; org is NOT stamped here — the vault humans row is org of record, resolved by the caller after the subject authenticates.