mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-26 23:17:34 +00:00
Add datapolicy tags to staging/src/k8s.io/client-go/
Kubernetes-commit: e29c568c4a9cd45d15665345aa015e21bcff52dd
This commit is contained in:
parent
04f89d4efe
commit
e93788d387
@ -66,13 +66,13 @@ type ExecCredentialStatus struct {
|
|||||||
ExpirationTimestamp *metav1.Time
|
ExpirationTimestamp *metav1.Time
|
||||||
// Token is a bearer token used by the client for request authentication.
|
// Token is a bearer token used by the client for request authentication.
|
||||||
// +optional
|
// +optional
|
||||||
Token string
|
Token string `datapolicy:"token"`
|
||||||
// PEM-encoded client TLS certificate.
|
// PEM-encoded client TLS certificate.
|
||||||
// +optional
|
// +optional
|
||||||
ClientCertificateData string
|
ClientCertificateData string
|
||||||
// PEM-encoded client TLS private key.
|
// PEM-encoded client TLS private key.
|
||||||
// +optional
|
// +optional
|
||||||
ClientKeyData string
|
ClientKeyData string `datapolicy:"secret-key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response defines metadata about a failed request, including HTTP status code and
|
// Response defines metadata about a failed request, including HTTP status code and
|
||||||
|
@ -61,11 +61,11 @@ type ExecCredentialStatus struct {
|
|||||||
// +optional
|
// +optional
|
||||||
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
|
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
|
||||||
// Token is a bearer token used by the client for request authentication.
|
// Token is a bearer token used by the client for request authentication.
|
||||||
Token string `json:"token,omitempty"`
|
Token string `json:"token,omitempty" datapolicy:"token"`
|
||||||
// PEM-encoded client TLS certificates (including intermediates, if any).
|
// PEM-encoded client TLS certificates (including intermediates, if any).
|
||||||
ClientCertificateData string `json:"clientCertificateData,omitempty"`
|
ClientCertificateData string `json:"clientCertificateData,omitempty"`
|
||||||
// PEM-encoded private key for the above certificate.
|
// PEM-encoded private key for the above certificate.
|
||||||
ClientKeyData string `json:"clientKeyData,omitempty"`
|
ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response defines metadata about a failed request, including HTTP status code and
|
// Response defines metadata about a failed request, including HTTP status code and
|
||||||
|
@ -58,11 +58,11 @@ type ExecCredentialStatus struct {
|
|||||||
// +optional
|
// +optional
|
||||||
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
|
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
|
||||||
// Token is a bearer token used by the client for request authentication.
|
// Token is a bearer token used by the client for request authentication.
|
||||||
Token string `json:"token,omitempty"`
|
Token string `json:"token,omitempty" datapolicy:"token"`
|
||||||
// PEM-encoded client TLS certificates (including intermediates, if any).
|
// PEM-encoded client TLS certificates (including intermediates, if any).
|
||||||
ClientCertificateData string `json:"clientCertificateData,omitempty"`
|
ClientCertificateData string `json:"clientCertificateData,omitempty"`
|
||||||
// PEM-encoded private key for the above certificate.
|
// PEM-encoded private key for the above certificate.
|
||||||
ClientKeyData string `json:"clientKeyData,omitempty"`
|
ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cluster contains information to allow an exec plugin to communicate
|
// Cluster contains information to allow an exec plugin to communicate
|
||||||
|
@ -241,8 +241,8 @@ type Authenticator struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type credentials struct {
|
type credentials struct {
|
||||||
token string
|
token string `datapolicy:"token"`
|
||||||
cert *tls.Certificate
|
cert *tls.Certificate `datapolicy:"secret-key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTransportConfig updates the transport.Config to use credentials
|
// UpdateTransportConfig updates the transport.Config to use credentials
|
||||||
|
@ -188,7 +188,7 @@ func (g *gcpAuthProvider) Login() error { return nil }
|
|||||||
type cachedTokenSource struct {
|
type cachedTokenSource struct {
|
||||||
lk sync.Mutex
|
lk sync.Mutex
|
||||||
source oauth2.TokenSource
|
source oauth2.TokenSource
|
||||||
accessToken string
|
accessToken string `datapolicy:"token"`
|
||||||
expiry time.Time
|
expiry time.Time
|
||||||
persister restclient.AuthProviderConfigPersister
|
persister restclient.AuthProviderConfigPersister
|
||||||
cache map[string]string
|
cache map[string]string
|
||||||
@ -269,8 +269,8 @@ func (t *cachedTokenSource) baseCache() map[string]string {
|
|||||||
type commandTokenSource struct {
|
type commandTokenSource struct {
|
||||||
cmd string
|
cmd string
|
||||||
args []string
|
args []string
|
||||||
tokenKey string
|
tokenKey string `datapolicy:"token"`
|
||||||
expiryKey string
|
expiryKey string `datapolicy:"secret-key"`
|
||||||
timeFmt string
|
timeFmt string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@ type Config struct {
|
|||||||
|
|
||||||
// Server requires Basic authentication
|
// Server requires Basic authentication
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string `datapolicy:"password"`
|
||||||
|
|
||||||
// Server requires Bearer authentication. This client will not attempt to use
|
// Server requires Bearer authentication. This client will not attempt to use
|
||||||
// refresh tokens for an OAuth2 flow.
|
// refresh tokens for an OAuth2 flow.
|
||||||
// TODO: demonstrate an OAuth2 compatible client.
|
// TODO: demonstrate an OAuth2 compatible client.
|
||||||
BearerToken string
|
BearerToken string `datapolicy:"token"`
|
||||||
|
|
||||||
// Path to a file containing a BearerToken.
|
// Path to a file containing a BearerToken.
|
||||||
// If set, the contents are periodically read.
|
// If set, the contents are periodically read.
|
||||||
@ -231,7 +231,7 @@ type TLSClientConfig struct {
|
|||||||
CertData []byte
|
CertData []byte
|
||||||
// KeyData holds PEM-encoded bytes (typically read from a client certificate key file).
|
// KeyData holds PEM-encoded bytes (typically read from a client certificate key file).
|
||||||
// KeyData takes precedence over KeyFile
|
// KeyData takes precedence over KeyFile
|
||||||
KeyData []byte
|
KeyData []byte `datapolicy:"security-key"`
|
||||||
// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
|
// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
|
||||||
// CAData takes precedence over CAFile
|
// CAData takes precedence over CAFile
|
||||||
CAData []byte
|
CAData []byte
|
||||||
|
@ -75,11 +75,11 @@ import (
|
|||||||
// to be read/written from a file as a JSON object.
|
// to be read/written from a file as a JSON object.
|
||||||
type Info struct {
|
type Info struct {
|
||||||
User string
|
User string
|
||||||
Password string
|
Password string `datapolicy:"password"`
|
||||||
CAFile string
|
CAFile string
|
||||||
CertFile string
|
CertFile string
|
||||||
KeyFile string
|
KeyFile string
|
||||||
BearerToken string
|
BearerToken string `datapolicy:"token"`
|
||||||
Insecure *bool
|
Insecure *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,10 +114,10 @@ type AuthInfo struct {
|
|||||||
ClientKey string `json:"client-key,omitempty"`
|
ClientKey string `json:"client-key,omitempty"`
|
||||||
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
|
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
|
||||||
// +optional
|
// +optional
|
||||||
ClientKeyData []byte `json:"client-key-data,omitempty"`
|
ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"`
|
||||||
// Token is the bearer token for authentication to the kubernetes cluster.
|
// Token is the bearer token for authentication to the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
Token string `json:"token,omitempty"`
|
Token string `json:"token,omitempty" datapolicy:"token"`
|
||||||
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
|
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
|
||||||
// +optional
|
// +optional
|
||||||
TokenFile string `json:"tokenFile,omitempty"`
|
TokenFile string `json:"tokenFile,omitempty"`
|
||||||
@ -135,7 +135,7 @@ type AuthInfo struct {
|
|||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
// Password is the password for basic authentication to the kubernetes cluster.
|
// Password is the password for basic authentication to the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
Password string `json:"password,omitempty"`
|
Password string `json:"password,omitempty" datapolicy:"password"`
|
||||||
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
|
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
|
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
|
||||||
|
@ -104,10 +104,10 @@ type AuthInfo struct {
|
|||||||
ClientKey string `json:"client-key,omitempty"`
|
ClientKey string `json:"client-key,omitempty"`
|
||||||
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
|
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
|
||||||
// +optional
|
// +optional
|
||||||
ClientKeyData []byte `json:"client-key-data,omitempty"`
|
ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"`
|
||||||
// Token is the bearer token for authentication to the kubernetes cluster.
|
// Token is the bearer token for authentication to the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
Token string `json:"token,omitempty"`
|
Token string `json:"token,omitempty" datapolicy:"token"`
|
||||||
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
|
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
|
||||||
// +optional
|
// +optional
|
||||||
TokenFile string `json:"tokenFile,omitempty"`
|
TokenFile string `json:"tokenFile,omitempty"`
|
||||||
@ -125,7 +125,7 @@ type AuthInfo struct {
|
|||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
// Password is the password for basic authentication to the kubernetes cluster.
|
// Password is the password for basic authentication to the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
Password string `json:"password,omitempty"`
|
Password string `json:"password,omitempty" datapolicy:"password"`
|
||||||
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
|
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
|
||||||
// +optional
|
// +optional
|
||||||
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
|
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
|
||||||
|
@ -77,7 +77,7 @@ type PersistAuthProviderConfigForUser func(user string) restclient.AuthProviderC
|
|||||||
|
|
||||||
type promptedCredentials struct {
|
type promptedCredentials struct {
|
||||||
username string
|
username string
|
||||||
password string
|
password string `datapolicy:"password"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information
|
// DirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information
|
||||||
|
@ -44,7 +44,7 @@ type tlsCacheKey struct {
|
|||||||
insecure bool
|
insecure bool
|
||||||
caData string
|
caData string
|
||||||
certData string
|
certData string
|
||||||
keyData string
|
keyData string `datapolicy:"security-key"`
|
||||||
certFile string
|
certFile string
|
||||||
keyFile string
|
keyFile string
|
||||||
serverName string
|
serverName string
|
||||||
|
@ -35,10 +35,10 @@ type Config struct {
|
|||||||
|
|
||||||
// Username and password for basic authentication
|
// Username and password for basic authentication
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string `datapolicy:"password"`
|
||||||
|
|
||||||
// Bearer token for authentication
|
// Bearer token for authentication
|
||||||
BearerToken string
|
BearerToken string `datapolicy:"token"`
|
||||||
|
|
||||||
// Path to a file containing a BearerToken.
|
// Path to a file containing a BearerToken.
|
||||||
// If set, the contents are periodically read.
|
// If set, the contents are periodically read.
|
||||||
|
@ -167,7 +167,7 @@ func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper { retur
|
|||||||
|
|
||||||
type basicAuthRoundTripper struct {
|
type basicAuthRoundTripper struct {
|
||||||
username string
|
username string
|
||||||
password string
|
password string `datapolicy:"password"`
|
||||||
rt http.RoundTripper
|
rt http.RoundTripper
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { retu
|
|||||||
|
|
||||||
// requestInfo keeps track of information about a request/response combination
|
// requestInfo keeps track of information about a request/response combination
|
||||||
type requestInfo struct {
|
type requestInfo struct {
|
||||||
RequestHeaders http.Header
|
RequestHeaders http.Header `datapolicy:"token"`
|
||||||
RequestVerb string
|
RequestVerb string
|
||||||
RequestURL string
|
RequestURL string
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ type Config struct {
|
|||||||
// This is intended to allow the first boot of a component to be
|
// This is intended to allow the first boot of a component to be
|
||||||
// initialized using a generic, multi-use cert/key pair which will be
|
// initialized using a generic, multi-use cert/key pair which will be
|
||||||
// quickly replaced with a unique cert/key pair.
|
// quickly replaced with a unique cert/key pair.
|
||||||
BootstrapKeyPEM []byte
|
BootstrapKeyPEM []byte `datapolicy:"security-key"`
|
||||||
// CertificateRotation will record a metric showing the time in seconds
|
// CertificateRotation will record a metric showing the time in seconds
|
||||||
// that certificates lived before being rotated. This metric is a histogram
|
// that certificates lived before being rotated. This metric is a histogram
|
||||||
// because there is value in keeping a history of rotation cadences. It
|
// because there is value in keeping a history of rotation cadences. It
|
||||||
|
Loading…
Reference in New Issue
Block a user