114 Commits

Author SHA1 Message Date
Weinong Wang
5494d16ef1 Revert "It fixes a bug where AAD token obtained by kubectl is incompatible with on-behalf-of flow and oidc."
This reverts commit d1480ab49d603d0a95e509b627252ee7af8559ae.

Revert this commit due to incomplete migration path

Kubernetes-commit: 71b2a4cdcc18694387961d119c6ab71772579918
2020-01-23 14:21:33 -08:00
Weinong Wang
b6e5d4b890 It fixes a bug where AAD token obtained by kubectl is incompatible with on-behalf-of flow and oidc.
Kubernetes-commit: d1480ab49d603d0a95e509b627252ee7af8559ae
2019-12-18 20:21:21 -08:00
Monis Khan
98b61416aa kubectl oidc auth-provider: include cluster address in cache key
This change includes the cluster address in the cache key so that
using the same issuer and client ID with different tokens across
multiple clusters does not result in the wrong token being used for
authentication.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 96fe76a9ed4fde16f449995cc698dca3719ed546
2019-12-06 20:26:25 -05:00
Samuel Davidson
41735bf478 Changed Kubelet client and serving cert TTL/Expiry certs to use gaugefunc for calculating time remaining.
Kubernetes-commit: aba0b315269dab469694af7fca879438a7f87e41
2019-12-03 16:01:56 -08:00
Samuel Davidson
775f4ddf38 Added rest client metrics for client TTL and rot. (#84382)
* Added rest client metrics for client TTL and rot.

* Fixed foo bar comment, added nil checks

* Moved rotation observation inside of old cert nil check block

* Fixed rotation age logic.

* fixed BUILD for exec plugin package

* fixed null pointer dereference in exec.go

* Updated metric name, bucket, used oldest cert.

Kubernetes-commit: 9dcb3bfcff2024e4690d70262cad14668b1f2507
2019-11-22 17:29:30 -08:00
danielqsj
0dd469e42b Fix data race in client-go UpdateTransportConfig
Kubernetes-commit: 7518a44b18d8b225a9572f1e0c902776eb4a6eb0
2019-07-18 12:46:03 +08:00
clarklee92
d3a5e5f798 Modify the status code number to HTTP status semantics
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>

Kubernetes-commit: f86f5ee14ef3c8adf9855ce16dcc57beca949719
2019-11-06 00:45:35 +08:00
Xiang Dai
879ff4004d delete all duplicate empty blanks
Signed-off-by: Xiang Dai <764524258@qq.com>

Kubernetes-commit: 36065c6dd717c14e0a90131041e20345a7e5e324
2019-02-22 09:43:51 +08:00
Roy Lenferink
94093d2527 Updated OWNERS files to include link to docs
Kubernetes-commit: b43c04452f3b563473b5c2a765d4ac18cc0ff58f
2019-01-30 20:05:00 +01:00
Andrew Lytvynov
420f3f77fb Implement fmt.Stringer on rest.Config to sanitize sensitive fields
It's very easy to add glog.Info(config) calls for debugging (or actual
logging). In some scenarios those configs will carry sensitive tokens
and those tokens will end up in logs or response bodies.
Leaking of those stringified configs compromises the cluster.

Also implement fmt.GoStringer.

Kubernetes-commit: c9ad1d7339b164dfba0846ec49fa4a52474d3e23
2018-11-02 11:39:14 -07:00
Clayton Coleman
615e8e2492 Make wrapping a client transport more pleasant
Properly wrapping a transport can be tricky. Make the normal case
(adding a non-nil transport wrapper to a config) easier with a helper.
Also enforce a rough ordering, which in the future we can use to
simplify the WrapTransport mechanism down into an array of functions
we execute in order and avoid wrapping altogether.

Kubernetes-commit: 1f590e697ef64812620c787720b4b5942027e4a1
2018-12-27 11:47:50 -05:00
Dong Liu
ba28f5cc8e Fix aad support in kubectl for sovereign cloud
Kubernetes-commit: 092f3988255801ce7a97de5448384c50c400a3a4
2018-12-18 13:50:56 +08:00
Davanum Srinivas
74cd8bbeee Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Jordan Liggitt
970a002e5e authenticators subproject approvers/reviewers
Kubernetes-commit: 4fa2a0cc8a86a5d322e52c43eb7d5ffe36b7887f
2018-11-02 13:36:47 -04:00
andyzhangx
68a445f5cb add ultrassd support
update stagin Godeps.json

update godeps license

fix test failure

fix comments

Kubernetes-commit: f1bd292c764e5dac507c5d5ca52784b5d3c04c4d
2018-10-31 09:27:45 +00:00
andyzhangx
af076e5342 upgrade azure sdk to support ultra ssd
update Godeps.json

update azure sdk for ultrassd support

update bazel

fix build failure

