()
| 413 | } |
| 414 | |
| 415 | func (t *Cortex) setupRequestSigning() { |
| 416 | if t.Cfg.Distributor.SignWriteRequestsEnabled { |
| 417 | util_log.WarnExperimentalUse("Distributor SignWriteRequestsEnabled") |
| 418 | t.Cfg.Server.GRPCMiddleware = append(t.Cfg.Server.GRPCMiddleware, grpcclient.UnarySigningServerInterceptor) |
| 419 | |
| 420 | // When signing keys are configured, authenticate PushStream connections. |
| 421 | // All keys in the list are accepted by the server; the first key is used by |
| 422 | // the client to sign. Multiple keys enable zero-downtime key rotation. |
| 423 | if keys := t.Cfg.Distributor.SignWriteRequestsKeys.Value(); len(keys) > 0 { |
| 424 | t.Cfg.Server.GRPCStreamMiddleware = append(t.Cfg.Server.GRPCStreamMiddleware, grpcclient.NewStreamSigningServerInterceptor(keys...)) |
| 425 | } |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | // Run starts Cortex running, and blocks until a Cortex stops. |
| 430 | func (t *Cortex) Run() error { |
no test coverage detected