Реализовать lab3 в общем Helm-релизе с Traefik, TLS и HPA

This commit is contained in:
Vladislav Agapov
2026-10-16 11:51:20 +03:00
parent a57cbcf329
commit 9494547300
88 changed files with 1922 additions and 255 deletions
+11
View File
@@ -106,3 +106,14 @@ func decodeCursorPosition(payload []byte, resource string) (Position, error) {
}
return Position{CreatedAt: cursor.Time, ID: cursor.ID}, nil
}
// NewShared creates a codec from the common 256-bit key provisioned to every replica.
func NewShared(encoded string) (*Codec, error) {
key, err := base64.StdEncoding.DecodeString(encoded)
if err != nil || len(key) != cursorSigningKeyBytes {
return nil, fmt.Errorf("CURSOR_SIGNING_KEY must encode exactly 32 bytes as base64")
}
codec := &Codec{}
copy(codec.key[:], key)
return codec, nil
}