Skip to content

Commit 601bfde

Browse files
Add new fields to the internal API types
Signed-off-by: Richard Wall <[email protected]>
1 parent b670fa5 commit 601bfde

File tree

16 files changed

+140
-0
lines changed

16 files changed

+140
-0
lines changed

pkg/convert/internal/apis/acme/types_issuer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ type ACMEIssuer struct {
102102
// it, it will create an error on the Order.
103103
// Defaults to false.
104104
EnableDurationFeature bool
105+
106+
// Profile allows requesting a certificate profile from the ACME server.
107+
// Supported profiles are listed by the server's ACME directory URL.
108+
// +optional
109+
Profile string `json:"profile,omitempty"`
105110
}
106111

107112
// ACMEExternalAccountBinding is a reference to a CA external account of the ACME

pkg/convert/internal/apis/acme/types_order.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ type OrderSpec struct {
7474
// Duration is the duration for the not after date for the requested certificate.
7575
// this is set on order creation as pe the ACME spec.
7676
Duration *metav1.Duration
77+
78+
// Profile allows requesting a certificate profile from the ACME server.
79+
// Supported profiles are listed by the server's ACME directory URL.
80+
// +optional
81+
Profile string `json:"profile,omitempty"`
7782
}
7883

7984
type OrderStatus struct {

pkg/convert/internal/apis/acme/v1alpha2/types_issuer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ type ACMEIssuer struct {
112112
// Defaults to false.
113113
// +optional
114114
EnableDurationFeature bool `json:"enableDurationFeature,omitempty"`
115+
116+
// Profile allows requesting a certificate profile from the ACME server.
117+
// Supported profiles are listed by the server's ACME directory URL.
118+
// +optional
119+
Profile string `json:"profile,omitempty"`
115120
}
116121

117122
// ACMEExternalAccountBinding is a reference to a CA external account of the ACME

pkg/convert/internal/apis/acme/v1alpha2/types_order.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ type OrderSpec struct {
7979
// this is set on order creation as pe the ACME spec.
8080
// +optional
8181
Duration *metav1.Duration `json:"duration,omitempty"`
82+
83+
// Profile allows requesting a certificate profile from the ACME server.
84+
// Supported profiles are listed by the server's ACME directory URL.
85+
// +optional
86+
Profile string `json:"profile,omitempty"`
8287
}
8388

8489
type OrderStatus struct {

pkg/convert/internal/apis/acme/v1alpha3/types_issuer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ type ACMEIssuer struct {
112112
// Defaults to false.
113113
// +optional
114114
EnableDurationFeature bool `json:"enableDurationFeature,omitempty"`
115+
116+
// Profile allows requesting a certificate profile from the ACME server.
117+
// Supported profiles are listed by the server's ACME directory URL.
118+
// +optional
119+
Profile string `json:"profile,omitempty"`
115120
}
116121

117122
// ACMEExternalAccountBinding is a reference to a CA external account of the ACME

pkg/convert/internal/apis/acme/v1alpha3/types_order.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ type OrderSpec struct {
7979
// this is set on order creation as pe the ACME spec.
8080
// +optional
8181
Duration *metav1.Duration `json:"duration,omitempty"`
82+
83+
// Profile allows requesting a certificate profile from the ACME server.
84+
// Supported profiles are listed by the server's ACME directory URL.
85+
// +optional
86+
Profile string `json:"profile,omitempty"`
8287
}
8388

8489
type OrderStatus struct {

pkg/convert/internal/apis/acme/v1beta1/types_issuer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ type ACMEIssuer struct {
112112
// Defaults to false.
113113
// +optional
114114
EnableDurationFeature bool `json:"enableDurationFeature,omitempty"`
115+
116+
// Profile allows requesting a certificate profile from the ACME server.
117+
// Supported profiles are listed by the server's ACME directory URL.
118+
// +optional
119+
Profile string `json:"profile,omitempty"`
115120
}
116121

117122
// ACMEExternalAccountBinding is a reference to a CA external account of the ACME

pkg/convert/internal/apis/acme/v1beta1/types_order.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ type OrderSpec struct {
8080
// this is set on order creation as pe the ACME spec.
8181
// +optional
8282
Duration *metav1.Duration `json:"duration,omitempty"`
83+
84+
// Profile allows requesting a certificate profile from the ACME server.
85+
// Supported profiles are listed by the server's ACME directory URL.
86+
// +optional
87+
Profile string `json:"profile,omitempty"`
8388
}
8489

8590
type OrderStatus struct {

pkg/convert/internal/apis/certmanager/types_certificate.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ const (
8989
PKCS8 PrivateKeyEncoding = "PKCS8"
9090
)
9191

92+
// +kubebuilder:validation:Enum=SHA256WithRSA;SHA384WithRSA;SHA512WithRSA;ECDSAWithSHA256;ECDSAWithSHA384;ECDSAWithSHA512;PureEd25519
93+
type SignatureAlgorithm string
94+
95+
const (
96+
SHA256WithRSA SignatureAlgorithm = "SHA256WithRSA"
97+
SHA384WithRSA SignatureAlgorithm = "SHA384WithRSA"
98+
SHA512WithRSA SignatureAlgorithm = "SHA512WithRSA"
99+
ECDSAWithSHA256 SignatureAlgorithm = "ECDSAWithSHA256"
100+
ECDSAWithSHA384 SignatureAlgorithm = "ECDSAWithSHA384"
101+
ECDSAWithSHA512 SignatureAlgorithm = "ECDSAWithSHA512"
102+
PureEd25519 SignatureAlgorithm = "PureEd25519"
103+
)
104+
92105
// CertificateSpec defines the desired state of Certificate.
93106
//
94107
// NOTE: The specification contains a lot of "requested" certificate attributes, it is
@@ -236,6 +249,13 @@ type CertificateSpec struct {
236249
// encoding and the rotation policy.
237250
PrivateKey *CertificatePrivateKey
238251

252+
// Signature algorithm to use.
253+
// Allowed values for RSA keys: SHA256WithRSA, SHA384WithRSA, SHA512WithRSA.
254+
// Allowed values for ECDSA keys: ECDSAWithSHA256, ECDSAWithSHA384, ECDSAWithSHA512.
255+
// Allowed values for Ed25519 keys: PureEd25519.
256+
// +optional
257+
SignatureAlgorithm SignatureAlgorithm `json:"signatureAlgorithm,omitempty"`
258+
239259
// Whether the KeyUsage and ExtKeyUsage extensions should be set in the encoded CSR.
240260
//
241261
// This option defaults to true, and should only be disabled if the target

pkg/convert/internal/apis/certmanager/types_issuer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ type VaultIssuer struct {
179179
// Server is the connection address for the Vault server, e.g: "https://vault.example.com:8200".
180180
Server string
181181

182+
// ServerName is used to verify the hostname on the returned certificates
183+
// by the Vault server.
184+
// +optional
185+
ServerName string `json:"serverName,omitempty"`
186+
182187
// Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g:
183188
// "my_pki_mount/sign/my-role-name".
184189
Path string

0 commit comments

Comments
 (0)