Skip to content

Commit e93788d

Browse files
serathiusk8s-publishing-bot
authored andcommitted
Add datapolicy tags to staging/src/k8s.io/client-go/
Kubernetes-commit: e29c568c4a9cd45d15665345aa015e21bcff52dd
1 parent 04f89d4 commit e93788d

File tree

14 files changed

+29
-29
lines changed

14 files changed

+29
-29
lines changed

pkg/apis/clientauthentication/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ type ExecCredentialStatus struct {
6666
ExpirationTimestamp *metav1.Time
6767
// Token is a bearer token used by the client for request authentication.
6868
// +optional
69-
Token string
69+
Token string `datapolicy:"token"`
7070
// PEM-encoded client TLS certificate.
7171
// +optional
7272
ClientCertificateData string
7373
// PEM-encoded client TLS private key.
7474
// +optional
75-
ClientKeyData string
75+
ClientKeyData string `datapolicy:"secret-key"`
7676
}
7777

7878
// Response defines metadata about a failed request, including HTTP status code and

pkg/apis/clientauthentication/v1alpha1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ type ExecCredentialStatus struct {
6161
// +optional
6262
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
6363
// Token is a bearer token used by the client for request authentication.
64-
Token string `json:"token,omitempty"`
64+
Token string `json:"token,omitempty" datapolicy:"token"`
6565
// PEM-encoded client TLS certificates (including intermediates, if any).
6666
ClientCertificateData string `json:"clientCertificateData,omitempty"`
6767
// PEM-encoded private key for the above certificate.
68-
ClientKeyData string `json:"clientKeyData,omitempty"`
68+
ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"`
6969
}
7070

7171
// Response defines metadata about a failed request, including HTTP status code and

pkg/apis/clientauthentication/v1beta1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ type ExecCredentialStatus struct {
5858
// +optional
5959
ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
6060
// Token is a bearer token used by the client for request authentication.
61-
Token string `json:"token,omitempty"`
61+
Token string `json:"token,omitempty" datapolicy:"token"`
6262
// PEM-encoded client TLS certificates (including intermediates, if any).
6363
ClientCertificateData string `json:"clientCertificateData,omitempty"`
6464
// PEM-encoded private key for the above certificate.
65-
ClientKeyData string `json:"clientKeyData,omitempty"`
65+
ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"`
6666
}
6767

6868
// Cluster contains information to allow an exec plugin to communicate

plugin/pkg/client/auth/exec/exec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ type Authenticator struct {
241241
}
242242

243243
type credentials struct {
244-
token string
245-
cert *tls.Certificate
244+
token string `datapolicy:"token"`
245+
cert *tls.Certificate `datapolicy:"secret-key"`
246246
}
247247

248248
// UpdateTransportConfig updates the transport.Config to use credentials

