MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / clientCommonName

Function clientCommonName

internal/pgbackrest/certificates.go:80–89  ·  view source on GitHub ↗

clientCommonName returns a client certificate common name (CN) for cluster.

(cluster metav1.Object)

Source from the content-addressed store, hash-verified

78
79// clientCommonName returns a client certificate common name (CN) for cluster.
80func clientCommonName(cluster metav1.Object) string {
81 // The common name (ASN.1 OID 2.5.4.3) of a certificate must be
82 // 64 characters or less. ObjectMeta.UID is a UUID in its 36-character
83 // string representation.
84 // - https://tools.ietf.org/html/rfc5280#appendix-A
85 // - https://docs.k8s.io/concepts/overview/working-with-objects/names/#uids
86 // - https://releases.k8s.io/v1.22.0/staging/src/k8s.io/apiserver/pkg/registry/rest/create.go#L111
87 // - https://releases.k8s.io/v1.22.0/staging/src/k8s.io/apiserver/pkg/registry/rest/meta.go#L30
88 return "pgbackrest@" + string(cluster.GetUID())
89}
90
91// instanceServerCertificates returns projections of keys and certificates to
92// include in a server volume from an instance Secret.

Callers 3

TestClientCommonNameFunction · 0.85
SecretFunction · 0.85
serverConfigFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestClientCommonNameFunction · 0.68