Documentation
¶
Overview ¶
Package authn authenticates Kafka connections and their proxy identities.
Index ¶
- Constants
- func CertificatePrincipal(cert *x509.Certificate, principals map[string]string) (string, error)
- func Principal(ctx context.Context) string
- func ReadKey(path string) ([]byte, error)
- func ReceiveIdentity(conn net.Conn, key []byte) (string, error)
- func SendIdentity(conn net.Conn, key []byte, principal string) error
- func WithPrincipal(ctx context.Context, principal string) context.Context
- type TLSOptions
Constants ¶
const LFSPrincipal = "__kafscale_lfs_service"
const ProbePrincipal = "__kafscale_proxy_probe"
Variables ¶
This section is empty.
Functions ¶
func CertificatePrincipal ¶
CertificatePrincipal requires exactly one mapped URI SAN identity. There is no implicit CN, subject DN, client.id, or network address fallback.
func ReadKey ¶
ReadKey reads a raw shared secret, without trimming or logging its contents. Reading on each connection permits Secret volume rotation without pod restarts.
func ReceiveIdentity ¶
ReceiveIdentity requires proof of the shared key, bound to a fresh challenge. It never accepts legacy Kafka frames or client.id as an identity fallback. NetworkPolicies must still protect the plaintext internal Kafka stream.
func SendIdentity ¶
SendIdentity answers a broker-generated challenge before any Kafka frames. The principal is fixed for the lifetime of this backend connection.
Types ¶
type TLSOptions ¶
TLSOptions uses projected Secret files. Files are reloaded for every new connection; existing connections retain their authenticated principal. Tickets are disabled so resumption cannot bypass rotated trust or mappings.