Kubernetes-commit: d210b4bcf350308f51d8bffb7748b2cc3fb611c0
2018-10-29 08:03:22 +00:00
Jeff Lowdermilk
b345654764 gcp client auth plugin: persist default cache on unauthorized
The default cache for a cachedTokenSource is not always empty. In the
case of commandTokenSource, it contains calling details for the
external command that is used to generate refresh tokens. Persisting
a completely empty cache will thus break ability for the plugin to
obtain refresh tokens. This changes the roundtripper to persist
the default cache instead of assuming an empty map.

Kubernetes-commit: 73e5e43711043c6a80d41b1be080b3b2d3dfbacb
2018-07-17 14:06:11 -07:00
Andrew Lytvynov
dd5f11e1e6 Set connrotation dialer via restclient.Config.Dialer
Instead of Transport. This fixes ExecPlugin, which fails if
restclient.Config.Transport is set.

Kubernetes-commit: 3357b5ecf42db9bcf6e54c9d2b6712cfbae077bf
2018-07-25 16:22:32 -07:00
Mikhail Mazurskiy
b045806917 Add missing error handling in schema-related code
Kubernetes-commit: bfe313d5f351dfae086a85a97e7103183173e5b5
2018-06-03 14:59:58 +10:00
Eric Chiang
c61cf26da4 client-go: promote exec plugin support to beta
Kubernetes-commit: 0a9164e73aedd898a535a64fcc992d3e50002d61
2018-05-31 14:28:27 -07:00
Davanum Srinivas
edd1069068 Deprecate the in-tree keystone plugin
We now have the `client-keystone-auth` in cloud-provider-openstack
repository:
https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-client-keystone-auth.md

So let's drop the in-tree one, so we can remove it in 1.12

Kubernetes-commit: ffe817fcababca46d4989ff3982807468645d2ea
2018-05-25 15:55:49 -07:00
Andrew Lytvynov
c669580288 Add TLS support to exec authenticator plugin
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/kubectl-exec-plugins.md#tls-client-certificate-support

Allows exec plugin to return raw TLS key/cert data. This data populates
transport.Config.TLS fields.
transport.Config.TLS propagates custom credentials using
tls.Config.GetClientCertificate callback.
On key/cert rotation, all connections using old credentials are
closed

Kubernetes-commit: cd89f9473faa60c15b8e9d223e5c4f9dab53627a
2018-05-30 14:03:32 -07:00
root
baacc24498 fix persist typo
Kubernetes-commit: 284d08bf7032a94b568a95d6de1e13d8c0ac5bc2
2018-02-28 19:11:35 +08:00
Wang Guoliang
d90294e8f9 should use time.Since instead of time.Now().Sub
Kubernetes-commit: 89669283fe84619f0c15af8495ccb28a752bb1e8
2018-02-11 21:17:00 +08:00
Di Xu
a258223ae4 read openstack auth config from client config
Kubernetes-commit: 10201f3f2ae1841cb1a68ea420c94bf018ae6b24
2018-02-22 18:05:24 +08:00
Pengfei Ni
e6f1c09a62 Update vendors for client-go
Kubernetes-commit: 058b619040c469dcbe5d92bdaa8da975d23f141d
2018-04-24 14:42:06 +08:00
Puja
dcdb23334e Updated Readme for Azure (OIDC) auth provider
Includes:
* Added details and clarifications based on my experience
* Some minor copy editing

added note about resulting username

fixing last list item

clarficiation of resulting username

mainly just refering to OIDC docs

fixed comment about callback URL

Kubernetes-commit: 2709a7ee0d7d25463c9da00890a7b7db3e4419d1
2018-01-24 15:34:03 +01:00
hzxuzhonghu
1e55c20903 Replace "golang.org/x/net/context" with "context"
Kubernetes-commit: 70e45eccf27726f0e63dd1024924ccc7e2cd35a0
2018-02-28 12:20:22 +08:00
Kubernetes Publisher
fff8c3d73e sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-15 09:19:38 +00:00
Eric Chiang
606eb1e931 oidc: add rithujohn191 as a reviewer
Kubernetes-commit: 3561f23128a35a53256e541776eea1a7c3437c11
2018-03-05 10:44:33 -08:00
Eric Chiang
29c5d6f1b6 generated
Kubernetes-commit: 01801ae13a86c10cd343c329f5224ab47272f826
2018-02-07 15:48:46 -08:00
Eric Chiang
19c591bac2 client-go: add an exec-based client auth provider
Kubernetes-commit: 6463e9efd9ba552e60d2555a3e6526ef90196473
2018-02-07 15:43:12 -08:00
Eric Chiang
7776bd547a bump(github.com/coreos/go-oidc): 065b426bd41667456c1a924468f507673629c46b
Kubernetes-commit: 379af0405c318de9a009e339ee03a1d8ab0cde2f
2018-01-19 11:18:27 -08:00
Eric Chiang
9c19758757 oidc authentication: generate testdata and delete old test packages
Kubernetes-commit: 2d8cb9c4ad9a792ccfe5066f55e725ca50c77330
2018-01-19 11:15:38 -08:00
Jeff Grafton
fca8bb2928 Autogenerated: hack/update-bazel.sh
Kubernetes-commit: ef56a8d6bb3800ab7803713eafc4191e8202ad6e
2018-02-16 13:43:01 -08:00
Di Xu
d39d12f4b0 fix all the typos across the project
Kubernetes-commit: 48388fec7eaad4ac8d84fbe20673ffacf41964a1
2018-02-09 14:53:53 +08:00
Ahmet Alp Balkan
7f749abb08 Refactor gcp.go methods for testability, add tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: ad4fdc7d150a26e7b4df5bdbc7e9b45570cf78c9
2018-01-22 11:21:17 -08:00
Ahmet Alp Balkan
35fc4e77b2 configurable scopes for gcp default credentials
- add config.scopes field comma-separated scope URLs, to be used with Google
  Application Default Credentials (i.e. GOOGLE_APPLICATION_CREDENTIALS env)
