Hardening

Making a humus service safe to run: authenticating and authorizing the requests it serves, then rehearsing its failures with failure injection.

These pages cover what a service needs before it faces production, in this order: authentication and authorization of the requests it serves, with the auth package, then failure injection with the fault package, which fails one request on purpose to rehearse what a real failure does.


Authentication and authorization

How a humus service authenticates and authorizes the requests it serves with the auth package: schemes and their typed principals, read with From, requirements and scopes, opening a path with auth.Disabled(), the three places they are enforced, openapi.Security, auth.NewHandler and grpcauth.Interceptors, the answers and WWW-Authenticate challenges, probes left open over HTTP and gRPC, verifying JWTs with auth/jwt on a RemoteKeySet or a KeySet of one’s own, answering a *jwt.KeySetError, what humus records, and how to test all of it.

Failure injection

How a humus service fails one request on purpose, in production or in a test, with the fault package: turning it on with humus.WithFaults, choosing or writing the codec a scenario travels in, the injection point in every humus client and points of the end user’s own, whom each server trusts, the annotation that carries a scenario into a Kubernetes controller’s reconciles, which dependencies a scenario goes on to, what a fault does to the retries and the breaker, containing a scenario in production, what it records, and how to test a scenario.