HostAuthentication
Authentication and per-caller rate limiting for the embedded servers this SDK ships.
These servers perform key custody operations — the DID registrar creates, updates and deactivates DIDs — and previously carried no authentication primitive at all, only a loopback bind default and documentation asking the operator to front them with a proxy. Documentation is not a control, and an operator who binds to 0.0.0.0 without reading it gets an open registrar.
So a server refuses mutating requests until the host has said what protects them. Saying so is cheap and explicit: configure bearerToken or custom, or state the deployment's actual control with frontedByProxy. Silence is the one thing that is not accepted.
This is authentication, not encryption. Use TLS, or a loopback-only bind behind a TLS proxy; a bearer token on a plaintext connection is readable by anything on the path.
Types
Fixed-window permit budgets per caller, keyed by remote host.
Installs the fail-closed default for a server the host never configured.
Functions
Whether this gate decides every mutating request (POST, PUT, PATCH, DELETE): it authenticates all of them, or it is frontedByProxy, which records that something in front does.
Returns a copy that also requires the credential for every request, whatever its method, whose path starts with one of prefixes. Use it when a few read routes are privileged but the rest of the server's reads are not, e.g. job-status records in the DID registrar.