Documentation
¶
Overview ¶
Package hydra is backplane-hydra as a library: Main runs it. It joins an Ory Hydra installation to Backplane: consent and token claims become hooks, logouts and consents events, the admin API activities and a console module, and the settings an operator edits are written to a configuration overlay Hydra reloads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoKey = errors.New("hydra: callbacks.key or backplane.internal_secret is required")
ErrNoKey: neither a callbacks key nor an internal secret is configured.
var ErrOverlayMode = errors.New("hydra: overlay_mode must be octal permission bits like 0640")
ErrOverlayMode: overlay_mode is not octal permission bits.
var ErrPublicURL = errors.New("hydra: public_url is required (Hydra redirects browsers to its /consent)")
ErrPublicURL: browsers must reach the consent endpoint.
Functions ¶
Types ¶
type Callbacks ¶
type Callbacks struct {
Listen string `json:"listen" schemapb:"default=:8091"`
// URL is the listener as Hydra reaches it.
URL string `json:"url" schemapb:"default=http://127.0.0.1:8091"`
// Key authenticates Hydra; empty: derived from the internal secret.
Key config.Secret `json:"key,omitempty"`
}
Callbacks listener.
type Config ¶
type Config struct {
config.Backplane `json:"backplane"`
// Hydra is the installation.
Hydra Connection `json:"hydra"`
// PublicURL is this service's public API as browsers reach it: Hydra
// redirects them to its /consent and /logout.
PublicURL string `json:"public_url" schemapb:"description=This service's public URL as browsers reach it"`
// Callbacks is the listener Hydra calls (the token hook).
Callbacks Callbacks `json:"callbacks"`
// Overlay is the file Hydra loads after its own (-c base -c overlay),
// shared with the Hydra container; empty: nothing is written.
Overlay string `json:"overlay,omitempty" schemapb:"description=Path of the overlay file Hydra loads (empty: snippets only)"`
// OverlayMode is the file's permission bits (octal).
OverlayMode string `json:"overlay_mode,omitempty" schemapb:"default=0644"`
// PairwiseSalt salts pairwise subject identifiers; live, kept apart
// from the settings.
PairwiseSalt config.Live[config.Secret] `json:"pairwise_salt,omitempty" schemapb:"description=Salt of pairwise subject identifiers"`
// Settings are Hydra's settings rendered into the overlay; live.
Settings config.Live[overlay.Settings] `json:"settings"`
}
Config is the whole configuration: file (BACKPLANE_CONFIG_FILE) < env HYDRA_* (BACKPLANE_* for the SDK block) < Consul KV for Live fields.
type Connection ¶
type Connection struct {
AdminURL string `json:"admin_url" schemapb:"default=http://127.0.0.1:4445"`
PublicURL string `json:"public_url" schemapb:"default=http://127.0.0.1:4444"`
Headers map[string]config.Secret `json:"headers,omitempty"`
Timeout time.Duration `json:"timeout" schemapb:"default=10s"`
}
Connection to Hydra.
type State ¶
type State struct {
Hydra deps.Dependency[ory.Client]
Flows *flows.Flows
Applier *apply.Applier
Activities *activities.Activities
Admin *admin.Admin
// contains filtered or unexported fields
}
State is the service's tree.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
hydra
command
Command hydra runs backplane-hydra.
|
Command hydra runs backplane-hydra. |
|
internal
|
|
|
activities
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.
|
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. |
|
admin
Package admin is the console module's API: the Hydra installation, its clients, consents, keys and trusted issuers.
|
Package admin is the console module's API: the Hydra installation, its clients, consents, keys and trusted issuers. |
|
apply
Package apply keeps the overlay file equal to the settings and the bound hooks: rendered at start, after every settings change and every binding change, and every resync interval (a file someone replaced).
|
Package apply keeps the overlay file equal to the settings and the bound hooks: rendered at start, after every settings change and every binding change, and every resync interval (a file someone replaced). |
|
flows
Package flows serves what Hydra hands over: the consent and logout steps of a browser's OAuth 2.0 flow (hook Consent, event LoggedOut) and the token hook (hook TokenClaims).
|
Package flows serves what Hydra hands over: the consent and logout steps of a browser's OAuth 2.0 flow (hook Consent, event LoggedOut) and the token hook (hook TokenClaims). |
|
ory
Package ory is a small client of an Ory Hydra installation: its admin API (clients, consent and login requests and sessions, tokens, keys, trusted issuers).
|
Package ory is a small client of an Ory Hydra installation: its admin API (clients, consent and login requests and sessions, tokens, keys, trusted issuers). |
|
overlay
Package overlay renders the Hydra configuration file backplane-hydra owns: the settings an operator edits in the console, the consent and logout endpoints it serves, and the token hook while it is bound.
|
Package overlay renders the Hydra configuration file backplane-hydra owns: the settings an operator edits in the console, the consent and logout endpoints it serves, and the token hook while it is bound. |
|
ui
Package ui carries the console module: web/dist/plugin copied here by `make web` and embedded into the binary.
|
Package ui carries the console module: web/dist/plugin copied here by `make web` and embedded into the binary. |
|
pkg
|
|
|
auth
Package auth tells a service who made a request from an OAuth2 access token Ory Hydra issued.
|
Package auth tells a service who made a request from an OAuth2 access token Ory Hydra issued. |
|
proto
|
|