blob: 8427424a8ca600a7e7c32bcbea219850ed87b9f8 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.certificates.v1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28
29// Package-wide variables from generator "generated".
30option go_package = "v1";
31
32// CertificateSigningRequest objects provide a mechanism to obtain x509 certificates
33// by submitting a certificate signing request, and having it asynchronously approved and issued.
34//
35// Kubelets use this API to obtain:
36// 1. client certificates to authenticate to kube-apiserver (with the "kubernetes.io/kube-apiserver-client-kubelet" signerName).
37// 2. serving certificates for TLS endpoints kube-apiserver can connect to securely (with the "kubernetes.io/kubelet-serving" signerName).
38//
39// This API can be used to request client certificates to authenticate to kube-apiserver
40// (with the "kubernetes.io/kube-apiserver-client" signerName),
41// or to obtain certificates from custom non-Kubernetes signers.
42message CertificateSigningRequest {
43 // +optional
44 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
45
46 // spec contains the certificate request, and is immutable after creation.
47 // Only the request, signerName, and usages fields can be set on creation.
48 // Other fields are derived by Kubernetes and cannot be modified by users.
49 optional CertificateSigningRequestSpec spec = 2;
50
51 // status contains information about whether the request is approved or denied,
52 // and the certificate issued by the signer, or the failure condition indicating signer failure.
53 // +optional
54 optional CertificateSigningRequestStatus status = 3;
55}
56
57// CertificateSigningRequestCondition describes a condition of a CertificateSigningRequest object
58message CertificateSigningRequestCondition {
59 // type of the condition. Known conditions are "Approved", "Denied", and "Failed".
60 //
61 // An "Approved" condition is added via the /approval subresource,
62 // indicating the request was approved and should be issued by the signer.
63 //
64 // A "Denied" condition is added via the /approval subresource,
65 // indicating the request was denied and should not be issued by the signer.
66 //
67 // A "Failed" condition is added via the /status subresource,
68 // indicating the signer failed to issue the certificate.
69 //
70 // Approved and Denied conditions are mutually exclusive.
71 // Approved, Denied, and Failed conditions cannot be removed once added.
72 //
73 // Only one condition of a given type is allowed.
74 optional string type = 1;
75
76 // status of the condition, one of True, False, Unknown.
77 // Approved, Denied, and Failed conditions may not be "False" or "Unknown".
78 optional string status = 6;
79
80 // reason indicates a brief reason for the request state
81 // +optional
82 optional string reason = 2;
83
84 // message contains a human readable message with details about the request state
85 // +optional
86 optional string message = 3;
87
88 // lastUpdateTime is the time of the last update to this condition
89 // +optional
90 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
91
92 // lastTransitionTime is the time the condition last transitioned from one status to another.
93 // If unset, when a new condition type is added or an existing condition's status is changed,
94 // the server defaults this to the current time.
95 // +optional
96 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
97}
98
99// CertificateSigningRequestList is a collection of CertificateSigningRequest objects
100message CertificateSigningRequestList {
101 // +optional
102 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
103
104 // items is a collection of CertificateSigningRequest objects
105 repeated CertificateSigningRequest items = 2;
106}
107
108// CertificateSigningRequestSpec contains the certificate request.
109message CertificateSigningRequestSpec {
110 // request contains an x509 certificate signing request encoded in a "CERTIFICATE REQUEST" PEM block.
111 // When serialized as JSON or YAML, the data is additionally base64-encoded.
112 // +listType=atomic
113 optional bytes request = 1;
114
115 // signerName indicates the requested signer, and is a qualified name.
116 //
117 // List/watch requests for CertificateSigningRequests can filter on this field using a "spec.signerName=NAME" fieldSelector.
118 //
119 // Well-known Kubernetes signers are:
120 // 1. "kubernetes.io/kube-apiserver-client": issues client certificates that can be used to authenticate to kube-apiserver.
121 // Requests for this signer are never auto-approved by kube-controller-manager, can be issued by the "csrsigning" controller in kube-controller-manager.
122 // 2. "kubernetes.io/kube-apiserver-client-kubelet": issues client certificates that kubelets use to authenticate to kube-apiserver.
123 // Requests for this signer can be auto-approved by the "csrapproving" controller in kube-controller-manager, and can be issued by the "csrsigning" controller in kube-controller-manager.
124 // 3. "kubernetes.io/kubelet-serving" issues serving certificates that kubelets use to serve TLS endpoints, which kube-apiserver can connect to securely.
125 // Requests for this signer are never auto-approved by kube-controller-manager, and can be issued by the "csrsigning" controller in kube-controller-manager.
126 //
127 // More details are available at https://k8s.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers
128 //
129 // Custom signerNames can also be specified. The signer defines:
130 // 1. Trust distribution: how trust (CA bundles) are distributed.
131 // 2. Permitted subjects: and behavior when a disallowed subject is requested.
132 // 3. Required, permitted, or forbidden x509 extensions in the request (including whether subjectAltNames are allowed, which types, restrictions on allowed values) and behavior when a disallowed extension is requested.
133 // 4. Required, permitted, or forbidden key usages / extended key usages.
134 // 5. Expiration/certificate lifetime: whether it is fixed by the signer, configurable by the admin.
135 // 6. Whether or not requests for CA certificates are allowed.
136 optional string signerName = 7;
137
138 // usages specifies a set of key usages requested in the issued certificate.
139 //
140 // Requests for TLS client certificates typically request: "digital signature", "key encipherment", "client auth".
141 //
142 // Requests for TLS serving certificates typically request: "key encipherment", "digital signature", "server auth".
143 //
144 // Valid values are:
145 // "signing", "digital signature", "content commitment",
146 // "key encipherment", "key agreement", "data encipherment",
147 // "cert sign", "crl sign", "encipher only", "decipher only", "any",
148 // "server auth", "client auth",
149 // "code signing", "email protection", "s/mime",
150 // "ipsec end system", "ipsec tunnel", "ipsec user",
151 // "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"
152 // +listType=atomic
153 repeated string usages = 5;
154
155 // username contains the name of the user that created the CertificateSigningRequest.
156 // Populated by the API server on creation and immutable.
157 // +optional
158 optional string username = 2;
159
160 // uid contains the uid of the user that created the CertificateSigningRequest.
161 // Populated by the API server on creation and immutable.
162 // +optional
163 optional string uid = 3;
164
165 // groups contains group membership of the user that created the CertificateSigningRequest.
166 // Populated by the API server on creation and immutable.
167 // +listType=atomic
168 // +optional
169 repeated string groups = 4;
170
171 // extra contains extra attributes of the user that created the CertificateSigningRequest.
172 // Populated by the API server on creation and immutable.
173 // +optional
174 map<string, ExtraValue> extra = 6;
175}
176
177// CertificateSigningRequestStatus contains conditions used to indicate
178// approved/denied/failed status of the request, and the issued certificate.
179message CertificateSigningRequestStatus {
180 // conditions applied to the request. Known conditions are "Approved", "Denied", and "Failed".
181 // +listType=map
182 // +listMapKey=type
183 // +optional
184 repeated CertificateSigningRequestCondition conditions = 1;
185
186 // certificate is populated with an issued certificate by the signer after an Approved condition is present.
187 // This field is set via the /status subresource. Once populated, this field is immutable.
188 //
189 // If the certificate signing request is denied, a condition of type "Denied" is added and this field remains empty.
190 // If the signer cannot issue the certificate, a condition of type "Failed" is added and this field remains empty.
191 //
192 // Validation requirements:
193 // 1. certificate must contain one or more PEM blocks.
194 // 2. All PEM blocks must have the "CERTIFICATE" label, contain no headers, and the encoded data
195 // must be a BER-encoded ASN.1 Certificate structure as described in section 4 of RFC5280.
196 // 3. Non-PEM content may appear before or after the "CERTIFICATE" PEM blocks and is unvalidated,
197 // to allow for explanatory text as described in section 5.2 of RFC7468.
198 //
199 // If more than one PEM block is present, and the definition of the requested spec.signerName
200 // does not indicate otherwise, the first block is the issued certificate,
201 // and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes.
202 //
203 // The certificate is encoded in PEM format.
204 //
205 // When serialized as JSON or YAML, the data is additionally base64-encoded, so it consists of:
206 //
207 // base64(
208 // -----BEGIN CERTIFICATE-----
209 // ...
210 // -----END CERTIFICATE-----
211 // )
212 //
213 // +listType=atomic
214 // +optional
215 optional bytes certificate = 2;
216}
217
218// ExtraValue masks the value so protobuf can generate
219// +protobuf.nullable=true
220// +protobuf.options.(gogoproto.goproto_stringer)=false
221message ExtraValue {
222 // items, if empty, will result in an empty slice
223
224 repeated string items = 1;
225}
226