You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b67e773
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cozy-lib): add PKCS8 encoding, scope docs, and normalize error messages
Address review feedback from lexfrei:
- Set privateKey.encoding to PKCS8 for modern TLS compatibility
- Document helper scope as leaf certs only (not CA certificates)
- Add namespace and cert-manager prerequisite documentation
- Normalize em-dashes to double-dashes in error messages for ASCII consistency
Signed-off-by: Arsolitt <[email protected]>
-**TLS** (`_tls.tpl`) — cert-manager Certificate CR generation and TLS secret name resolution
14
+
-**TLS** (`_tls.tpl`) — cert-manager Certificate CR generation and TLS secret name resolution (leaf/end-entity certs only; CA certificates should be hand-crafted)
15
15
16
16
Helpers are documented inline in their respective `_*.tpl` files.
17
17
18
18
This chart has no configurable `values.yaml` parameters; all configuration is passed
19
19
via template arguments at call sites.
20
+
21
+
## Prerequisites
22
+
23
+
cert-manager CRDs must be present in the cluster for `cozy-lib.tls.*` helpers
24
+
to produce functional resources. These helpers do not install or vendor
Copy file name to clipboardExpand all lines: packages/library/cozy-lib/templates/_tls.tpl
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
{{/*
2
2
TLS certificate helpers for cert-manager integration.
3
3
These helpers render cert-manager Certificate CRs for services that need TLS.
4
+
5
+
Scope: leaf (end-entity) TLS certificates only. For CA certificates that
6
+
need isCA: true, commonName, signing/cert-sign usages, rotationPolicy: Never,
7
+
or subject fields, write the Certificate CR by hand.
4
8
*/}}
5
9
6
10
{{/*
@@ -25,8 +29,9 @@ Parameters:
25
29
- duration (optional) - certificate duration, defaults to 8760h (1 year); empty strings are treated as unset. Non-empty values are passed through without validation.
- usages (optional) - list of key usages, defaults to ["server auth"] (not cert-manager's default of "digital signature, key encipherment"; this is a deliberate choice for TLS server certificates). An empty list also falls back to the default.
28
-
Private key is hardcoded to RSA-2048 with rotationPolicy: Always; these are not configurable via this helper.
32
+
Private key is hardcoded to RSA-2048 PKCS#8 with rotationPolicy: Always; these are not configurable via this helper.
29
33
extraDnsNames: nil is treated as an empty list (zero extra names appended).
34
+
metadata.namespace is always Release.Namespace; cross-namespace rendering is not supported.
30
35
*/}}
31
36
{{- define"cozy-lib.tls.certificate" -}}
32
37
{{- ifnot.Release -}}
@@ -42,13 +47,13 @@ Parameters:
42
47
{{- fail "ERROR: \"dnsNames\" is required for cozy-lib.tls.certificate. Provide at least one DNS name as a list." -}}
43
48
{{- end -}}
44
49
{{- ifnot (kindIs "slice".dnsNames) -}}
45
-
{{- fail "ERROR: \"dnsNames\" must be a list for cozy-lib.tls.certificate. Got a string — wrap it in a list." -}}
50
+
{{- fail "ERROR: \"dnsNames\" must be a list for cozy-lib.tls.certificate. Got a string -- wrap it in a list." -}}
0 commit comments