Expand description
Capabilities a service provides to other services.
Dispatch sites that ask “is service X installed?” almost always actually
mean “is there an installed service that plays role Y?” — modeling
that question as a typed Capability lookup decouples integration
glue from hardcoded service names. New providers (a different reverse
proxy, a different OIDC IdP, an external SMTP relay) drop in without
the auth bridge / Caddy patcher / network-join logic having to learn
their names.
Today the provider→capability mapping comes from
[crate::WellKnownService::capabilities] (a static map). Step 2 of
the migration moves the declaration into each service’s service.toml
and persists it through metadata.toml so InstalledService can
report capabilities without core knowing the service name.
Enums§
- Capability
- A role a service can play for other services. Pattern-match exhaustively — adding a new variant forces every dispatch site to think about it.
Functions§
- any_
installed_ provider - Convenience: check live install state via
crate::list_installedfor whether any provider ofcapis currently installed. Use this at planning sites that don’t already have aninstalled: &[…]slice in scope — anything insidecrate::auth_bridgetakes the slice as a parameter and should callfind_installed_providerinstead. - def_
provides - Capability list declared by a [
ServiceDef]. Use this when the def is already in scope (e.g. inadd_serviceafterfind_service) — it avoids the registry round-trip thatservice_providesdoes. - find_
installed_ provider - Find an installed service that provides the given capability. Returns
the first match — capabilities like
Capability::ReverseProxyare expected to have at most one provider installed at a time, but we don’t enforce that yet (a future “multiple OIDC providers” world is the caller’s problem to resolve). - installed_
provides - Whether an
InstalledServiceprovides the given capability. Reads from the persisted snapshot inmetadata.toml(hydrated intoInstalledService::providesatcrate::list_installedtime). - service_
provides - Whether a service named
nameprovides the given capability, resolved by reading its[capabilities] providesdeclaration from the cached default registry on disk.