blob: d6e267452e9134365943482a31e934077a1ac1c2 [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
2Copyright 2018 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
17package v1beta1
18
19import (
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.
27type 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.
42type 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.
49type 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}