plugin/pkg/client/auth/gcp/gcp.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (g *gcpAuthProvider) Login() error { return nil }
188188
type cachedTokenSource struct {
189189
lk sync.Mutex
190190
source oauth2.TokenSource
191-
accessToken string
191+
accessToken string `datapolicy:"token"`
192192
expiry time.Time
193193
persister restclient.AuthProviderConfigPersister
194194
cache map[string]string
@@ -269,8 +269,8 @@ func (t *cachedTokenSource) baseCache() map[string]string {
269269
type commandTokenSource struct {
270270
cmd string
271271
args []string
272-
tokenKey string
273-
expiryKey string
272+
tokenKey string `datapolicy:"token"`
273+
expiryKey string `datapolicy:"secret-key"`
274274
timeFmt string
275275
}
276276

rest/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ type Config struct {
6565

6666
// Server requires Basic authentication
6767
Username string
68-
Password string
68+
Password string `datapolicy:"password"`
6969

7070
// Server requires Bearer authentication. This client will not attempt to use
7171
// refresh tokens for an OAuth2 flow.
7272
// TODO: demonstrate an OAuth2 compatible client.
73-
BearerToken string
73+
BearerToken string `datapolicy:"token"`
7474

7575
// Path to a file containing a BearerToken.
7676
// If set, the contents are periodically read.
@@ -231,7 +231,7 @@ type TLSClientConfig struct {
231231
CertData []byte
232232
// KeyData holds PEM-encoded bytes (typically read from a client certificate key file).
233233
// KeyData takes precedence over KeyFile
234-
KeyData []byte
234+
KeyData []byte `datapolicy:"security-key"`
235235
// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
236236
// CAData takes precedence over CAFile
237237
CAData []byte

tools/auth/clientauth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ import (
7575
// to be read/written from a file as a JSON object.
7676
type Info struct {
7777
User string
78-
Password string
78+
Password string `datapolicy:"password"`
7979
CAFile string
8080
CertFile string
8181
KeyFile string
82-
BearerToken string
82+
BearerToken string `datapolicy:"token"`
8383
Insecure *bool
8484
}
8585

tools/clientcmd/api/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ type AuthInfo struct {
114114
ClientKey string `json:"client-key,omitempty"`
115115
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
116116
// +optional
117-
ClientKeyData []byte `json:"client-key-data,omitempty"`
117+
ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"`
118118
// Token is the bearer token for authentication to the kubernetes cluster.
119119
// +optional
120-
Token string `json:"token,omitempty"`
120+
Token string `json:"token,omitempty" datapolicy:"token"`
121121
// 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.
122122
// +optional
123123
TokenFile string `json:"tokenFile,omitempty"`
@@ -135,7 +135,7 @@ type AuthInfo struct {
135135
Username string `json:"username,omitempty"`
136136
// Password is the password for basic authentication to the kubernetes cluster.
137137
// +optional
138-
Password string `json:"password,omitempty"`
138+
Password string `json:"password,omitempty" datapolicy:"password"`
139139
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
140140
// +optional
141141
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`

tools/clientcmd/api/v1/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ type AuthInfo struct {
104104
ClientKey string `json:"client-key,omitempty"`
105105
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
106106
// +optional
107-
ClientKeyData []byte `json:"client-key-data,omitempty"`
107+
ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"`
108108
// Token is the bearer token for authentication to the kubernetes cluster.
109109
// +optional
110-
Token string `json:"token,omitempty"`
110+
Token string `json:"token,omitempty" datapolicy:"token"`
111111
// 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.
112112
// +optional
113113
TokenFile string `json:"tokenFile,omitempty"`
@@ -125,7 +125,7 @@ type AuthInfo struct {
125125
Username string `json:"username,omitempty"`
126126
// Password is the password for basic authentication to the kubernetes cluster.
127127
// +optional
128-
Password string `json:"password,omitempty"`
128+
Password string `json:"password,omitempty" datapolicy:"password"`
129129
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
130130
// +optional
131131
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`

tools/clientcmd/client_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type PersistAuthProviderConfigForUser func(user string) restclient.AuthProviderC
7777

7878
type promptedCredentials struct {
7979
username string
80-
password string
80+
password string `datapolicy:"password"`
8181
}
8282

8383
// DirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information

transport/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type tlsCacheKey struct {
4444
insecure bool
4545
caData string
4646
certData string
47-
keyData string
47+
keyData string `datapolicy:"security-key"`
4848
certFile string
4949
keyFile string
5050
serverName string

transport/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ type Config struct {
3535

3636
// Username and password for basic authentication
3737
Username string
38-
Password string
38+
Password string `datapolicy:"password"`
3939

4040
// Bearer token for authentication
41-
BearerToken string
41+
BearerToken string `datapolicy:"token"`
4242

4343
// Path to a file containing a BearerToken.
4444
// If set, the contents are periodically read.

transport/round_trippers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper { retur
167167

168168
type basicAuthRoundTripper struct {
169169
username string
170-
password string
170+
password string `datapolicy:"password"`
171171
rt http.RoundTripper
172172
}
173173

@@ -305,7 +305,7 @@ func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { retu
305305

306306
// requestInfo keeps track of information about a request/response combination
307307
type requestInfo struct {
308-
RequestHeaders http.Header
308+
RequestHeaders http.Header `datapolicy:"token"`
309309
RequestVerb string
310310
RequestURL string
311311

util/certificate/certificate_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type Config struct {
114114
// This is intended to allow the first boot of a component to be
115115
// initialized using a generic, multi-use cert/key pair which will be
116116
// quickly replaced with a unique cert/key pair.
117-
BootstrapKeyPEM []byte
117+
BootstrapKeyPEM []byte `datapolicy:"security-key"`
118118
// CertificateRotation will record a metric showing the time in seconds
119119
// that certificates lived before being rotated. This metric is a histogram
120120
// because there is value in keeping a history of rotation cadences. It

0 commit comments

Comments
 (0)