Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2018 The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package v1beta1 |
| 18 | |
| 19 | import ( |
| 20 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | ) |
| 22 | |
| 23 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 24 | |
| 25 | // ExecCredentials is used by exec-based plugins to communicate credentials to |
| 26 | // HTTP transports. |
| 27 | type ExecCredential struct { |
| 28 | metav1.TypeMeta `json:",inline"` |
| 29 | |
| 30 | // Spec holds information passed to the plugin by the transport. This contains |
| 31 | // request and runtime specific information, such as if the session is interactive. |
| 32 | Spec ExecCredentialSpec `json:"spec,omitempty"` |
| 33 | |
| 34 | // Status is filled in by the plugin and holds the credentials that the transport |
| 35 | // should use to contact the API. |
| 36 | // +optional |
| 37 | Status *ExecCredentialStatus `json:"status,omitempty"` |
| 38 | } |
| 39 | |
| 40 | // ExecCredenitalSpec holds request and runtime specific information provided by |
| 41 | // the transport. |
| 42 | type ExecCredentialSpec struct{} |
| 43 | |
| 44 | // ExecCredentialStatus holds credentials for the transport to use. |
| 45 | // |
| 46 | // Token and ClientKeyData are sensitive fields. This data should only be |
| 47 | // transmitted in-memory between client and exec plugin process. Exec plugin |
| 48 | // itself should at least be protected via file permissions. |
| 49 | type ExecCredentialStatus struct { |
| 50 | // ExpirationTimestamp indicates a time when the provided credentials expire. |
| 51 | // +optional |
| 52 | ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"` |
| 53 | // Token is a bearer token used by the client for request authentication. |
| 54 | Token string `json:"token,omitempty"` |
| 55 | // PEM-encoded client TLS certificates (including intermediates, if any). |
| 56 | ClientCertificateData string `json:"clientCertificateData,omitempty"` |
| 57 | // PEM-encoded private key for the above certificate. |
| 58 | ClientKeyData string `json:"clientKeyData,omitempty"` |
| 59 | } |