Documentation
¶
Overview ¶
Package authproxy generates an authenticating TLS proxy (Caddy) for a Loki that runs without auth in the user's Compose stack, so that a production profile can read it (design §2.5).
What it writes keeps the backend read token away from agents (precondition P3, round-6 amendment):
- the proxy gets only a bcrypt hash of the token, never the token;
- the clear token is returned to the caller, which shows it on the console's terminal only (the console then asks for it, or reads it from Vault); it is never written to a file;
- the internal CA's private key is discarded once the server certificate is signed: only the CA certificate is written, for the profile's tls_ca;
- files go to a directory outside the project, created 0700.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Dir is where the files go: absolute, outside Project (resolved),
// created 0700. Every ancestor must be a real directory (no symlink)
// owned by root or the user and writable by no one else; Dir must not
// exist yet, or be an empty real directory of the user's. The files are
// created relative to Dir's descriptor (see writeFiles).
Dir string
// Project is the project root (agents may read it): Dir must not be
// inside it.
Project string
// Host is the proxy's service name in the Compose network (the
// certificate's name and the profile's url host).
Host string
// Port is the proxy's listening port.
Port int
// Upstream is the Loki service address in the network ("loki:3100").
Upstream string
// User is the basic-auth user name.
User string
// Validity of the certificates (default 2 years).
Validity time.Duration
}
Options describe the proxy.
type Result ¶
type Result struct {
Token string
// Files written (absolute paths).
Caddyfile, ServerCert, ServerKey, CACert string
// URL is the profile's url; Compose is the service snippet to add to
// the user's compose file (it holds no secret).
URL string
Compose string
}
Result is what Generate produced. Token is the clear read token: show it on the console's terminal only.
Click to show internal directories.
Click to hide internal directories.