🛡️ A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH.
This commit allows logging errors in a slog.Logger injected in the context. This logger type is not currently used directly in step-ca, but this will change in the future.
The main change is in api/log/log.go; the rest is adapting the code to allow this.
I've considered using func Error(ctx context.Context, w http.ResponseWriter, err error), but this won't allow us to add extra things from the request to the log if we need to.
I've also had to change the render methods because they can call Error.
This commit allows logging errors in a
slog.Logger
injected in the context. This logger type is not currently used directly in step-ca, but this will change in the future.The main change is in
api/log/log.go
; the rest is adapting the code to allow this.I've considered using
func Error(ctx context.Context, w http.ResponseWriter, err error)
, but this won't allow us to add extra things from the request to the log if we need to.I've also had to change the render methods because they can call
Error
.cc: @hslatman