generated.proto 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.authentication.v1;
  16. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  19. // Package-wide variables from generator "generated".
  20. option go_package = "v1";
  21. // BoundObjectReference is a reference to an object that a token is bound to.
  22. message BoundObjectReference {
  23. // Kind of the referent. Valid kinds are 'Pod' and 'Secret'.
  24. // +optional
  25. optional string kind = 1;
  26. // API version of the referent.
  27. // +optional
  28. optional string aPIVersion = 2;
  29. // Name of the referent.
  30. // +optional
  31. optional string name = 3;
  32. // UID of the referent.
  33. // +optional
  34. optional string uID = 4;
  35. }
  36. // ExtraValue masks the value so protobuf can generate
  37. // +protobuf.nullable=true
  38. // +protobuf.options.(gogoproto.goproto_stringer)=false
  39. message ExtraValue {
  40. // items, if empty, will result in an empty slice
  41. repeated string items = 1;
  42. }
  43. // TokenRequest requests a token for a given service account.
  44. message TokenRequest {
  45. // +optional
  46. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  47. optional TokenRequestSpec spec = 2;
  48. // +optional
  49. optional TokenRequestStatus status = 3;
  50. }
  51. // TokenRequestSpec contains client provided parameters of a token request.
  52. message TokenRequestSpec {
  53. // Audiences are the intendend audiences of the token. A recipient of a
  54. // token must identitfy themself with an identifier in the list of
  55. // audiences of the token, and otherwise should reject the token. A
  56. // token issued for multiple audiences may be used to authenticate
  57. // against any of the audiences listed but implies a high degree of
  58. // trust between the target audiences.
  59. repeated string audiences = 1;
  60. // ExpirationSeconds is the requested duration of validity of the request. The
  61. // token issuer may return a token with a different validity duration so a
  62. // client needs to check the 'expiration' field in a response.
  63. // +optional
  64. optional int64 expirationSeconds = 4;
  65. // BoundObjectRef is a reference to an object that the token will be bound to.
  66. // The token will only be valid for as long as the bound object exists.
  67. // NOTE: The API server's TokenReview endpoint will validate the
  68. // BoundObjectRef, but other audiences may not. Keep ExpirationSeconds
  69. // small if you want prompt revocation.
  70. // +optional
  71. optional BoundObjectReference boundObjectRef = 3;
  72. }
  73. // TokenRequestStatus is the result of a token request.
  74. message TokenRequestStatus {
  75. // Token is the opaque bearer token.
  76. optional string token = 1;
  77. // ExpirationTimestamp is the time of expiration of the returned token.
  78. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2;
  79. }
  80. // TokenReview attempts to authenticate a token to a known user.
  81. // Note: TokenReview requests may be cached by the webhook token authenticator
  82. // plugin in the kube-apiserver.
  83. message TokenReview {
  84. // +optional
  85. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  86. // Spec holds information about the request being evaluated
  87. optional TokenReviewSpec spec = 2;
  88. // Status is filled in by the server and indicates whether the request can be authenticated.
  89. // +optional
  90. optional TokenReviewStatus status = 3;
  91. }
  92. // TokenReviewSpec is a description of the token authentication request.
  93. message TokenReviewSpec {
  94. // Token is the opaque bearer token.
  95. // +optional
  96. optional string token = 1;
  97. // Audiences is a list of the identifiers that the resource server presented
  98. // with the token identifies as. Audience-aware token authenticators will
  99. // verify that the token was intended for at least one of the audiences in
  100. // this list. If no audiences are provided, the audience will default to the
  101. // audience of the Kubernetes apiserver.
  102. // +optional
  103. repeated string audiences = 2;
  104. }
  105. // TokenReviewStatus is the result of the token authentication request.
  106. message TokenReviewStatus {
  107. // Authenticated indicates that the token was associated with a known user.
  108. // +optional
  109. optional bool authenticated = 1;
  110. // User is the UserInfo associated with the provided token.
  111. // +optional
  112. optional UserInfo user = 2;
  113. // Audiences are audience identifiers chosen by the authenticator that are
  114. // compatible with both the TokenReview and token. An identifier is any
  115. // identifier in the intersection of the TokenReviewSpec audiences and the
  116. // token's audiences. A client of the TokenReview API that sets the
  117. // spec.audiences field should validate that a compatible audience identifier
  118. // is returned in the status.audiences field to ensure that the TokenReview
  119. // server is audience aware. If a TokenReview returns an empty
  120. // status.audience field where status.authenticated is "true", the token is
  121. // valid against the audience of the Kubernetes API server.
  122. // +optional
  123. repeated string audiences = 4;
  124. // Error indicates that the token couldn't be checked
  125. // +optional
  126. optional string error = 3;
  127. }
  128. // UserInfo holds the information about the user needed to implement the
  129. // user.Info interface.
  130. message UserInfo {
  131. // The name that uniquely identifies this user among all active users.
  132. // +optional
  133. optional string username = 1;
  134. // A unique value that identifies this user across time. If this user is
  135. // deleted and another user by the same name is added, they will have
  136. // different UIDs.
  137. // +optional
  138. optional string uid = 2;
  139. // The names of groups this user is a part of.
  140. // +optional
  141. repeated string groups = 3;
  142. // Any additional information provided by the authenticator.
  143. // +optional
  144. map<string, ExtraValue> extra = 4;
  145. }