Documentation
¶
Overview ¶
Package activities offers Hydra's admin API to wiring: OAuth 2.0 clients, login, consent and logout requests (for products with their own UI), consent and login sessions, token introspection and keys.
Index ¶
- Variables
- type AcceptConsentIn
- type AcceptLoginIn
- type Activities
- type ChallengeIn
- type ClientEvent
- type ClientIDIn
- type ClientIn
- type ConsentRevoked
- type ConsentsOut
- type DeviceIn
- type Empty
- type ImportKeyIn
- type IntrospectIn
- type IssuerIn
- type IssuersOut
- type KeyIn
- type KeySetIn
- type KeysOut
- type LifespansIn
- type ListClientsIn
- type ListClientsOut
- type PatchClientIn
- type RedirectOut
- type RejectIn
- type RotateKeyIn
- type SubjectIn
- type TrustIn
Constants ¶
This section is empty.
Variables ¶
var ErrNoClientID = errors.New("client_id is required")
ErrNoClientID: name the client.
Functions ¶
This section is empty.
Types ¶
type AcceptConsentIn ¶
type AcceptConsentIn struct {
Challenge string `json:"challenge"`
ory.AcceptConsent
}
AcceptConsentIn accepts a consent.
type AcceptLoginIn ¶
type AcceptLoginIn struct {
Challenge string `json:"challenge"`
ory.AcceptLogin
}
AcceptLoginIn accepts a login.
type Activities ¶
Activities are the admin API as activities.
func New ¶
func New(parent deps.Scope, hydra ory.Client) *Activities
New declares the activities and events under parent.
func (*Activities) ClientEvents ¶
func (a *Activities) ClientEvents(name string) event.Ref[ClientEvent]
ClientEvents is a declared client event by name.
type ChallengeIn ¶
type ChallengeIn struct {
Challenge string `json:"challenge"`
}
ChallengeIn names a pending request.
type ClientEvent ¶
type ClientEvent struct {
ClientID string `json:"client_id"`
ClientName string `json:"client_name,omitempty"`
By string `json:"by"`
}
ClientEvent is a client created, changed or deleted.
type ClientIDIn ¶
type ClientIDIn struct {
ClientID string `json:"client_id"`
}
ClientIDIn names a client.
type ClientIn ¶ added in v0.0.2
type ClientIn struct {
// ClientID of the client to replace (UpdateClient).
ClientID string `json:"client_id,omitempty"`
Client json.RawMessage `json:"client" schemapb:"secret=true;description=Hydra's client JSON (grant_types, redirect_uris, scope, …)"`
}
ClientIn is Hydra's client JSON: every field Hydra knows.
type ConsentRevoked ¶
type ConsentRevoked struct {
Subject string `json:"subject"`
ClientID string `json:"client_id,omitempty"`
By string `json:"by"`
}
ConsentRevoked: a subject's consents were revoked (of one client, or all when ClientID is empty).
type ConsentsOut ¶
type ConsentsOut struct {
Consents []ory.ConsentGrant `json:"consents"`
}
ConsentsOut are a subject's remembered consents.
type ImportKeyIn ¶ added in v0.0.2
type ImportKeyIn struct {
Set string `json:"set"`
KID string `json:"kid"`
JWK json.RawMessage `json:"jwk" schemapb:"secret=true;description=The JSON Web Key (with its private part to sign)"`
}
ImportKeyIn stores a key brought by the operator.
type IntrospectIn ¶
type IntrospectIn struct {
Token string `json:"token" schemapb:"secret=true"`
Scope string `json:"scope,omitempty"`
}
IntrospectIn is a token to inspect.
type IssuerIn ¶ added in v0.0.2
type IssuerIn struct {
ID string `json:"id"`
}
IssuerIn names a trusted issuer.
type IssuersOut ¶ added in v0.0.2
type IssuersOut struct {
Issuers []ory.TrustedIssuer `json:"issuers"`
}
IssuersOut are the trusted JWT grant issuers.
type KeySetIn ¶ added in v0.0.2
type KeySetIn struct {
Set string `json:"set"`
}
KeySetIn names a key set (hydra.openid.id-token, hydra.jwt.access-token, or one of yours).
type LifespansIn ¶ added in v0.0.2
type LifespansIn struct {
ClientID string `json:"client_id"`
// Lifespans by Hydra's key, e.g. authorization_code_grant_access_token_lifespan: "15m".
Lifespans map[string]string `json:"lifespans"`
}
LifespansIn sets a client's token lifespans.
type ListClientsIn ¶
type ListClientsIn struct {
Name string `json:"name,omitempty"`
Owner string `json:"owner,omitempty"`
PageSize int `json:"page_size,omitempty"`
PageToken string `json:"page_token,omitempty"`
}
ListClientsIn narrows ListClients.
type ListClientsOut ¶
type ListClientsOut struct {
Clients []ory.OAuth2Client `json:"clients"`
NextPageToken string `json:"next_page_token,omitempty"`
}
ListClientsOut is a page of clients.
type PatchClientIn ¶ added in v0.0.2
type PatchClientIn struct {
ClientID string `json:"client_id"`
Patch json.RawMessage `json:"patch" schemapb:"secret=true;description=RFC 6902 operations, e.g. [{op: add, path: /redirect_uris/-, value: …}]"`
}
PatchClientIn is a JSON Patch of a client.
type RedirectOut ¶
type RedirectOut struct {
RedirectTo string `json:"redirect_to"`
}
RedirectOut is where the browser goes next.
type RotateKeyIn ¶ added in v0.0.2
type RotateKeyIn struct {
Set string `json:"set"`
Alg string `json:"alg" validate:"oneof=RS256 RS512 ES256 ES512 EdDSA HS256"`
Use string `json:"use,omitempty" validate:"omitempty,oneof=sig enc"`
KID string `json:"kid,omitempty"`
}
RotateKeyIn generates a key in a set.
type SubjectIn ¶
type SubjectIn struct {
Subject string `json:"subject"`
// ClientID narrows RevokeConsents to one client.
ClientID string `json:"client_id,omitempty"`
// SID narrows RevokeLoginSessions to one session.
SID string `json:"sid,omitempty"`
}
SubjectIn names a subject, optionally narrowed.
type TrustIn ¶ added in v0.0.2
type TrustIn struct {
Issuer json.RawMessage `json:"issuer" schemapb:"description=issuer, scope, jwk, expires_at, subject or allow_any_subject"`
}
TrustIn is Hydra's trustOAuth2JwtGrantIssuer.