2 Copyright 2018 The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
17 package clientauthentication
20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25 // ExecCredentials is used by exec-based plugins to communicate credentials to
27 type ExecCredential struct {
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
34 // Status is filled in by the plugin and holds the credentials that the transport
35 // should use to contact the API.
37 Status *ExecCredentialStatus
40 // ExecCredenitalSpec holds request and runtime specific information provided by
42 type ExecCredentialSpec struct {
43 // Response is populated when the transport encounters HTTP status codes, such as 401,
44 // suggesting previous credentials were invalid.
48 // Interactive is true when the transport detects the command is being called from an
49 // interactive prompt.
54 // ExecCredentialStatus holds credentials for the transport to use.
55 type ExecCredentialStatus struct {
56 // ExpirationTimestamp indicates a time when the provided credentials expire.
58 ExpirationTimestamp *metav1.Time
59 // Token is a bearer token used by the client for request authentication.
62 // PEM-encoded client TLS certificate.
64 ClientCertificateData string
65 // PEM-encoded client TLS private key.
70 // Response defines metadata about a failed request, including HTTP status code and
72 type Response struct {
73 // Headers holds HTTP headers returned by the server.
74 Header map[string][]string
75 // Code is the HTTP status code returned by the server.