generated.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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.v1;
  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/v1";
  22. // CertificateSigningRequest objects provide a mechanism to obtain x509 certificates
  23. // by submitting a certificate signing request, and having it asynchronously approved and issued.
  24. //
  25. // Kubelets use this API to obtain:
  26. // 1. client certificates to authenticate to kube-apiserver (with the "kubernetes.io/kube-apiserver-client-kubelet" signerName).
  27. // 2. serving certificates for TLS endpoints kube-apiserver can connect to securely (with the "kubernetes.io/kubelet-serving" signerName).
  28. //
  29. // This API can be used to request client certificates to authenticate to kube-apiserver
  30. // (with the "kubernetes.io/kube-apiserver-client" signerName),
  31. // or to obtain certificates from custom non-Kubernetes signers.
  32. // +k8s:supportsSubresource=/status
  33. // +k8s:supportsSubresource=/approval
  34. message CertificateSigningRequest {
  35. // +optional
  36. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  37. // spec contains the certificate request, and is immutable after creation.
  38. // Only the request, signerName, expirationSeconds, and usages fields can be set on creation.
  39. // Other fields are derived by Kubernetes and cannot be modified by users.
  40. optional CertificateSigningRequestSpec spec = 2;
  41. // status contains information about whether the request is approved or denied,
  42. // and the certificate issued by the signer, or the failure condition indicating signer failure.
  43. // +optional
  44. optional CertificateSigningRequestStatus status = 3;
  45. }
  46. // CertificateSigningRequestCondition describes a condition of a CertificateSigningRequest object
  47. message CertificateSigningRequestCondition {
  48. // type of the condition. Known conditions are "Approved", "Denied", and "Failed".
  49. //
  50. // An "Approved" condition is added via the /approval subresource,
  51. // indicating the request was approved and should be issued by the signer.
  52. //
  53. // A "Denied" condition is added via the /approval subresource,
  54. // indicating the request was denied and should not be issued by the signer.
  55. //
  56. // A "Failed" condition is added via the /status subresource,
  57. // indicating the signer failed to issue the certificate.
  58. //
  59. // Approved and Denied conditions are mutually exclusive.
  60. // Approved, Denied, and Failed conditions cannot be removed once added.
  61. //
  62. // Only one condition of a given type is allowed.
  63. optional string type = 1;
  64. // status of the condition, one of True, False, Unknown.
  65. // Approved, Denied, and Failed conditions may not be "False" or "Unknown".
  66. optional string status = 6;
  67. // reason indicates a brief reason for the request state
  68. // +optional
  69. optional string reason = 2;
  70. // message contains a human readable message with details about the request state
  71. // +optional
  72. optional string message = 3;
  73. // lastUpdateTime is the time of the last update to this condition
  74. // +optional
  75. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
  76. // lastTransitionTime is the time the condition last transitioned from one status to another.
  77. // If unset, when a new condition type is added or an existing condition's status is changed,
  78. // the server defaults this to the current time.
  79. // +optional
  80. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
  81. }
  82. // CertificateSigningRequestList is a collection of CertificateSigningRequest objects
  83. message CertificateSigningRequestList {
  84. // +optional
  85. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  86. // items is a collection of CertificateSigningRequest objects
  87. repeated CertificateSigningRequest items = 2;
  88. }
  89. // CertificateSigningRequestSpec contains the certificate request.
  90. message CertificateSigningRequestSpec {
  91. // request contains an x509 certificate signing request encoded in a "CERTIFICATE REQUEST" PEM block.
  92. // When serialized as JSON or YAML, the data is additionally base64-encoded.
  93. optional bytes request = 1;
  94. // signerName indicates the requested signer, and is a qualified name.
  95. //
  96. // List/watch requests for CertificateSigningRequests can filter on this field using a "spec.signerName=NAME" fieldSelector.
  97. //
  98. // Well-known Kubernetes signers are:
  99. // 1. "kubernetes.io/kube-apiserver-client": issues client certificates that can be used to authenticate to kube-apiserver.
  100. // Requests for this signer are never auto-approved by kube-controller-manager, can be issued by the "csrsigning" controller in kube-controller-manager.
  101. // 2. "kubernetes.io/kube-apiserver-client-kubelet": issues client certificates that kubelets use to authenticate to kube-apiserver.
  102. // 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.
  103. // 3. "kubernetes.io/kubelet-serving" issues serving certificates that kubelets use to serve TLS endpoints, which kube-apiserver can connect to securely.
  104. // Requests for this signer are never auto-approved by kube-controller-manager, and can be issued by the "csrsigning" controller in kube-controller-manager.
  105. //
  106. // More details are available at https://k8s.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers
  107. //
  108. // Custom signerNames can also be specified. The signer defines:
  109. // 1. Trust distribution: how trust (CA bundles) are distributed.
  110. // 2. Permitted subjects: and behavior when a disallowed subject is requested.
  111. // 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.
  112. // 4. Required, permitted, or forbidden key usages / extended key usages.
  113. // 5. Expiration/certificate lifetime: whether it is fixed by the signer, configurable by the admin.
  114. // 6. Whether or not requests for CA certificates are allowed.
  115. optional string signerName = 7;
  116. // expirationSeconds is the requested duration of validity of the issued
  117. // certificate. The certificate signer may issue a certificate with a different
  118. // validity duration so a client must check the delta between the notBefore and
  119. // and notAfter fields in the issued certificate to determine the actual duration.
  120. //
  121. // The v1.22+ in-tree implementations of the well-known Kubernetes signers will
  122. // honor this field as long as the requested duration is not greater than the
  123. // maximum duration they will honor per the --cluster-signing-duration CLI
  124. // flag to the Kubernetes controller manager.
  125. //
  126. // Certificate signers may not honor this field for various reasons:
  127. //
  128. // 1. Old signer that is unaware of the field (such as the in-tree
  129. // implementations prior to v1.22)
  130. // 2. Signer whose configured maximum is shorter than the requested duration
  131. // 3. Signer whose configured minimum is longer than the requested duration
  132. //
  133. // The minimum valid value for expirationSeconds is 600, i.e. 10 minutes.
  134. //
  135. // +optional
  136. optional int32 expirationSeconds = 8;
  137. // usages specifies a set of key usages requested in the issued certificate.
  138. //
  139. // Requests for TLS client certificates typically request: "digital signature", "key encipherment", "client auth".
  140. //
  141. // Requests for TLS serving certificates typically request: "key encipherment", "digital signature", "server auth".
  142. //
  143. // Valid values are:
  144. // "signing", "digital signature", "content commitment",
  145. // "key encipherment", "key agreement", "data encipherment",
  146. // "cert sign", "crl sign", "encipher only", "decipher only", "any",
  147. // "server auth", "client auth",
  148. // "code signing", "email protection", "s/mime",
  149. // "ipsec end system", "ipsec tunnel", "ipsec user",
  150. // "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"
  151. // +listType=atomic
  152. repeated string usages = 5;
  153. // username contains the name of the user that created the CertificateSigningRequest.
  154. // Populated by the API server on creation and immutable.
  155. // +optional
  156. optional string username = 2;
  157. // uid contains the uid of the user that created the CertificateSigningRequest.
  158. // Populated by the API server on creation and immutable.
  159. // +optional
  160. optional string uid = 3;
  161. // groups contains group membership of the user that created the CertificateSigningRequest.
  162. // Populated by the API server on creation and immutable.
  163. // +listType=atomic
  164. // +optional
  165. repeated string groups = 4;
  166. // extra contains extra attributes of the user that created the CertificateSigningRequest.
  167. // Populated by the API server on creation and immutable.
  168. // +optional
  169. map<string, ExtraValue> extra = 6;
  170. }
  171. // CertificateSigningRequestStatus contains conditions used to indicate
  172. // approved/denied/failed status of the request, and the issued certificate.
  173. message CertificateSigningRequestStatus {
  174. // conditions applied to the request. Known conditions are "Approved", "Denied", and "Failed".
  175. // +listType=map
  176. // +listMapKey=type
  177. // +optional
  178. // +k8s:listType=map
  179. // +k8s:listMapKey=type
  180. // +k8s:customUnique
  181. // +k8s:optional
  182. // +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
  183. // +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
  184. repeated CertificateSigningRequestCondition conditions = 1;
  185. // certificate is populated with an issued certificate by the signer after an Approved condition is present.
  186. // This field is set via the /status subresource. Once populated, this field is immutable.
  187. //
  188. // If the certificate signing request is denied, a condition of type "Denied" is added and this field remains empty.
  189. // If the signer cannot issue the certificate, a condition of type "Failed" is added and this field remains empty.
  190. //
  191. // Validation requirements:
  192. // 1. certificate must contain one or more PEM blocks.
  193. // 2. All PEM blocks must have the "CERTIFICATE" label, contain no headers, and the encoded data
  194. // must be a BER-encoded ASN.1 Certificate structure as described in section 4 of RFC5280.
  195. // 3. Non-PEM content may appear before or after the "CERTIFICATE" PEM blocks and is unvalidated,
  196. // to allow for explanatory text as described in section 5.2 of RFC7468.
  197. //
  198. // If more than one PEM block is present, and the definition of the requested spec.signerName
  199. // does not indicate otherwise, the first block is the issued certificate,
  200. // and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes.
  201. //
  202. // The certificate is encoded in PEM format.
  203. //
  204. // When serialized as JSON or YAML, the data is additionally base64-encoded, so it consists of:
  205. //
  206. // base64(
  207. // -----BEGIN CERTIFICATE-----
  208. // ...
  209. // -----END CERTIFICATE-----
  210. // )
  211. //
  212. // +optional
  213. optional bytes certificate = 2;
  214. }
  215. // ExtraValue masks the value so protobuf can generate
  216. // +protobuf.nullable=true
  217. // +protobuf.options.(gogoproto.goproto_stringer)=false
  218. message ExtraValue {
  219. // items, if empty, will result in an empty slice
  220. repeated string items = 1;
  221. }