docs: add a Role in the framework section to every module README
Each module README now says where the module sits in the dependency graph, why it is its own module, and lists use cases for application developers.
This commit is contained in:
@@ -10,6 +10,16 @@ Credential-redacting slog handler that keeps API keys, tokens and passwords out
|
||||
|
||||
`sunscreen` wraps any `log/slog` handler and rewrites every record before it is written: values of sensitive attribute keys become `[REDACTED]`, and credential shapes inside messages and string values are scrubbed. It is the SummerCMS counterpart of a Monolog tap that a WinterCMS application wires into its log channels to scrub contexts and messages. Every application `main` that `summer build` generates calls `sunscreen.InstallDefault(os.Stderr)` as its first statement, so the default logger, the standard `log` package and every plugin that falls back to `slog.Default` log through it from the start.
|
||||
|
||||
## Role in the framework
|
||||
|
||||
A dependency-free leaf the application wires into its logger at startup. It is separate because it wraps the standard slog handler and applies to all log output, whichever module writes it.
|
||||
|
||||
Use cases:
|
||||
|
||||
- Keep API keys, tokens and passwords out of logs, including logs from third-party code.
|
||||
- Log request and configuration details while debugging without leaking secrets.
|
||||
- Meet a "no credentials in logs" audit requirement in one place.
|
||||
|
||||
## Features
|
||||
|
||||
- Sensitive keys (`sunscreen.RedactedKeys`): `api_key`, `apikey`, `authorization`, `bearer`, `password`, `secret`, `token`, `webhook_secret`, `admin_password`, `openai_api_key`, `anthropic_api_key` and `perplexity_api_key`, compared case-insensitively at any group depth. The value of such an attribute becomes `sunscreen.Redacted`, whatever its kind.
|
||||
|
||||
Reference in New Issue
Block a user