generated.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.certificates.v1beta1;
  16. import "k8s.io/api/core/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  19. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  20. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/certificates/v1beta1";
  22. // Describes a certificate signing request
  23. // +k8s:supportsSubresource=/status
  24. // +k8s:supportsSubresource=/approval
  25. message CertificateSigningRequest {
  26. // +optional
  27. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  28. // spec contains the certificate request, and is immutable after creation.
  29. // Only the request, signerName, expirationSeconds, and usages fields can be set on creation.
  30. // Other fields are derived by Kubernetes and cannot be modified by users.
  31. optional CertificateSigningRequestSpec spec = 2;
  32. // Derived information about the request.
  33. // +optional
  34. optional CertificateSigningRequestStatus status = 3;
  35. }
  36. message CertificateSigningRequestCondition {
  37. // type of the condition. Known conditions include "Approved", "Denied", and "Failed".
  38. optional string type = 1;
  39. // Status of the condition, one of True, False, Unknown.
  40. // Approved, Denied, and Failed conditions may not be "False" or "Unknown".
  41. // Defaults to "True".
  42. // If unset, should be treated as "True".
  43. // +optional
  44. optional string status = 6;
  45. // brief reason for the request state
  46. // +optional
  47. optional string reason = 2;
  48. // human readable message with details about the request state
  49. // +optional
  50. optional string message = 3;
  51. // timestamp for the last update to this condition
  52. // +optional
  53. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
  54. // lastTransitionTime is the time the condition last transitioned from one status to another.
  55. // If unset, when a new condition type is added or an existing condition's status is changed,
  56. // the server defaults this to the current time.
  57. // +optional
  58. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
  59. }
  60. message CertificateSigningRequestList {
  61. // +optional
  62. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  63. repeated CertificateSigningRequest items = 2;
  64. }
  65. // CertificateSigningRequestSpec contains the certificate request.
  66. message CertificateSigningRequestSpec {
  67. // Base64-encoded PKCS#10 CSR data
  68. optional bytes request = 1;
  69. // Requested signer for the request. It is a qualified name in the form:
  70. // `scope-hostname.io/name`.
  71. // If empty, it will be defaulted:
  72. // 1. If it's a kubelet client certificate, it is assigned
  73. // "kubernetes.io/kube-apiserver-client-kubelet".
  74. // 2. If it's a kubelet serving certificate, it is assigned
  75. // "kubernetes.io/kubelet-serving".
  76. // 3. Otherwise, it is assigned "kubernetes.io/legacy-unknown".
  77. // Distribution of trust for signers happens out of band.
  78. // You can select on this field using `spec.signerName`.
  79. // +optional
  80. optional string signerName = 7;
  81. // expirationSeconds is the requested duration of validity of the issued
  82. // certificate. The certificate signer may issue a certificate with a different
  83. // validity duration so a client must check the delta between the notBefore and
  84. // and notAfter fields in the issued certificate to determine the actual duration.
  85. //
  86. // The v1.22+ in-tree implementations of the well-known Kubernetes signers will
  87. // honor this field as long as the requested duration is not greater than the
  88. // maximum duration they will honor per the --cluster-signing-duration CLI
  89. // flag to the Kubernetes controller manager.
  90. //
  91. // Certificate signers may not honor this field for various reasons:
  92. //
  93. // 1. Old signer that is unaware of the field (such as the in-tree
  94. // implementations prior to v1.22)
  95. // 2. Signer whose configured maximum is shorter than the requested duration
  96. // 3. Signer whose configured minimum is longer than the requested duration
  97. //
  98. // The minimum valid value for expirationSeconds is 600, i.e. 10 minutes.
  99. //
  100. // +optional
  101. optional int32 expirationSeconds = 8;
  102. // allowedUsages specifies a set of usage contexts the key will be
  103. // valid for.
  104. // See:
  105. // https://tools.ietf.org/html/rfc5280#section-4.2.1.3
  106. // https://tools.ietf.org/html/rfc5280#section-4.2.1.12
  107. //
  108. // Valid values are:
  109. // "signing",
  110. // "digital signature",
  111. // "content commitment",
  112. // "key encipherment",
  113. // "key agreement",
  114. // "data encipherment",
  115. // "cert sign",
  116. // "crl sign",
  117. // "encipher only",
  118. // "decipher only",
  119. // "any",
  120. // "server auth",
  121. // "client auth",
  122. // "code signing",
  123. // "email protection",
  124. // "s/mime",
  125. // "ipsec end system",
  126. // "ipsec tunnel",
  127. // "ipsec user",
  128. // "timestamping",
  129. // "ocsp signing",
  130. // "microsoft sgc",
  131. // "netscape sgc"
  132. // +listType=atomic
  133. repeated string usages = 5;
  134. // Information about the requesting user.
  135. // See user.Info interface for details.
  136. // +optional
  137. optional string username = 2;
  138. // UID information about the requesting user.
  139. // See user.Info interface for details.
  140. // +optional
  141. optional string uid = 3;
  142. // Group information about the requesting user.
  143. // See user.Info interface for details.
  144. // +listType=atomic
  145. // +optional
  146. repeated string groups = 4;
  147. // Extra information about the requesting user.
  148. // See user.Info interface for details.
  149. // +optional
  150. map<string, ExtraValue> extra = 6;
  151. }
  152. message CertificateSigningRequestStatus {
  153. // Conditions applied to the request, such as approval or denial.
  154. // +listType=map
  155. // +listMapKey=type
  156. // +optional
  157. // +k8s:listType=map
  158. // +k8s:listMapKey=type
  159. // +k8s:customUnique
  160. // +k8s:optional
  161. // +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
  162. // +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
  163. repeated CertificateSigningRequestCondition conditions = 1;
  164. // If request was approved, the controller will place the issued certificate here.
  165. // +optional
  166. optional bytes certificate = 2;
  167. }
  168. // ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors
  169. // (root certificates).
  170. //
  171. // ClusterTrustBundle objects are considered to be readable by any authenticated
  172. // user in the cluster, because they can be mounted by pods using the
  173. // `clusterTrustBundle` projection. All service accounts have read access to
  174. // ClusterTrustBundles by default. Users who only have namespace-level access
  175. // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount
  176. // that they have access to.
  177. //
  178. // It can be optionally associated with a particular assigner, in which case it
  179. // contains one valid set of trust anchors for that signer. Signers may have
  180. // multiple associated ClusterTrustBundles; each is an independent set of trust
  181. // anchors for that signer. Admission control is used to enforce that only users
  182. // with permissions on the signer can create or modify the corresponding bundle.
  183. message ClusterTrustBundle {
  184. // metadata contains the object metadata.
  185. // +optional
  186. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  187. // spec contains the signer (if any) and trust anchors.
  188. optional ClusterTrustBundleSpec spec = 2;
  189. }
  190. // ClusterTrustBundleList is a collection of ClusterTrustBundle objects
  191. message ClusterTrustBundleList {
  192. // metadata contains the list metadata.
  193. //
  194. // +optional
  195. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  196. // items is a collection of ClusterTrustBundle objects
  197. repeated ClusterTrustBundle items = 2;
  198. }
  199. // ClusterTrustBundleSpec contains the signer and trust anchors.
  200. message ClusterTrustBundleSpec {
  201. // signerName indicates the associated signer, if any.
  202. //
  203. // In order to create or update a ClusterTrustBundle that sets signerName,
  204. // you must have the following cluster-scoped permission:
  205. // group=certificates.k8s.io resource=signers resourceName=<the signer name>
  206. // verb=attest.
  207. //
  208. // If signerName is not empty, then the ClusterTrustBundle object must be
  209. // named with the signer name as a prefix (translating slashes to colons).
  210. // For example, for the signer name `example.com/foo`, valid
  211. // ClusterTrustBundle object names include `example.com:foo:abc` and
  212. // `example.com:foo:v1`.
  213. //
  214. // If signerName is empty, then the ClusterTrustBundle object's name must
  215. // not have such a prefix.
  216. //
  217. // List/watch requests for ClusterTrustBundles can filter on this field
  218. // using a `spec.signerName=NAME` field selector.
  219. //
  220. // +optional
  221. optional string signerName = 1;
  222. // trustBundle contains the individual X.509 trust anchors for this
  223. // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates.
  224. //
  225. // The data must consist only of PEM certificate blocks that parse as valid
  226. // X.509 certificates. Each certificate must include a basic constraints
  227. // extension with the CA bit set. The API server will reject objects that
  228. // contain duplicate certificates, or that use PEM block headers.
  229. //
  230. // Users of ClusterTrustBundles, including Kubelet, are free to reorder and
  231. // deduplicate certificate blocks in this file according to their own logic,
  232. // as well as to drop PEM block headers and inter-block data.
  233. optional string trustBundle = 2;
  234. }
  235. // ExtraValue masks the value so protobuf can generate
  236. // +protobuf.nullable=true
  237. // +protobuf.options.(gogoproto.goproto_stringer)=false
  238. message ExtraValue {
  239. // items, if empty, will result in an empty slice
  240. repeated string items = 1;
  241. }
  242. // PodCertificateRequest encodes a pod requesting a certificate from a given
  243. // signer.
  244. //
  245. // Kubelets use this API to implement podCertificate projected volumes
  246. message PodCertificateRequest {
  247. // metadata contains the object metadata.
  248. //
  249. // +optional
  250. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  251. // spec contains the details about the certificate being requested.
  252. optional PodCertificateRequestSpec spec = 2;
  253. // status contains the issued certificate, and a standard set of conditions.
  254. // +optional
  255. optional PodCertificateRequestStatus status = 3;
  256. }
  257. // PodCertificateRequestList is a collection of PodCertificateRequest objects
  258. message PodCertificateRequestList {
  259. // metadata contains the list metadata.
  260. //
  261. // +optional
  262. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  263. // items is a collection of PodCertificateRequest objects
  264. repeated PodCertificateRequest items = 2;
  265. }
  266. // PodCertificateRequestSpec describes the certificate request. All fields are
  267. // immutable after creation.
  268. message PodCertificateRequestSpec {
  269. // signerName indicates the requested signer.
  270. //
  271. // All signer names beginning with `kubernetes.io` are reserved for use by
  272. // the Kubernetes project. There is currently one well-known signer
  273. // documented by the Kubernetes project,
  274. // `kubernetes.io/kube-apiserver-client-pod`, which will issue client
  275. // certificates understood by kube-apiserver. It is currently
  276. // unimplemented.
  277. //
  278. // +required
  279. optional string signerName = 1;
  280. // podName is the name of the pod into which the certificate will be mounted.
  281. //
  282. // +required
  283. optional string podName = 2;
  284. // podUID is the UID of the pod into which the certificate will be mounted.
  285. //
  286. // +required
  287. optional string podUID = 3;
  288. // serviceAccountName is the name of the service account the pod is running as.
  289. //
  290. // +required
  291. optional string serviceAccountName = 4;
  292. // serviceAccountUID is the UID of the service account the pod is running as.
  293. //
  294. // +required
  295. optional string serviceAccountUID = 5;
  296. // nodeName is the name of the node the pod is assigned to.
  297. //
  298. // +required
  299. optional string nodeName = 6;
  300. // nodeUID is the UID of the node the pod is assigned to.
  301. //
  302. // +required
  303. optional string nodeUID = 7;
  304. // maxExpirationSeconds is the maximum lifetime permitted for the
  305. // certificate.
  306. //
  307. // If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver
  308. // will reject values shorter than 3600 (1 hour). The maximum allowable
  309. // value is 7862400 (91 days).
  310. //
  311. // The signer implementation is then free to issue a certificate with any
  312. // lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600
  313. // seconds (1 hour). This constraint is enforced by kube-apiserver.
  314. // `kubernetes.io` signers will never issue certificates with a lifetime
  315. // longer than 24 hours.
  316. //
  317. // +optional
  318. // +default=86400
  319. optional int32 maxExpirationSeconds = 8;
  320. // pkixPublicKey is the PKIX-serialized public key the signer will issue the
  321. // certificate to.
  322. //
  323. // The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521,
  324. // or ED25519. Note that this list may be expanded in the future.
  325. //
  326. // Signer implementations do not need to support all key types supported by
  327. // kube-apiserver and kubelet. If a signer does not support the key type
  328. // used for a given PodCertificateRequest, it must deny the request by
  329. // setting a status.conditions entry with a type of "Denied" and a reason of
  330. // "UnsupportedKeyType". It may also suggest a key type that it does support
  331. // in the message field.
  332. //
  333. // +required
  334. optional bytes pkixPublicKey = 9;
  335. // proofOfPossession proves that the requesting kubelet holds the private
  336. // key corresponding to pkixPublicKey.
  337. //
  338. // It is contructed by signing the ASCII bytes of the pod's UID using
  339. // `pkixPublicKey`.
  340. //
  341. // kube-apiserver validates the proof of possession during creation of the
  342. // PodCertificateRequest.
  343. //
  344. // If the key is an RSA key, then the signature is over the ASCII bytes of
  345. // the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang
  346. // function crypto/rsa.SignPSS with nil options).
  347. //
  348. // If the key is an ECDSA key, then the signature is as described by [SEC 1,
  349. // Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the
  350. // golang library function crypto/ecdsa.SignASN1)
  351. //
  352. // If the key is an ED25519 key, the the signature is as described by the
  353. // [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by
  354. // the golang library crypto/ed25519.Sign).
  355. //
  356. // +required
  357. optional bytes proofOfPossession = 10;
  358. // unverifiedUserAnnotations allow pod authors to pass additional information to
  359. // the signer implementation. Kubernetes does not restrict or validate this
  360. // metadata in any way.
  361. //
  362. // Entries are subject to the same validation as object metadata annotations,
  363. // with the addition that all keys must be domain-prefixed. No restrictions
  364. // are placed on values, except an overall size limitation on the entire field.
  365. //
  366. // Signers should document the keys and values they support. Signers should
  367. // deny requests that contain keys they do not recognize.
  368. map<string, string> unverifiedUserAnnotations = 11;
  369. }
  370. // PodCertificateRequestStatus describes the status of the request, and holds
  371. // the certificate data if the request is issued.
  372. message PodCertificateRequestStatus {
  373. // conditions applied to the request.
  374. //
  375. // The types "Issued", "Denied", and "Failed" have special handling. At
  376. // most one of these conditions may be present, and they must have status
  377. // "True".
  378. //
  379. // If the request is denied with `Reason=UnsupportedKeyType`, the signer may
  380. // suggest a key type that will work in the message field.
  381. //
  382. // +patchMergeKey=type
  383. // +patchStrategy=merge
  384. // +listType=map
  385. // +listMapKey=type
  386. // +optional
  387. repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
  388. // certificateChain is populated with an issued certificate by the signer.
  389. // This field is set via the /status subresource. Once populated, this field
  390. // is immutable.
  391. //
  392. // If the certificate signing request is denied, a condition of type
  393. // "Denied" is added and this field remains empty. If the signer cannot
  394. // issue the certificate, a condition of type "Failed" is added and this
  395. // field remains empty.
  396. //
  397. // Validation requirements:
  398. // 1. certificateChain must consist of one or more PEM-formatted certificates.
  399. // 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as
  400. // described in section 4 of RFC5280.
  401. //
  402. // If more than one block is present, and the definition of the requested
  403. // spec.signerName does not indicate otherwise, the first block is the
  404. // issued certificate, and subsequent blocks should be treated as
  405. // intermediate certificates and presented in TLS handshakes. When
  406. // projecting the chain into a pod volume, kubelet will drop any data
  407. // in-between the PEM blocks, as well as any PEM block headers.
  408. //
  409. // +optional
  410. optional string certificateChain = 2;
  411. // notBefore is the time at which the certificate becomes valid. The value
  412. // must be the same as the notBefore value in the leaf certificate in
  413. // certificateChain. This field is set via the /status subresource. Once
  414. // populated, it is immutable. The signer must set this field at the same
  415. // time it sets certificateChain.
  416. //
  417. // +optional
  418. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time notBefore = 4;
  419. // beginRefreshAt is the time at which the kubelet should begin trying to
  420. // refresh the certificate. This field is set via the /status subresource,
  421. // and must be set at the same time as certificateChain. Once populated,
  422. // this field is immutable.
  423. //
  424. // This field is only a hint. Kubelet may start refreshing before or after
  425. // this time if necessary.
  426. //
  427. // +optional
  428. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time beginRefreshAt = 5;
  429. // notAfter is the time at which the certificate expires. The value must be
  430. // the same as the notAfter value in the leaf certificate in
  431. // certificateChain. This field is set via the /status subresource. Once
  432. // populated, it is immutable. The signer must set this field at the same
  433. // time it sets certificateChain.
  434. //
  435. // +optional
  436. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time notAfter = 6;
  437. }