- default scopes now include userinfo.email scope so the headless app with
  gserviceaccount keys can have RoleBindings with email instead of account ID.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: e19dc6a86830107bcb7a4a50c997bc8a396277b1
2017-12-19 00:14:57 -08:00
Jeff Grafton
fe985a55a2 Autogenerate BUILD files
Kubernetes-commit: efee0704c60a2ee3049268a41535aaee7f661f6c
2017-12-23 13:06:26 -08:00
Ahmet Alp Balkan
5ed3cd03be auth/gcp: capture stderr from gcloud config-helper
Fixes https://github.com/kubernetes/client-go/issues/327

Currently we're not capturing stderr when shelling out to "gcloud config
config-helper --format=json" fails. This patch is capturing the stderr in the
error message returned.

This gcloud command sometimes returns an upgrade reminder (in stderr) so using
`cmd.CombinedOutput()` is not an option here. Maybe we should also add an unit
test in gcp_test.go capturing this situation, too, in case someone decides to
replace this with CombinedOutput someday.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: 1334523c73fea3b3d9d0e90f287b3e385c79e6cd
2017-11-15 21:45:09 -08:00
Jeff Grafton
c92755ea3b update BUILD files
Kubernetes-commit: aee5f457dbfd70c2d15c33e392dce6a3ca710116
2017-10-12 13:52:10 -07:00
Eric Chiang
0b1f8b0d85 oidc client auth: better error when refresh response is missing id_token
Kubernetes-commit: a8914b73a12583c29bdee333528a55a5b3e5db1f
2017-09-25 09:57:16 -07:00
Antoine Pelisse
fc47db2e7e client-go: Update RoundTrippers to be Unwrappable
Kubernetes-commit: fd5775c192fb4d47250a2d99f3e022acb1c7c0f0
2017-09-01 16:18:59 +00:00
Jeff Grafton
5da217e5c4 Use buildozer to delete licenses() rules except under third_party/
Kubernetes-commit: a7f49c906df816123e7d4ccbd4cebab411519465
2017-08-29 12:51:55 +00:00
Jeff Grafton
fa2ceb7462 Use buildozer to remove deprecated automanaged tags
Kubernetes-commit: 33276f06be5e872bf53ca62a095fcf0a6b6c11a8
2017-08-29 12:51:55 +00:00
zhouhaibing089
eb8ca254db plugin/pkg/client/auth: add openstack auth provider
Kubernetes-commit: a0cebcb559c5c0ab8a2e50b1ee11cc62f9ebb3a8
2017-08-29 12:50:53 +00:00
Jeff Grafton
f921a73942 Run hack/update-bazel.sh to generate BUILD files
Kubernetes-commit: 3579017b865ddbc5449d6bba87346f086e4b93ff
2017-08-29 12:50:17 +00:00
huangjiuyuan
5b4fc26020 fix missing verb at end of format string
Kubernetes-commit: c85d29f5fa3192936ce88b13b79daa43c98203ab
2017-08-01 23:46:53 +00:00
Brendan Burns
757f27a376 Code updates for new SDK.
Kubernetes-commit: 29a0c6f56a0839d6abb9b5d1e339ab84cbbe2a83
2017-07-16 03:58:42 +00:00
Matt Tyler
cc9ad31a2a Clear auth config when gcp credentials fail
Specific use case is when utilizing multiple
gcp accounts, the user may provide credentials
for the wrong account.

This change ensures the incorrect credentials
are not cached in auth config, and logs an
appropriate message.

Kubernetes-commit: b92016769e30c541479e81d40dd3584e2f5aa822
2017-06-22 03:53:47 +00:00