Compare commits

...

1628 Commits

Author SHA1 Message Date
Ryan Richard
174b3026c7 Merge pull request #2831 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m0s
CodeQL / Analyze (javascript) (push) Failing after 1m12s
Bump dependencies
2026-01-06 11:59:37 -08:00
Pinny
e009d22900 Bump dependencies 2026-01-06 14:08:37 +00:00
Ryan Richard
4b7fbc144e Merge pull request #2827 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m31s
CodeQL / Analyze (javascript) (push) Failing after 1m9s
Bump dependencies
2026-01-05 11:24:49 -08:00
Pinny
98621c76b5 Bump dependencies 2026-01-05 14:01:53 +00:00
Ryan Richard
6d8aed7f40 Merge pull request #2823 from vmware/pinny/update-version-and-cli-docs
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m45s
CodeQL / Analyze (javascript) (push) Failing after 1m17s
Update version and CLI docs on website
2025-12-24 09:36:53 -08:00
Pinny
3031a070d1 Update version and CLI docs on website 2025-12-24 01:28:35 +00:00
Ryan Richard
ff71d7e768 Merge pull request #2821 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m48s
CodeQL / Analyze (javascript) (push) Failing after 1m8s
Bump dependencies
2025-12-23 13:01:05 -08:00
Pinny
a82e32057a Bump dependencies 2025-12-23 18:31:42 +00:00
Ryan Richard
d99563c85c Merge pull request #2812 from vmware/kube_1.35
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m54s
CodeQL / Analyze (javascript) (push) Failing after 1m12s
bump deps to kube 1.35
2025-12-22 13:19:54 -08:00
Ryan Richard
54d530784d upgrade to golangci-lint v2.7.2, bring back some nolint directives 2025-12-22 11:03:46 -08:00
Ryan Richard
44509d016e standardize import of "k8s.io/client-go/kubernetes/fake" 2025-12-22 10:34:53 -08:00
Ryan Richard
3c4c272607 rerun codegen to get model names in openapi generated code 2025-12-19 15:16:03 -08:00
Ryan Richard
cbce243d57 generate model names via gen_openapi to fix 'kubectl explain'
Also fixes some kubectl client-side validation errors, which also uses
the generated openapi docs served by Pinniped.
2025-12-19 15:15:14 -08:00
Ryan Richard
b04ae898ca update integration test expectations for k8s 1.35 libs 2025-12-19 13:57:12 -08:00
Ryan Richard
bc88faa50d upgrade dep to github.com/google/go-github/v76 from v75 2025-12-19 12:08:02 -08:00
Ryan Richard
f703d096d6 update deps again to get new k8s.io/utils 2025-12-19 12:04:02 -08:00
Ryan Richard
9d1c65c3e6 fix deprecation of NewSimpleClientset by using NewClientset or ignoring 2025-12-19 12:00:56 -08:00
Ryan Richard
10444fb9a3 update unit test expectations for kube 1.35 libraries 2025-12-19 11:11:31 -08:00
Ryan Richard
ebfd7d0600 delete test table entries that were accidentally duplicated 2025-12-19 10:58:27 -08:00
Ryan Richard
b2747a0ebe bump deps to kube 1.35 with new codegen 2025-12-18 13:20:41 -08:00
Ryan Richard
e824e74fcc Merge pull request #2806 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m37s
CodeQL / Analyze (javascript) (push) Failing after 1m27s
Bump dependencies
2025-12-16 11:35:25 -08:00
Pinny
2394960a89 Bump dependencies 2025-12-16 14:05:20 +00:00
Ryan Richard
1a5a1eefe4 Merge pull request #2804 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m44s
CodeQL / Analyze (javascript) (push) Failing after 1m27s
Bump dependencies
2025-12-15 09:59:24 -08:00
Pinny
1350fb71f0 Bump dependencies 2025-12-15 14:03:27 +00:00
Ryan Richard
ca7d53ba0a Merge pull request #2785 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m3s
CodeQL / Analyze (javascript) (push) Failing after 1m13s
Bump dependencies
2025-12-10 13:00:02 -08:00
Pinny
0a5bc94c6e Bump dependencies 2025-12-10 14:04:14 +00:00
Ryan Richard
ca3c669230 Merge pull request #2780 from vmware/bump_deps_dec_5_2025
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m51s
CodeQL / Analyze (javascript) (push) Failing after 1m4s
Bump deps and fix test expectations for new OIDC error message text
2025-12-05 13:50:18 -08:00
Ryan Richard
5218c20c76 upgrade linter and remove newly unused linter directives 2025-12-05 10:56:33 -08:00
Ryan Richard
cba4e2a2e8 update test expectations for new oidc error message text 2025-12-05 10:30:46 -08:00
Pinny
4b77a46a6f Bump dependencies 2025-12-05 14:07:21 +00:00
Joshua Casey
db1e85c412 Merge pull request #2707 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m38s
CodeQL / Analyze (javascript) (push) Failing after 1m11s
Bump dependencies
2025-11-20 09:45:41 -06:00
Pinny
a4fdce1077 Bump dependencies 2025-11-20 14:06:48 +00:00
Joshua Casey
f2c1eda663 Merge pull request #2696 from vmware/pinny/update-version-and-cli-docs
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m2s
CodeQL / Analyze (javascript) (push) Failing after 40s
Update version and CLI docs on website
2025-11-06 07:39:53 -06:00
Ryan Richard
fd05cbb4b1 Merge pull request #2701 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m24s
CodeQL / Analyze (javascript) (push) Failing after 34s
Bump dependencies
2025-10-29 12:15:19 -07:00
Pinny
22c63919af Bump dependencies 2025-10-29 13:08:39 +00:00
Joshua Casey
70cb9b64b9 Merge pull request #2695 from vmware/fix-update-go-mod
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m42s
CodeQL / Analyze (javascript) (push) Failing after 1m5s
make update-go-mod script work when there are no toolchain directives
2025-10-28 17:27:45 -05:00
Pinny
3447e28fee Update version and CLI docs on website 2025-10-28 22:09:42 +00:00
Ryan Richard
05db85cb2d make update-go-mod script work when there are no toolchain directives 2025-10-28 13:33:27 -07:00
Ryan Richard
2cfa610249 Merge pull request #2690 from vmware/configurable_kube_cert_agent_strategy_type
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m46s
CodeQL / Analyze (javascript) (push) Failing after 33s
allow the kube cert agent deployment's strategy type to be configured
2025-10-27 09:24:24 -07:00
Ryan Richard
fa5f75464d upgrade dep github.com/google/go-github to v75 2025-10-24 09:58:52 -07:00
Ryan Richard
718b970bc2 update direct deps 2025-10-24 09:49:10 -07:00
Ryan Richard
9be6bb0b94 allow the kube cert agent deployment's strategy type to be configured 2025-10-23 18:10:19 -07:00
Joshua Casey
6e87caaa6a Merge pull request #2683 from vmware/jtc/configurable-kubecertagent-usergroup
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m46s
CodeQL / Analyze (javascript) (push) Failing after 39s
Allow users to specify the RunAsUser and RunAsGroup for the kube-cert-agent container
2025-10-23 15:14:10 -05:00
Joshua Casey
270594cdb1 Allow users to specify the RunAsUser and RunAsGroup for the kube-cert-agent container 2025-10-20 13:45:46 -05:00
Joshua Casey
b1b4bbaa4a Merge pull request #2676 from vmware/jtc/bump-libs-to-v0.33.5
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m13s
CodeQL / Analyze (javascript) (push) Failing after 24s
Bump libs to v0.33.5
2025-10-20 10:21:24 -05:00
Joshua Casey
9aa3f7496a Update CEL errors for k8s 1.35+ 2025-10-20 08:32:49 -05:00
Joshua Casey
7f14ac7863 Run codegen with new k8s lib versions 2025-10-17 08:37:34 -05:00
Joshua Casey
f001df3978 Bump go versions in Dockerfiles 2025-10-17 07:29:52 -05:00
Joshua Casey
2f68041c88 fix lint issues 2025-10-17 07:29:52 -05:00
Joshua Casey
513f1cf7d9 Update net/url as per https://github.com/golang/go/issues/75713 2025-10-17 07:29:52 -05:00
Joshua Casey
d68761e144 Bump libs, especially k8s to v0.33.5 2025-10-17 07:29:52 -05:00
Joshua Casey
92172ca150 Merge pull request #2590 from vmware/pinny/update-version-and-cli-docs
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m25s
CodeQL / Analyze (javascript) (push) Failing after 36s
Update version and CLI docs on website
2025-09-09 09:14:01 -05:00
Pinny
c6d8539b8a Update version and CLI docs on website 2025-08-29 15:04:52 +00:00
Ryan Richard
70c3c62021 Merge pull request #2588 from vmware/update_deps_aug_28_2025
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m53s
CodeQL / Analyze (javascript) (push) Failing after 2m29s
Update dependencies
2025-08-28 14:39:28 -07:00
Ryan Richard
1623b2c46e ran codegen after update of kube-versions.txt 2025-08-28 12:34:05 -07:00
Ryan Richard
adc0dba8e5 update kube-versions.txt 2025-08-28 12:33:39 -07:00
Ryan Richard
6de6d17429 upgrade github.com/google/cel-go to v0.26.1 2025-08-28 12:18:30 -07:00
Ryan Richard
c51fde6c5a upgrade to github.com/google/go-github/v74 2025-08-28 10:52:36 -07:00
Ryan Richard
cf63d782d4 Merge pull request #2580 from vmware/adfs_workaround
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m49s
CodeQL / Analyze (javascript) (push) Failing after 2m5s
Implement configuration option which allows Supervisor to work with ADFS
2025-08-27 16:43:24 -07:00
Ryan Richard
577797d569 add new supervisor configmap option to ignore userinfo endpoints by matching issuer URLs 2025-08-27 13:22:17 -07:00
Ryan Richard
e427a5202e add new bool supervisor configmap option to ignore userinfo endpoints 2025-08-27 12:13:15 -07:00
Ryan Richard
44893e6b0d upgrade linter (caused no new linter errors) 2025-08-27 12:13:15 -07:00
Ryan Richard
7090fb7038 Merge pull request #2577 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m57s
CodeQL / Analyze (javascript) (push) Failing after 2m5s
Bump dependencies
2025-08-27 11:54:29 -07:00
Pinny
892ffead6c Bump dependencies 2025-08-27 13:03:38 +00:00
Ryan Richard
9bbdf59828 Merge pull request #2573 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m17s
CodeQL / Analyze (javascript) (push) Failing after 2m7s
Bump dependencies
2025-08-26 15:53:15 -07:00
Pinny
bf416d59c8 Bump dependencies 2025-08-26 20:55:39 +00:00
Ryan Richard
95e4ec9d88 Merge pull request #2536 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m20s
CodeQL / Analyze (javascript) (push) Failing after 1m47s
Bump dependencies
2025-08-22 09:17:52 -07:00
Ryan Richard
097f3ec5fe ran update.sh 2025-08-20 17:12:50 -07:00
Pinny
301c717d17 Bump dependencies 2025-08-20 13:03:35 +00:00
Ryan Richard
e20c5beb47 Merge pull request #2531 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m32s
CodeQL / Analyze (javascript) (push) Failing after 1m33s
Bump dependencies
2025-08-05 10:25:55 -07:00
Pinny
f96b17abbf Bump dependencies 2025-08-05 13:01:56 +00:00
Ryan Richard
71295c619d Merge pull request #2529 from vmware/pinny/update-version-and-cli-docs
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m11s
CodeQL / Analyze (javascript) (push) Failing after 1m18s
Update version and CLI docs on website
2025-08-04 14:19:16 -07:00
Pinny
bf2b28a755 Update version and CLI docs on website 2025-08-04 21:16:23 +00:00
Ryan Richard
62dd4ab758 Merge pull request #2528 from vmware/pinny/bump-deps
Bump dependencies
2025-08-04 10:15:02 -07:00
Pinny
ff38d82745 Bump dependencies 2025-08-04 13:09:14 +00:00
Ryan Richard
47e1f7e465 Merge pull request #2526 from vmware/change_github_org
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m13s
CodeQL / Analyze (javascript) (push) Failing after 1m39s
account for move of repo from vmware-tanzu to vmware on GitHub
2025-08-04 05:01:44 -07:00
Ryan Richard
4fe8167f60 account for move of repo from vmware-tanzu to vmware on GitHub 2025-08-02 15:08:15 -07:00
Ryan Richard
8f583447ca Merge pull request #2525 from vmware/update_deps_aug_2025
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m55s
CodeQL / Analyze (javascript) (push) Failing after 1m41s
update github.com/google/go-github and Kube versions in generated code
2025-08-02 10:46:16 -07:00
Ryan Richard
9c1cc8db50 update github.com/google/go-github and Kube versions in generated code 2025-08-01 13:41:39 -07:00
Ryan Richard
089e8cf740 Merge pull request #2514 from vmware/okta_ldap
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m46s
CodeQL / Analyze (javascript) (push) Failing after 1m5s
adjust test code to allow for using Okta LDAP in integration tests
2025-08-01 12:23:12 -07:00
Ryan Richard
a038aeb8f0 adjust test code to allow for using Okta LDAP in integration tests
- Okta LDAP requires using a different groups search filter.
- It also does not support posix groups, so make that expected
  value optional.
2025-07-31 15:16:10 -07:00
Ryan Richard
088f88bdc0 Merge pull request #2482 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m54s
CodeQL / Analyze (javascript) (push) Failing after 1m22s
Bump dependencies
2025-07-31 15:15:50 -07:00
Ryan Richard
3a02eec765 avoid using t.Context inside t.Cleanup because it is already cancelled 2025-07-30 15:22:20 -07:00
Joshua Casey
1c1b3b7f2e Bump golangci-lint to 2.3.0 and fix issues 2025-07-30 10:25:23 -05:00
Joshua Casey
b387a2cae9 Update release checklist to include checking the overrides.conf file
Co-authored-by: Ryan Richard <richardry@vmware.com>
2025-07-30 09:21:37 -05:00
Joshua Casey
af8d7335fd Replace github.com/google/gnostic-models v0.6.9
Co-authored-by: Ryan Richard <richardry@vmware.com>
2025-07-30 09:21:37 -05:00
Joshua Casey
07ed9e95cd Pin k8s.io/kube-openapi to v0.0.0-20250318190949-c8a335a9a2ff
Co-authored-by: Ryan Richard <richardry@vmware.com>
2025-07-30 09:21:37 -05:00
Joshua Casey
8d56e06f1c Bump golang.org/x/mod from 0.25.0 to 0.26.0 in /hack/update-go-mod 2025-07-30 09:21:37 -05:00
Joshua Casey
17cb4c2ee5 Update unit test malformed jwt error messages due to https://github.com/coreos/go-oidc/compare/v3.14.1...v3.15.0 2025-07-30 09:21:37 -05:00
Pinny
cd3f55c019 Bump dependencies 2025-07-30 09:05:28 -05:00
Ryan Richard
cf700382fe Merge pull request #2491 from vmware/jwtauthenticator_new_features
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m35s
CodeQL / Analyze (javascript) (push) Failing after 2m21s
add new features in JWTAuthenticator CRD
2025-07-25 13:17:15 -07:00
Ryan Richard
da26da1bd5 Merge pull request #2506 from vmware/new_okta
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m18s
CodeQL / Analyze (javascript) (push) Failing after 3m7s
change css selectors which find Okta page elements for new Okta account
2025-07-24 10:17:01 -07:00
Ryan Richard
679a40b847 change css selectors which find Okta page elements for new Okta account 2025-07-23 11:02:16 -07:00
Ryan Richard
6d8ad5f7a9 fix install-linter.sh for when there is no toolchain in go.mod 2025-07-21 13:50:29 -07:00
Ryan Richard
3c28171525 account for change in err msg starting in Kube 1.34 beta version 2025-07-21 13:50:29 -07:00
Ryan Richard
83696fd023 improve errors and docs for JWTAuthenticator features, with int tests 2025-07-18 12:22:06 -07:00
Ryan Richard
cc4a148c70 add new login integration tests for new JWTAuthenticator features 2025-07-18 12:14:32 -07:00
Ryan Richard
52622d5e4c fix pre-existing integration tests for new JWTAuthenticator features 2025-07-17 10:52:29 -07:00
Ryan Richard
64e5e20010 add usernameExpression and groupsExpression to JWTAuthenticator CRD 2025-07-16 14:56:44 -07:00
Ryan Richard
2a83d00373 add claimValidationRules, userValidationRules, and claims.extra to JWTAuthenticator CRD 2025-07-16 14:56:44 -07:00
Ryan Richard
fdfe2a3c9f Merge pull request #2485 from vmware/skip_on_eks
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m15s
CodeQL / Analyze (javascript) (push) Failing after 2m48s
skip some integration tests on EKS
2025-07-10 15:19:21 -07:00
Ryan Richard
04f0c559db skip some integration tests on EKS 2025-07-10 13:27:26 -07:00
Ryan Richard
9a97e20c40 Merge pull request #2475 from vmware/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m39s
CodeQL / Analyze (javascript) (push) Failing after 1m58s
Bump dependencies
2025-07-07 15:02:58 -07:00
Pinny
9e742d2d84 Bump dependencies 2025-07-07 13:08:57 +00:00
Ryan Richard
4c134a410d Merge pull request #2473 from vmware/update_deps_jun_2025
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m33s
CodeQL / Analyze (javascript) (push) Failing after 2m44s
Update deps
2025-07-02 16:52:58 -07:00
Ryan Richard
cd431c2a8e run codegen and commit results 2025-07-02 13:38:28 -07:00
Ryan Richard
96ef1b75a7 update github client, kube versions, linter 2025-07-02 13:31:37 -07:00
Ryan Richard
63d56f3abb Merge pull request #2471 from vmware/pinny/bump-deps
Bump dependencies
2025-07-02 11:27:32 -07:00
Pinny
de273ea68a Bump dependencies 2025-07-02 13:11:14 +00:00
Joshua Casey
b4758c8e4f Merge pull request #2393 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m44s
CodeQL / Analyze (javascript) (push) Failing after 1m58s
Bump dependencies
2025-07-01 18:33:31 -05:00
Ryan Richard
5258bd542c update test expectation due to dependency bump 2025-07-01 13:46:39 -07:00
Pinny
0656a2dde9 Bump dependencies 2025-07-01 19:27:03 +00:00
Ryan Richard
9d681f2745 Merge pull request #2461 from vmware/new_ci
update docs and tests for new internal CI
2025-07-01 12:12:13 -07:00
Ryan Richard
d57005c42a do not drop internal IP annotation from CredentialIssuer in test 2025-06-30 14:56:48 -07:00
Ryan Richard
6de6bcd81a test fixes for when Kind cluster VM has no public IP in CI 2025-06-27 13:31:38 -07:00
Ryan Richard
d1a14413fb update docs for new internal CI 2025-06-26 12:45:27 -07:00
Ryan Richard
c8a7c10793 Update email address in SECURITY.md
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m5s
CodeQL / Analyze (javascript) (push) Failing after 2m19s
2025-05-30 11:32:04 -07:00
Pinny
fa0c63fc40 Updated versions in docs for v0.39.0 release
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m38s
CodeQL / Analyze (javascript) (push) Failing after 1m13s
2025-05-19 15:50:36 +00:00
Joshua Casey
d8a439acc3 Merge pull request #2389 from vmware-tanzu/agentConfig_priorityClassName
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m41s
CodeQL / Analyze (javascript) (push) Failing after 1m8s
New configuration option for Concierge: kube cert agent `priorityClassName`
2025-05-16 14:53:03 -05:00
Joshua Casey
1254f730f2 Revert the Concierge configmap data to inline rendering 2025-05-16 10:43:14 -05:00
Joshua Casey
69281a4620 Fix concierge config deployment manifest 2025-05-16 10:43:14 -05:00
Joshua Casey
02f7ad2fff Run unit tests with CGO_ENABLED=0, which no longer yields ld warnings 2025-05-16 10:43:13 -05:00
Ryan Richard
2e3e0eed8e avoid "defer cancelFunc()" for top-level context in integration tests
"defer cancelFunc()" causes the context to be cancelled already when
the t.Cleanup's are called, which causes strange test results if those
t.Cleanup's try to use that cancelled context to perform operations.
2025-05-16 10:43:13 -05:00
Ryan Richard
72cea70967 integration test for new config option kubeCertAgent.priorityClassName 2025-05-16 10:43:13 -05:00
Ryan Richard
1428444c24 refactor how Concierge ConfigMap gets templated
Make it similar to how the Supervisor templates
work. This creates a more human-readable ConfigMap
on the cluster.
2025-05-16 10:43:13 -05:00
Ryan Richard
7276a1df53 add new concierge configuration option kubeCertAgent.priorityClassName 2025-05-16 10:43:13 -05:00
Joshua Casey
33c68e2e7d Merge pull request #2383 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2025-05-16 10:06:24 -05:00
Pinny
0986c90678 Bump dependencies 2025-05-16 13:05:44 +00:00
Ryan Richard
986ebe0063 Merge pull request #2384 from vmware-tanzu/upgrade_to_k8s_1.33
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m42s
CodeQL / Analyze (javascript) (push) Failing after 1m6s
Upgrade to k8s libs to 1.33
2025-05-13 14:51:28 -07:00
Ryan Richard
9b24ecad19 run codegen to add 1.33 and update patch versions 2025-05-13 12:21:07 -07:00
Ryan Richard
2e4f719419 fix linter warning caused by k8s 0.33 function deprecation 2025-05-13 12:17:14 -07:00
Ryan Richard
f45e0aeb3d update kube-versions.txt to add 1.33.0 2025-05-13 12:02:07 -07:00
Ryan Richard
e743beac53 upgrade k8s libs to v0.33.0 2025-05-13 11:56:03 -07:00
Ryan Richard
b294c7657a remove generated/1.25 2025-05-13 11:55:29 -07:00
Ryan Richard
524989e16b Merge pull request #2380 from vmware-tanzu/upgrade_to_k8s_1.32
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m41s
CodeQL / Analyze (javascript) (push) Failing after 1m15s
Upgrade to k8s 1.32, upgrade linter and other deps
2025-05-13 11:53:33 -07:00
Ryan Richard
a6b2905c3a skip race detector for impersonator package for now
This commit is meant to be reverted when the upstream
bug is fixed which causes tests to fail when the race
detector is enabled for unit tests in the impersonator
package. There is a commit in the hack dir and another
commit in the `ci` branch for CI.
2025-05-13 07:47:53 -07:00
Ryan Richard
aa2bdcb8dd update codegen, including copright year 2025-05-12 16:53:30 -07:00
Ryan Richard
a315cc4977 update copyright year for api generated code 2025-05-12 16:49:00 -07:00
Joshua Casey
b8e7a64afe Bump libs to k8s.io@v0.32.3, add codegen for k8s 1.32, and drop codegen for k8s 1.25 2025-05-12 16:36:46 -07:00
Ryan Richard
b50da60c84 run codegen post-bump controller-gen to v0.18.0 2025-05-12 15:52:11 -07:00
Ryan Richard
dfc4c38259 upgrade github.com/google/go-github to v71 2025-05-12 15:47:36 -07:00
Pinny
dce1f5b208 Bump dependencies 2025-05-12 15:47:21 -07:00
Ryan Richard
c600cf7949 upgrade linter to latest 2025-05-12 15:19:50 -07:00
Joshua Casey
32a29da86c Merge pull request #2344 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m40s
CodeQL / Analyze (javascript) (push) Failing after 1m11s
Bump dependencies
2025-04-29 23:52:35 -05:00
Pinny
9ac9930650 Bump dependencies 2025-04-29 13:04:40 +00:00
Ryan Richard
1f01c394f3 Merge pull request #2338 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m37s
CodeQL / Analyze (javascript) (push) Failing after 1m11s
Bump dependencies
2025-04-23 12:03:03 -07:00
Pinny
a41ca92b8e Bump dependencies 2025-04-23 13:04:34 +00:00
Joshua Casey
f75eef16b4 Merge pull request #2322 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m33s
CodeQL / Analyze (javascript) (push) Failing after 1m7s
Bump dependencies
2025-04-21 14:21:58 -05:00
Pinny
2e801dc275 Bump dependencies 2025-04-21 13:07:26 +00:00
Ryan Richard
b8b460f98a Merge pull request #2319 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m36s
CodeQL / Analyze (javascript) (push) Failing after 1m6s
Bump dependencies
2025-04-09 11:14:36 -07:00
Pinny
39588c3bb4 Bump dependencies 2025-04-09 13:11:48 +00:00
Ryan Richard
79035bc2b6 Merge pull request #2317 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m40s
CodeQL / Analyze (javascript) (push) Failing after 1m7s
Bump dependencies
2025-04-08 17:08:45 -07:00
Ryan Richard
85c94116ce ignore a new lint warning 2025-04-08 12:55:20 -07:00
Pinny
7e8ea9f1fb Bump dependencies 2025-04-08 13:05:48 +00:00
Ryan Richard
a0e38fe8c1 Merge pull request #2315 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m59s
CodeQL / Analyze (javascript) (push) Failing after 1m46s
Bump dependencies
2025-04-07 12:41:22 -07:00
Pinny
f9c3d932c1 Bump dependencies 2025-04-07 13:01:30 +00:00
Ryan Richard
861c501ea8 Merge pull request #2313 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m45s
CodeQL / Analyze (javascript) (push) Failing after 14m41s
Bump dependencies
2025-04-04 10:55:33 -07:00
Pinny
e129a569ba Bump dependencies 2025-04-04 13:09:33 +00:00
Ryan Richard
fd42da225d Merge pull request #2309 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 3m3s
CodeQL / Analyze (javascript) (push) Failing after 1m37s
Bump dependencies
2025-04-03 07:58:19 -07:00
Pinny
b139a458fd Bump dependencies 2025-04-03 13:02:37 +00:00
Joshua Casey
68a2df41ed Merge pull request #2297 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m41s
CodeQL / Analyze (javascript) (push) Failing after 1m57s
Bump dependencies
2025-03-31 09:57:41 -05:00
Pinny
2cbdd60022 Bump dependencies 2025-03-31 13:10:59 +00:00
Joshua Casey
0e12f90749 Merge pull request #2290 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m31s
CodeQL / Analyze (javascript) (push) Failing after 50s
Bump dependencies
2025-03-26 23:01:01 -05:00
Pinny
7e132a5dcd Bump dependencies 2025-03-26 13:10:43 +00:00
Joshua Casey
910326f1ea Merge pull request #2285 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m28s
CodeQL / Analyze (javascript) (push) Failing after 51s
Bump dependencies
2025-03-24 15:06:34 -05:00
Joshua Casey
6057b0c912 Bump to github.com/google/go-github/v70 2025-03-24 10:13:45 -05:00
Joshua Casey
2845829fb4 Bump to k8s.io@v0.31.7 libs 2025-03-24 10:10:49 -05:00
Pinny
653b6d5b0d Bump dependencies 2025-03-24 13:10:39 +00:00
Pinny
7ef58a9132 Updated versions in docs for v0.38.0 release
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m2s
CodeQL / Analyze (javascript) (push) Failing after 55s
2025-03-19 20:56:58 +00:00
Ryan Richard
cf98c69c0d Merge pull request #2283 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m37s
CodeQL / Analyze (javascript) (push) Failing after 52s
Bump dependencies
2025-03-19 08:21:36 -07:00
Ryan Richard
62f6d8516b Merge pull request #2278 from vmware-tanzu/upgrade_deps_march_2025
Upgrade deps
2025-03-19 07:44:39 -07:00
Pinny
604ecc583c Bump dependencies 2025-03-19 13:10:02 +00:00
Ryan Richard
a010794873 generated code changes from running update.sh 2025-03-18 15:32:37 -07:00
Ryan Richard
c7462bf1f6 update kube-versions.txt 2025-03-18 12:39:13 -07:00
Ryan Richard
b396d12456 update Dockerfile and README copyright years 2025-03-18 12:38:58 -07:00
Ryan Richard
695ea3a165 upgrade linter 2025-03-18 12:38:47 -07:00
Ryan Richard
d625ada06a upgrade github.com/google/go-github and k8s.io packages 2025-03-18 12:38:29 -07:00
Joshua Casey
0f48620d9c Merge pull request #2276 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m21s
CodeQL / Analyze (javascript) (push) Failing after 59s
Bump dependencies
2025-03-18 09:54:16 -05:00
Pinny
c2496aab6b Bump dependencies 2025-03-18 13:04:18 +00:00
Joshua Casey
00734d143e Merge pull request #2269 from vmware-tanzu/rr/option_to_disable_admission_plugins
introduce new configuration option to disable admission plugin types
2025-03-18 07:31:46 -05:00
Ryan Richard
d90b3c23ef introduce new configuration option to disable admission plugin types 2025-03-17 14:49:17 -07:00
Ryan Richard
035dbffd28 Merge pull request #2268 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 53s
CodeQL / Analyze (javascript) (push) Failing after 1m2s
Bump dependencies
2025-03-17 12:32:28 -07:00
Pinny
e3710289e5 Bump dependencies 2025-03-17 13:09:35 +00:00
Joshua Casey
99b67b89ac Merge pull request #2266 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m37s
CodeQL / Analyze (javascript) (push) Failing after 54s
Bump dependencies
2025-03-16 22:58:47 -05:00
Pinny
e374841857 Bump dependencies 2025-03-14 13:08:05 +00:00
Ryan Richard
9f2336476f Merge pull request #2264 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m34s
CodeQL / Analyze (javascript) (push) Failing after 51s
Bump dependencies
2025-03-13 13:38:08 -07:00
Pinny
63b560d740 Bump dependencies 2025-03-13 13:11:01 +00:00
Joshua Casey
f54834cbee Merge pull request #2254 from vmware-tanzu/rr/callback_handler_form_post
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m34s
CodeQL / Analyze (javascript) (push) Failing after 55s
support response_mode=form_post in upstream OIDC IDPs
2025-03-07 17:40:37 -06:00
Ryan Richard
749633e43c support response_mode=form_post in upstream OIDC IDPs 2025-03-06 15:28:47 -08:00
Ryan Richard
308c76cd69 Merge pull request #2249 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m27s
CodeQL / Analyze (javascript) (push) Failing after 48s
Bump dependencies
2025-03-06 15:14:51 -08:00
Joshua Casey
fc9a261b77 Update golang.org/x/mod in hack/update-go-mod/go.mod 2025-03-06 13:28:00 -08:00
Pinny
d2d860bd3b Bump dependencies 2025-03-06 13:28:00 -08:00
Ryan Richard
9cb3638354 Merge pull request #2253 from vmware-tanzu/optional_tools_proxy
make tools deployment proxy server optional
2025-03-06 11:41:42 -08:00
Ryan Richard
6133276555 make tools deployment proxy server optional 2025-03-06 11:02:24 -08:00
Joshua Casey
a7a3016ae5 Merge pull request #2250 from vmware-tanzu/chrome_v134
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m30s
CodeQL / Analyze (javascript) (push) Failing after 45s
slow down filling out the Okta login screen for Chrome v134
2025-03-05 17:28:03 -06:00
Ryan Richard
dd0dcad8c4 slow down filling out the Okta login screen for Chrome v134 2025-03-05 12:13:45 -08:00
Joshua Casey
ed8c9448de Merge pull request #2239 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m28s
CodeQL / Analyze (javascript) (push) Failing after 44s
Bump dependencies
2025-02-28 11:53:46 -06:00
Pinny
5e80fb26f0 Bump dependencies 2025-02-28 14:06:05 +00:00
Joshua Casey
292855332c Merge pull request #2236 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m36s
CodeQL / Analyze (javascript) (push) Failing after 52s
Bump dependencies
2025-02-27 09:53:36 -06:00
Pinny
68b0dd83f2 Bump dependencies 2025-02-27 14:02:01 +00:00
Joshua Casey
611fc61c12 Merge pull request #2233 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m33s
CodeQL / Analyze (javascript) (push) Failing after 46s
Bump dependencies
2025-02-26 11:27:08 -06:00
Pinny
2cd4a2c730 Bump dependencies 2025-02-26 14:09:14 +00:00
Ryan Richard
3e89915a98 Merge pull request #2228 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m11s
CodeQL / Analyze (javascript) (push) Failing after 43s
Bump dependencies
2025-02-25 10:05:28 -08:00
Pinny
f4aaee8bd7 Bump dependencies 2025-02-25 14:10:26 +00:00
Ryan Richard
d56413a289 Merge pull request #2209 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.23.0
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m27s
CodeQL / Analyze (javascript) (push) Failing after 41s
Bump golang.org/x/mod from 0.22.0 to 0.23.0 in /hack/update-go-mod
2025-02-24 12:10:57 -08:00
dependabot[bot]
27b629af3a Bump golang.org/x/mod from 0.22.0 to 0.23.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.22.0 to 0.23.0.
- [Commits](https://github.com/golang/mod/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 20:09:53 +00:00
Ryan Richard
1a3cb65fa4 remove go-lint-runner dockerfile from dependabot.yml
That directory doesn't exist anymore, so no need for
dependabot to monitor it anymore.
2025-02-24 11:46:54 -08:00
Ryan Richard
4b3eb0e6ec Merge pull request #2205 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2025-02-24 10:28:12 -08:00
Pinny
f89b13bc62 Bump dependencies 2025-02-24 14:09:13 +00:00
Ryan Richard
8b7fec5049 Merge pull request #2203 from vmware-tanzu/go1.24
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m26s
CodeQL / Analyze (javascript) (push) Failing after 41s
Upgrade to Go 1.24 and change FIPS-compatible builds to allow the use of TLS 1.3
2025-02-19 14:46:01 -08:00
Ryan Richard
3a6573f89e remove fips_enable_tls13_max_for_default_profile build tag 2025-02-19 11:47:34 -08:00
Ryan Richard
4e04f5b606 remove fips_strict insecure ciphers which do not seem to be in Go 1.24 2025-02-19 08:13:55 -08:00
Ryan Richard
39a86e7d52 upgrade Go linter to current latest 2025-02-18 10:47:24 -08:00
Ryan Richard
8cfc1c08ec allow both TLS v1.2 and v1.3 in fips mode, supported starting in Go 1.24 2025-02-18 10:46:59 -08:00
Pinny
c90637398d Bump dependencies 2025-02-18 14:10:15 +00:00
Ryan Richard
737aabb620 Merge pull request #2197 from vmware-tanzu/downgrade_cdproto
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m25s
CodeQL / Analyze (javascript) (push) Failing after 41s
Downgrade cdproto to the version selected by current chromedp version
2025-02-14 12:58:48 -08:00
Ryan Richard
0e930b3d63 Downgrade cdproto to the version selected by current chromedp version
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2025-02-12 13:27:31 -08:00
Joshua Casey
876f626e7d Merge pull request #2196 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m23s
CodeQL / Analyze (javascript) (push) Failing after 41s
Bump dependencies
2025-02-10 09:47:12 -06:00
Pinny
0dc704be9c Bump dependencies 2025-02-10 14:01:28 +00:00
Joshua Casey
e437832698 Merge pull request #2195 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m24s
CodeQL / Analyze (javascript) (push) Failing after 42s
Bump dependencies
2025-02-06 10:26:31 -06:00
Pinny
274ca4cb73 Bump dependencies 2025-02-06 14:03:20 +00:00
Ryan Richard
a99ff646a0 Merge pull request #2193 from vmware-tanzu/rr/ca_bundle_discovery
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m20s
CodeQL / Analyze (javascript) (push) Failing after 40s
"pinniped get kubeconfig" discovers CA bundle from JWTAuthenticator's spec.TLS.CertificateAuthorityDataSource
2025-02-05 12:47:42 -08:00
Ryan Richard
02eb26f135 "pinniped get kubeconfig" discovers CA bundle from CertificateAuthorityDataSource 2025-02-05 10:59:02 -08:00
Joshua Casey
e90f19f8ab Merge pull request #2192 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 49s
CodeQL / Analyze (javascript) (push) Failing after 35s
Bump dependencies
2025-02-04 10:06:44 -06:00
Pinny
00c2c5cf6e Bump dependencies 2025-02-04 14:08:31 +00:00
Joshua Casey
3386774f5f Merge pull request #2191 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m34s
CodeQL / Analyze (javascript) (push) Failing after 45s
Bump dependencies
2025-02-03 13:47:48 -06:00
Joshua Casey
7e4330be93 Bump codegen to latest k8s.io versions for 1.29, 1.30, and 1.31 2025-02-03 10:28:43 -06:00
Joshua Casey
f5b3e6da93 Bump to k8s.io@v0.31.5 libs 2025-02-03 10:28:42 -06:00
Joshua Casey
5c39374915 Update code for fosite changes 2025-02-03 10:28:42 -06:00
Pinny
4fdb931141 Bump dependencies 2025-02-03 14:06:25 +00:00
Ryan Richard
3a02854192 Merge pull request #2190 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m30s
CodeQL / Analyze (javascript) (push) Failing after 41s
Bump dependencies
2025-01-31 09:30:28 -08:00
Pinny
63c071d6ea Bump dependencies 2025-01-31 14:05:01 +00:00
Ryan Richard
6dc96f4224 Merge pull request #2189 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m33s
CodeQL / Analyze (javascript) (push) Failing after 42s
Bump dependencies
2025-01-30 10:33:40 -08:00
Pinny
aa8f8f7fda Bump dependencies 2025-01-30 14:10:37 +00:00
Joshua Casey
f5167bb279 Merge pull request #2188 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m24s
CodeQL / Analyze (javascript) (push) Failing after 43s
Bump dependencies
2025-01-29 13:10:25 -06:00
Pinny
b84eafc173 Bump dependencies 2025-01-29 14:04:56 +00:00
Ryan Richard
50ed1b0cf9 Merge pull request #2167 from vmware-tanzu/jtc/federation-domain-issuer-must-be-https-url
Some checks failed
CodeQL / Analyze (go) (push) Failing after 56s
CodeQL / Analyze (javascript) (push) Failing after 45s
Federation domain issuer must be https url
2025-01-28 10:56:35 -08:00
Joshua Casey
1d873be184 Make sure that CEL errors are checked for the appropriate Kube version 2025-01-27 10:46:55 -06:00
Joshua Casey
5a0d6eddb1 Make sure each FederationDomain has a unique name, and skip CEL tests for old K8s versions 2025-01-27 10:46:55 -06:00
Joshua Casey
31b45525ce Remove deprecated CredentialIssuer.status.kubeConfigInfo 2025-01-27 10:46:55 -06:00
Joshua Casey
430c73b903 FederationDomain.spec.issuer must now be an HTTPS URL 2025-01-27 10:46:55 -06:00
Joshua Casey
cc1befbc57 Allow for multiple error messages 2025-01-27 10:46:55 -06:00
Joshua Casey
68a0ad4112 Extract common prefix from error messages 2025-01-27 10:46:55 -06:00
Joshua Casey
9aca187559 Merge pull request #2187 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m27s
CodeQL / Analyze (javascript) (push) Failing after 44s
Bump dependencies
2025-01-27 10:18:30 -06:00
Pinny
d0fb9f3637 Bump dependencies 2025-01-27 14:05:17 +00:00
Joshua Casey
51d1bc32e8 Merge pull request #2186 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m23s
CodeQL / Analyze (javascript) (push) Failing after 35s
Bump dependencies
2025-01-24 17:00:25 -06:00
Ryan Richard
e9b9dd6fa3 update generated code for 1.26 and 1.29 2025-01-24 13:15:39 -08:00
Joshua Casey
7e43aa4e12 Bump dependencies and codgen 2025-01-24 13:56:57 -06:00
Pinny
de509db7be Bump dependencies 2025-01-24 14:01:08 +00:00
Pinny
69c6676d8f Updated versions in docs for v0.37.0 release
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m25s
CodeQL / Analyze (javascript) (push) Failing after 41s
2025-01-15 20:53:32 +00:00
Joshua Casey
2ab11dccfc Merge pull request #2185 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2025-01-15 12:21:55 -06:00
Pinny
d64b4677b9 Bump dependencies 2025-01-15 10:07:13 -06:00
Ryan Richard
f040f098dc rerun codegen after bumping controller-gen and crd-ref-docs 2025-01-14 11:04:42 -08:00
Ryan Richard
abe3391cce use github.Ptr where deprecated github.String and github.Int64 were used 2025-01-14 09:40:48 -08:00
Ryan Richard
6ae27c87f6 upgrade dep to github.com/google/go-github/v68/github 2025-01-14 09:03:06 -08:00
Joshua Casey
3d2446d235 Merge pull request #2182 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 36s
CodeQL / Analyze (javascript) (push) Failing after 34s
Bump dependencies
2025-01-14 09:54:48 -06:00
Pinny
4f01b3157f Bump dependencies 2025-01-14 14:06:38 +00:00
Joshua Casey
14e728aa0d Merge pull request #2177 from vmware-tanzu/doc_updates
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m18s
CodeQL / Analyze (javascript) (push) Failing after 44s
Doc updates
2025-01-13 16:33:32 -06:00
Joshua Casey
4a266a44db Merge pull request #2181 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2025-01-13 16:20:07 -06:00
Pinny
900db0d3a3 Bump dependencies 2025-01-13 14:00:50 +00:00
Joshua Casey
8b95b141b2 Merge pull request #2179 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m22s
CodeQL / Analyze (javascript) (push) Failing after 31s
Bump dependencies
2025-01-13 07:10:57 -06:00
Pinny
5a9f2f3181 Bump dependencies 2025-01-10 14:02:04 +00:00
Ryan Richard
4f43f01e55 update architecture.md 2025-01-08 12:35:47 -08:00
Ryan Richard
7221be5a8a add doc describing all tokens and credentials 2025-01-08 12:35:34 -08:00
Joshua Casey
83ab099b84 Merge pull request #2176 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 35s
CodeQL / Analyze (javascript) (push) Failing after 32s
Bump dependencies
2025-01-07 11:12:33 -06:00
Pinny
5f79860c8c Bump dependencies 2025-01-07 14:06:50 +00:00
Joshua Casey
e4f7b5d181 Merge pull request #2174 from vmware-tanzu/audit_sourceips
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m19s
CodeQL / Analyze (javascript) (push) Failing after 35s
change `remoteAddr` to `sourceIPs` in Supervisor audit log for incoming http requests
2025-01-06 23:09:03 -06:00
Ryan Richard
9619a0f226 change remoteAddr to sourceIPs in Supervisor audit log for incoming reqs 2025-01-06 21:21:01 -06:00
Joshua Casey
23f414c384 Merge pull request #2175 from vmware-tanzu/upgrade_linter
upgrade golangci-lint to v1.63.4
2025-01-06 19:22:05 -06:00
Ryan Richard
4872be0a84 upgrade golangci-lint to v1.63.4 2025-01-06 13:03:46 -08:00
Joshua Casey
691307a269 Merge pull request #2173 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m19s
CodeQL / Analyze (javascript) (push) Failing after 31s
Bump dependencies
2025-01-06 10:39:13 -06:00
Pinny
6d846ad2a9 Bump dependencies 2025-01-06 14:03:30 +00:00
Joshua Casey
ff24c757b7 Merge pull request #2171 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m19s
CodeQL / Analyze (javascript) (push) Failing after 32s
Bump dependencies
2025-01-02 09:51:32 -06:00
Pinny
ee4663aa19 Bump dependencies 2025-01-02 14:05:57 +00:00
Joshua Casey
119c591500 Merge pull request #2170 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m21s
CodeQL / Analyze (javascript) (push) Failing after 32s
Bump dependencies
2024-12-30 10:47:57 -06:00
Pinny
275412e902 Bump dependencies 2024-12-30 14:03:31 +00:00
Joshua Casey
fe75ebe4b2 Merge pull request #2169 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m22s
CodeQL / Analyze (javascript) (push) Failing after 34s
Bump dependencies
2024-12-27 11:01:39 -06:00
Pinny
fabb80cf19 Bump dependencies 2024-12-27 14:09:36 +00:00
Joshua Casey
7577f20c61 Merge pull request #2166 from vmware-tanzu/avoid_kube_32
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m28s
CodeQL / Analyze (javascript) (push) Failing after 48s
temporarily avoid upgrades to kube v0.32.0 without using replace directives for direct deps
2024-12-26 13:16:18 -06:00
Joshua Casey
f441714f93 Bump codegen for 1.31, 1.30, and 1.29 2024-12-26 11:31:19 -06:00
Ryan Richard
2c9547e6a4 bump build image to latest 2024-12-24 12:38:55 -08:00
Ryan Richard
3bf3ed03f5 temporarily avoid upgrades to kube v0.32.0 without replace directives 2024-12-24 12:37:48 -08:00
Joshua Casey
c279253e20 Merge pull request #2163 from vmware-tanzu/jtc/pin-k8s-to-1-31-4
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m38s
CodeQL / Analyze (javascript) (push) Failing after 46s
Pin k8s.io libs to 1.31.4
2024-12-23 12:59:01 -06:00
Joshua Casey
fa9ddf48d5 Pin k8s.io dependencies to v0.31.4 2024-12-20 15:39:26 -06:00
Joshua Casey
b8a9c4d1e5 Bump all dependencies 2024-12-20 15:38:57 -06:00
Joshua Casey
b4365c100f Merge pull request #2162 from vmware-tanzu/build_tags_for_tls_versions
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m30s
CodeQL / Analyze (javascript) (push) Failing after 39s
Introduce new build tags to optionally override some min and max TLS settings
2024-12-20 14:25:22 -06:00
Ryan Richard
ef4b0c9cff bump golang.org/x/net 2024-12-20 10:28:32 -08:00
Ryan Richard
b625b4a076 introduce build tags to optionally override some TLS settings 2024-12-20 10:28:32 -08:00
Joshua Casey
acbe9ce23d Merge pull request #2158 from vmware-tanzu/upgrade_fosite
Some checks are pending
CodeQL / Analyze (go) (push) Has started running
CodeQL / Analyze (javascript) (push) Has started running
upgrade fosite to v0.49.0 and handle its API changes
2024-12-13 14:11:25 -06:00
Ryan Richard
90c95866d1 upgrade fosite to v0.49.0 and handle its API changes 2024-12-13 10:17:42 -08:00
Ryan Richard
57fc177266 Merge pull request #2156 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m9s
CodeQL / Analyze (javascript) (push) Failing after 1m11s
Bump dependencies
2024-12-11 10:53:48 -08:00
Pinny
0366f4087f Bump dependencies 2024-12-11 14:00:52 +00:00
Joshua Casey
3f6d287b44 Merge pull request #2155 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m9s
CodeQL / Analyze (javascript) (push) Failing after 1m12s
Bump dependencies
2024-12-10 16:28:15 -06:00
Joshua Casey
36aa701b56 Merge branch 'main' into pinny/bump-deps 2024-12-10 13:29:48 -06:00
Pinny
fc5a776645 Updated versions in docs for v0.36.0 release 2024-12-10 19:00:02 +00:00
Pinny
c2b4390bfa Bump dependencies 2024-12-10 14:06:14 +00:00
Ryan Richard
b371389c27 Merge pull request #2154 from vmware-tanzu/jtc/fixup-before-audit-release
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m11s
CodeQL / Analyze (javascript) (push) Failing after 1m9s
Small fixups prior to releasing audit log story
2024-12-09 12:36:49 -08:00
Joshua Casey
87640ca54a Callback endpoint emits audit log with authorizeID even when code param not found
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-12-09 12:47:54 -06:00
Joshua Casey
8322b03d63 Merge pull request #2153 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m2s
CodeQL / Analyze (javascript) (push) Failing after 1m8s
Bump dependencies
2024-12-09 10:04:13 -06:00
Pinny
594c3580f2 Bump dependencies 2024-12-09 14:11:21 +00:00
Joshua Casey
0d80c492f1 Merge pull request #2152 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m28s
CodeQL / Analyze (javascript) (push) Failing after 1m29s
Bump dependencies
2024-12-05 15:23:10 -06:00
Pinny
1a29cca1ca Bump dependencies 2024-12-05 14:07:26 +00:00
Ryan Richard
b54191f29f Merge pull request #2150 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m32s
CodeQL / Analyze (javascript) (push) Failing after 1m26s
Bump dependencies
2024-12-04 13:39:11 -08:00
Pinny
422e4e4785 Bump dependencies 2024-12-04 14:06:21 +00:00
Joshua Casey
4187cc1f61 Merge pull request #2149 from vmware-tanzu/upgrade_majors
Some checks failed
CodeQL / Analyze (go) (push) Failing after 14m1s
CodeQL / Analyze (javascript) (push) Failing after 14m3s
New hack script to help us upgrade major versions of modules from `go.mod`
2024-12-03 19:07:28 -06:00
Ryan Richard
ede9e45211 make audit_test.go ignore pod log lines that aren't JSON 2024-12-03 17:20:25 -06:00
Ryan Richard
a36550d94b ran update.sh after updating kube minor versions for codegen 2024-12-03 13:06:15 -06:00
Ryan Richard
7c3870f3fa update kube-versions.txt for new patch versions 2024-12-03 13:05:27 -06:00
Ryan Richard
7ca2796774 update release_checklist.md for new hack script 2024-12-03 13:05:05 -06:00
Ryan Richard
170cc3bba4 ran new hack script to update all majors: updated github mod 2024-12-03 12:52:29 -06:00
Ryan Richard
1980912ebe add hack script to help update major versions of modules 2024-12-03 12:51:40 -06:00
Joshua Casey
1571859d67 Merge pull request #2147 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 9m3s
CodeQL / Analyze (javascript) (push) Failing after 3m7s
Bump dependencies
2024-12-03 11:22:23 -06:00
Pinny
eb4c20a6aa Bump dependencies 2024-12-03 14:04:18 +00:00
Joshua Casey
1154139b91 Merge pull request #2145 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 14m14s
CodeQL / Analyze (javascript) (push) Failing after 14m10s
Bump dependencies
2024-12-02 16:52:50 -06:00
Joshua Casey
28e22d7dd2 Update error text assertion due to change in ory/fosite
- db74aa7abd
2024-12-02 11:08:30 -06:00
Joshua Casey
9cfbbb541a Standardize casing in Dockerfiles 2024-12-02 10:00:39 -06:00
Pinny
21bce1cb92 Bump dependencies 2024-12-02 14:10:28 +00:00
Joshua Casey
fe045343ee Merge pull request #2009 from vmware-tanzu/audit_logging
Some checks failed
CodeQL / Analyze (go) (push) Failing after 18m37s
CodeQL / Analyze (javascript) (push) Failing after 2m36s
Add audit logging for Supervisor and Concierge
2024-11-27 15:46:34 -06:00
Ryan Richard
df017f9267 attempt to fix a test flake seen sometimes in CI 2024-11-27 13:53:03 -06:00
Ryan Richard
ae5aad178d TokenCredentialRequest uses actual cert expiry time instead of estimate
and also audit logs both the NotBefore and NotAfter of the issued cert.
Implemented by changing the return type of the cert issuer helpers
to make them also return the NotBefore and NotAfter values of the new
cert, along with the key PEM and cert PEM.
2024-11-27 13:53:03 -06:00
Ryan Richard
032160a85e simplify single-node.yaml
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:03 -06:00
Ryan Richard
ecd23e86ce callback endpoint renders more useful user-facing error messages
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:03 -06:00
Ryan Richard
51ae782135 fix typo in audit-logging.md 2024-11-27 13:53:03 -06:00
Ryan Richard
54b35c30da rename tokenIdentifier to tokenID in the audit logs
Because `tokenID` is more consistent with the names of
the other correlation keys.
2024-11-27 13:53:03 -06:00
Ryan Richard
dfe04c5a58 update audit-logging.md to reflect changes in recent commits 2024-11-27 13:53:03 -06:00
Ryan Richard
4423d472da allow audit correlation between token being issued and being used 2024-11-27 13:53:03 -06:00
Joshua Casey
c803a182be Allow override of audit.log_usernames_and_groups for local debugging 2024-11-27 13:53:02 -06:00
Joshua Casey
bc73505e35 Easily enable kind audit logs with ENABLE_AUDIT_LOGGING=true ./hack/kind-up.sh 2024-11-27 13:53:02 -06:00
Joshua Casey
0a28c818ad Small fixes for integration tests 2024-11-27 13:53:02 -06:00
Joshua Casey
ce2dcbdbb3 simplify godoc 2024-11-27 13:53:02 -06:00
Ryan Richard
1ebe2fcd1a add integration test for personal info showing in login audit logs 2024-11-27 13:53:02 -06:00
Joshua Casey
c7e9ee1c61 Backfill unit tests for paramsSafeToLog 2024-11-27 13:53:02 -06:00
Joshua Casey
51c86795af Backfill unit tests for cmd/pinniped/cmd/audit_id.go 2024-11-27 13:53:02 -06:00
Joshua Casey
8dffd60f0b Backfill unit tests for audit logging from the CLI 2024-11-27 13:53:02 -06:00
Ryan Richard
6bf9b64778 log response audit-id for tokencredentialrequests made from CLI
Only logged when PINNIPED_DEBUG=true is used.

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:02 -06:00
Ryan Richard
26ec7fa346 prepare-supervisor-on-kind.sh takes new --api-group-suffix flag
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:02 -06:00
Joshua Casey
60bd118a9c pinniped CLI should print the audit-ID in certain error cases
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-11-27 13:53:02 -06:00
Joshua Casey
b69507f7f3 Add generic audit integration test 2024-11-27 13:53:02 -06:00
Ryan Richard
7d59df0f86 update original audit logging proposal 2024-11-27 13:53:02 -06:00
Ryan Richard
9c0272382f clean up audit logging documentation 2024-11-27 13:53:02 -06:00
Ryan Richard
2de8d9f0f3 cleanup example audit logs to make them prettier 2024-11-27 13:53:02 -06:00
Ryan Richard
d0905c02dd use test helper in rest_test.go to reduce some duplication
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:02 -06:00
Ryan Richard
51fc86f950 don't audit log missing username or password, change query param value
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:02 -06:00
Ryan Richard
76bda12760 update audit-logging.md to resolve todos 2024-11-27 13:53:02 -06:00
Ryan Richard
a84b76e56a audit log session ID in token handler for every grant type
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:02 -06:00
Ryan Richard
c2018717b6 audit log OIDCClientSecretRequests 2024-11-27 13:53:02 -06:00
Joshua Casey
f388513145 resolve TODO by adding docs 2024-11-27 13:53:02 -06:00
Ryan Richard
c16ebe1707 add unit test for audit logging when token refresh updates groups 2024-11-27 13:53:02 -06:00
Ryan Richard
b54365c199 audit log request params on GET and POST login handlers 2024-11-27 13:53:02 -06:00
Ryan Richard
51d1cc7a96 refactor and add unit test for AuditRequestParams() 2024-11-27 13:53:02 -06:00
Ryan Richard
c06141c871 token handler uses common method to audit HTTP request parameters 2024-11-27 13:53:02 -06:00
Ryan Richard
eab3fde3af introduce common method to audit HTTP request parameters 2024-11-27 13:53:02 -06:00
Joshua Casey
de7781b7f9 Use correct caller when generating audit events 2024-11-27 13:53:02 -06:00
Joshua Casey
611de03e01 Add audit event 'Incorrect Username Or Password' to auth_handler and audit event 'Using Upstream IDP' to callback_handler 2024-11-27 13:53:01 -06:00
Joshua Casey
de722332b1 Add audit logging to post_login_handler 2024-11-27 13:53:01 -06:00
Ryan Richard
438ca437ec tokencredentialrequest audit logs failed requests 2024-11-27 13:53:01 -06:00
Ryan Richard
e21e1326b7 tokencredentialrequest audit logs successful responses
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:01 -06:00
Joshua Casey
37e12b4024 Start backfilling some audit unit tests in post_login_handler 2024-11-27 13:53:01 -06:00
Ryan Richard
e126ee5495 all callers of Audit() identify which keys may contain PII 2024-11-27 13:53:01 -06:00
Ryan Richard
a308f3f22a audit log: keep key ordering in personalInfo, render nil slices and maps 2024-11-27 13:53:01 -06:00
Ryan Richard
c5f4cce3ae make Audit() take struct as param for all optional params and redact PII 2024-11-27 13:53:01 -06:00
Ryan Richard
ced8686d11 add config for audit logging, remove Audit() from Logger interface
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-27 13:53:01 -06:00
Joshua Casey
76f6b725b8 Fix some rebase conflicts 2024-11-27 13:53:01 -06:00
Joshua Casey
f9e1dd4bec Backfill unit tests for garbage_collector audit logging 2024-11-27 13:53:01 -06:00
Joshua Casey
f4f393e5de Audit event 'HTTP Request Completed' will now log the location with err, error, and error_description query parameters
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-11-27 13:53:01 -06:00
Joshua Casey
2db5dda266 Add last audit log unit tests to auth_handler
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-11-27 13:53:01 -06:00
Ryan Richard
8cf9c59957 refactor to move audit event message types to their own pkg 2024-11-27 13:53:01 -06:00
Ryan Richard
088556193d auth handler audit logs headers and params when http method is wrong
also refactor some related code into a helper, and fix linter errors
2024-11-27 13:53:01 -06:00
Joshua Casey
18d3ab3d15 The 'HTTP Request Parameters' audit event now logs params as a JSON object 2024-11-27 13:53:01 -06:00
Joshua Casey
dc6faa33bb Log params to token_handler endpoint even during error cases 2024-11-27 13:53:01 -06:00
Joshua Casey
0d22ae2c1a Fix lint and unit test compilation 2024-11-27 13:53:01 -06:00
Joshua Casey
362d982906 Start to backfill some audit unit tests for the token_handler 2024-11-27 13:53:01 -06:00
Ryan Richard
1006dd9379 resolve some todos 2024-11-27 13:53:01 -06:00
Joshua Casey
369316556a Add configuration to audit internal endpoints and backfill unit tests 2024-11-27 13:53:01 -06:00
Joshua Casey
cf4b29de4b Clarify docs 2024-11-27 13:53:00 -06:00
Joshua Casey
09ca7920ea Extract testutil helper function 2024-11-27 13:53:00 -06:00
Joshua Casey
9994e033b2 Add audit event tests for login_handler 2024-11-27 13:53:00 -06:00
Joshua Casey
dd56f2b47f Add audit event tests for callback_handler 2024-11-27 13:53:00 -06:00
Ryan Richard
4df043a91c document audit logging 2024-11-27 13:53:00 -06:00
Ryan Richard
d020de4b3d update fips reference doc 2024-11-27 13:53:00 -06:00
Joshua Casey
dd42f35db0 plog.TestLogger returns a buffer that holds the logs
# Conflicts:
#	internal/controller/apicerts/certs_expirer_test.go
#	internal/plog/plog_test.go
#	internal/plog/testing.go
#	pkg/oidcclient/login_test.go
2024-11-27 13:53:00 -06:00
Joshua Casey
a67af9455b Refactor: don't copy the loop variable in test loops 2024-11-27 13:53:00 -06:00
Joshua Casey
d729c82f84 fix lint 2024-11-27 13:53:00 -06:00
Joshua Casey
44e218194b Add 'AuthorizeID From Parameters' audit logs to the /callback and /login endpoints
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-11-27 13:53:00 -06:00
Joshua Casey
bf1e37f149 Use a helper to verify audit messages 2024-11-27 13:53:00 -06:00
Joshua Casey
aee56c388f Check the sessionID as well
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-11-27 13:53:00 -06:00
Joshua Casey
fd5a10bee7 WIP: Add audit event when upstream redirect occurs and backfill tests 2024-11-27 13:53:00 -06:00
Joshua Casey
b20e890f15 Add testutil.RequireLogLines to verify multiple log lines at once 2024-11-27 13:53:00 -06:00
Ryan Richard
4f9530eec7 audit logging WIP 2024-11-27 13:53:00 -06:00
Joshua Casey
615b60bd37 Merge pull request #2143 from vmware-tanzu/rr/kube-cert-agent-for-unschedulable-nodes
Some checks failed
CodeQL / Analyze (go) (push) Failing after 24m0s
CodeQL / Analyze (javascript) (push) Failing after 4m25s
Cert agent controller avoids locating the agent pod on unschedulable nodes when possible
2024-11-27 12:27:33 -06:00
Joshua Casey
e61afcd109 Merge branch 'main' into rr/kube-cert-agent-for-unschedulable-nodes 2024-11-27 10:05:20 -06:00
Joshua Casey
6ac5446940 Merge pull request #2142 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-27 09:46:46 -06:00
Pinny
0706681180 Bump dependencies 2024-11-27 14:03:34 +00:00
Ryan Richard
e44d70b41d kube cert agent controller avoids unschedulable nodes when possible 2024-11-25 14:20:12 -08:00
Joshua Casey
4bf810cb8f Merge pull request #2139 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 20m49s
CodeQL / Analyze (javascript) (push) Failing after 4m51s
Bump dependencies
2024-11-21 12:13:23 -06:00
Pinny
c791db4c52 Bump dependencies 2024-11-21 14:04:17 +00:00
Joshua Casey
e86f3cc594 Merge pull request #2123 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 11m50s
CodeQL / Analyze (javascript) (push) Failing after 11m59s
Bump dependencies
2024-11-15 10:10:21 -06:00
Pinny
be6243c446 Bump dependencies 2024-11-15 14:01:52 +00:00
Joshua Casey
4263ee52f3 Merge pull request #2121 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-14 10:59:03 -06:00
Pinny
d6f1c91b9c Bump dependencies 2024-11-14 14:02:35 +00:00
Joshua Casey
105dc4a249 Merge pull request #2119 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 9m32s
CodeQL / Analyze (javascript) (push) Failing after 13m34s
Bump dependencies
2024-11-13 14:21:09 -06:00
Pinny
aa80c8d0b2 Bump dependencies 2024-11-13 14:02:04 +00:00
Joshua Casey
7c9bdfb96e Merge pull request #2109 from vmware-tanzu/pinny/bump-deps
Some checks failed
CodeQL / Analyze (go) (push) Failing after 8m14s
CodeQL / Analyze (javascript) (push) Failing after 7m34s
Bump dependencies
2024-11-12 14:06:35 -06:00
Pinny
84b3c0ad31 Bump dependencies 2024-11-12 14:01:57 +00:00
Joshua Casey
f2538689e7 Merge pull request #2107 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-11 10:51:36 -06:00
Pinny
66eb7735dd Bump dependencies 2024-11-11 14:01:16 +00:00
Ryan Richard
33edb7ea15 Merge pull request #2101 from vmware-tanzu/jtc/plog-testlogger-returns-buffer
plog.TestLogger returns a buffer instead of taking one in
2024-11-08 14:08:15 -08:00
Joshua Casey
f3c9be07c0 Bump dependencies 2024-11-08 14:15:05 -06:00
Joshua Casey
0c131f11f8 plog.TestLogger returns a buffer instead of taking one in 2024-11-07 17:46:01 -06:00
Ryan Richard
dc86c9305c Merge pull request #2100 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-07 15:18:18 -08:00
Pinny
36ff99882f Bump dependencies 2024-11-07 12:56:53 -08:00
Joshua Casey
3ed4b1c132 Merge pull request #2095 from vmware-tanzu/update_test_expectation_for_kube_prerelease
update test expectation to match new validation error text in new Kube
2024-11-06 17:40:59 -06:00
Ryan Richard
8fad2c5127 update test expectation to match new validation error text in new Kube 2024-11-06 13:57:15 -08:00
Pinny
a25749f087 Updated versions in docs for v0.35.0 release 2024-11-06 20:50:55 +00:00
Joshua Casey
248b1ef947 Merge pull request #2094 from vmware-tanzu/fix_test_flake
fix test flake by removing memory limit from test pod
2024-11-06 13:42:37 -06:00
Ryan Richard
feef4bf508 fix test flake by removing memory limit from test pod
On AKS clusters, the pod's container would exceed its memory limit,
get OOMKilled, get restarted, and cause that test to flake.

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-11-06 09:56:36 -08:00
Joshua Casey
aa70ff13f4 Merge pull request #2093 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-05 16:21:04 -06:00
Joshua Casey
8a6c64095d Pin sigs.k8s.io/structured-merge-diff/v4s to the version used in k8s.io/apimachinery@v0.31.2 2024-11-05 09:05:14 -06:00
Pinny
ea40ffef06 Bump dependencies 2024-11-05 14:01:27 +00:00
Joshua Casey
44d9dc7440 Merge pull request #2092 from vmware-tanzu/acceptance_cluster_flake
add SAN to default cert in supervisor_discovery_test.go
2024-11-05 07:05:05 -06:00
Ryan Richard
fedb9812bd add SAN to default cert in supervisor_discovery_test.go 2024-11-04 17:34:53 -08:00
Ryan Richard
febbee347b Merge pull request #2090 from vmware-tanzu/jwtauthenticator_bug
Bug fix: JWTAuthenticator must reload when spec.audience or spec.claims changes
2024-11-04 17:32:38 -08:00
Ryan Richard
a7edbd19ad run codegen again after updating version of controller-gen in CI 2024-11-04 15:36:24 -08:00
Ryan Richard
c39b2fe03d run codegen after updating kube-versions.txt in previous commit 2024-11-04 13:26:04 -08:00
Ryan Richard
1e23f94b36 update kube-versions.txt 2024-11-04 13:20:09 -08:00
Ryan Richard
106a480dad JWTAuthenticator must reload when spec.audience or spec.claims changes 2024-11-04 12:49:18 -08:00
Joshua Casey
587e6fbd8a Merge pull request #2088 from vmware-tanzu/remove_replace
remove replace directives made unnecessary by recent dep bumps
2024-11-04 12:42:28 -06:00
Ryan Richard
dc2275099a remove replace directives made unnecessary by recent dep bumps 2024-11-04 08:53:57 -08:00
Joshua Casey
bcb9175aa8 Merge pull request #2086 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-11-04 10:19:47 -06:00
Pinny
dd71de9aa1 Bump dependencies 2024-11-04 14:01:28 +00:00
Ryan Richard
1c4fe6e406 Merge pull request #2084 from vmware-tanzu/update_replace_directives
update replace directives in go.mod
2024-10-31 15:52:57 -07:00
Ryan Richard
697757ba8e update replace directives in go.mod 2024-10-31 13:53:59 -07:00
Joshua Casey
774df36f41 Merge pull request #2082 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-30 10:20:15 -05:00
Pinny
a092b68f61 Bump dependencies 2024-10-30 13:01:38 +00:00
Joshua Casey
2587b0a8ad Merge pull request #2077 from vmware-tanzu/migrate_ci_code
changes related to migrating CI code from private repo to `ci` branch
2024-10-29 16:54:17 -05:00
Ryan Richard
ff0e849730 changes related to migrating CI code from private repo to ci branch 2024-10-29 13:28:47 -07:00
Joshua Casey
c25d30ae88 Merge pull request #2076 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-28 12:42:08 -05:00
Pinny
51bc70a11b Bump dependencies 2024-10-28 13:01:47 +00:00
Joshua Casey
d26e54fd89 Merge pull request #2075 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-25 15:10:36 -05:00
Pinny
fc6bcc2f5b Bump dependencies 2024-10-25 13:01:50 +00:00
Joshua Casey
96f0ea2311 Merge pull request #2074 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-24 12:14:37 -05:00
Pinny
261f4a4e5b Bump dependencies 2024-10-24 13:01:11 +00:00
Joshua Casey
f1e933e7aa Merge pull request #2072 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-23 13:13:53 -05:00
Joshua Casey
590f001f17 Run go generate with new version of mock library 2024-10-23 09:09:41 -05:00
Pinny
88e17c8f86 Bump dependencies 2024-10-23 13:01:00 +00:00
Pinny
009470883e Updated versions in docs for v0.34.0 release 2024-10-16 23:27:23 +00:00
Pinny
99ad89211a Updated versions in docs for v0.33.0 release 2024-10-16 22:42:51 +00:00
Ryan Richard
67841f8e27 Merge pull request #2071 from vmware-tanzu/bump_deps
Rerun codegen after bumping kube and controller-gen patch versions, and bump go dep to `github.com/google/go-github/v66`
2024-10-16 10:02:07 -07:00
Ryan Richard
eb5ed1490c run codegen again after bumping controller-gen to v0.16.4 2024-10-15 14:22:09 -07:00
Ryan Richard
46182f03b3 bump kube patch versions for generated code to latest 2024-10-15 14:06:49 -07:00
Ryan Richard
e37d1444c4 bump to github.com/google/go-github/v66 2024-10-15 14:06:34 -07:00
Ryan Richard
4b1577ab70 Merge pull request #2069 from vmware-tanzu/dial_probes_with_proxy
Dial probes with proxy
2024-10-15 12:42:00 -07:00
Pinny
c235239ee7 Bump dependencies 2024-10-15 10:17:09 -07:00
Ryan Richard
f36298c542 use required headers for GitHub API connection probe request 2024-10-14 11:12:34 -07:00
Pinny
c3afa55738 Bump dependencies 2024-10-14 09:40:51 -07:00
Ryan Richard
5c252fd083 increase allowed delta in test to allow for slower CI workers 2024-10-14 09:32:06 -07:00
Ryan Richard
dc195536d0 also use port number when checking https proxy for WebhookAuthenticator 2024-10-11 14:49:46 -07:00
Ryan Richard
4d2bbac674 use .cluster.local address for LUA (squid cannot resolve .svc addresses) 2024-10-10 14:44:14 -07:00
Ryan Richard
eca8914760 fix integration test for WebhookAuthenticator status conditions 2024-10-10 14:41:49 -07:00
Ryan Richard
2aa30edb88 explicitly define "podSelector" in NetworkPolicies
because Kube API docs say it is not optional
2024-10-10 11:45:16 -07:00
Ryan Richard
4f661aaa69 pay attention to web proxy settings during connection probes
- WebhookAuthenticator will now detect the proxy setting and skip
  dialing the connection probe if it should go through a proxy
- GitHubIdentityProvider will avoid using tls.Dial altogether
  by instead making a real request to the GitHub API as its
  connection probe, because this will respect the proxy settings
2024-10-10 10:41:31 -07:00
Ryan Richard
60cfa470b5 hack/prepare-for-integration-tests.sh has new option to firewall IDPs 2024-10-10 10:41:31 -07:00
Ryan Richard
7a41b74ac1 Merge pull request #2068 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-10 10:01:57 -07:00
Pinny
b400648e56 Bump dependencies 2024-10-10 13:01:47 +00:00
Ryan Richard
d4bb12ec6d Merge pull request #2065 from vmware-tanzu/jtc/dont-leak-goroutines-during-ldap-dial
Check TLS bundle before dialing for performance reasons, and add godoc to clarify intent
2024-10-08 09:06:07 -07:00
Ryan Richard
6fe55a3b48 assume port 443 when not specified in printServerCert() test helper 2024-10-07 13:18:42 -07:00
Joshua Casey
3e72e40af2 Merge pull request #2067 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-10-04 18:05:39 -05:00
Pinny
2501d41d93 Bump dependencies 2024-10-04 19:29:57 +00:00
Joshua T Casey
629f89d95b Check TLS bundle before dialing for performance reasons, and add godoc to clarify intent
Signed-off-by: Ryan Richard <richardry@vmware.com>
2024-10-02 14:54:30 -05:00
Joshua Casey
bb00587bd7 Merge pull request #2064 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-09-30 10:45:01 -05:00
Pinny
973886b683 Bump dependencies 2024-09-30 13:04:24 +00:00
Joshua Casey
4e30bc37f1 Merge pull request #2056 from vmware-tanzu/jtc/tls-dial-should-have-timeout
GitHubIdentityProvider and WebhookAuthenticator should perform `tls.Dial` with a timeout
2024-09-24 16:38:13 -05:00
Joshua Casey
01c2377de0 Refactor tests to use a table 2024-09-24 14:45:07 -05:00
Ashish Amarnath
0fab37c089 Update internal/crypto/ptls/dialer_test.go
ignore lint error on nil context in unit test validating nil context
2024-09-24 14:14:48 -05:00
Joshua Casey
f7fd209f29 Address PR feedback 2024-09-24 14:14:48 -05:00
Joshua Casey
76a116641f Add ptls.Dialer to provide some common configuration for tls.Dial operations 2024-09-24 14:14:48 -05:00
Joshua Casey
1e0f7d8437 Merge pull request #2063 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-09-24 14:11:17 -05:00
Pinny
7295ec661f Bump dependencies 2024-09-24 13:04:13 +00:00
Ashish Amarnath
1a1aac7d09 Merge pull request #2061 from vmware-tanzu/aa/fix-comments
refactor and fix comments
2024-09-23 14:27:00 -07:00
Ashish Amarnath
ab2c2e30cb refactor and fix comments
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-09-19 13:38:12 -07:00
Joshua Casey
65b93f0822 Merge pull request #2059 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-09-16 22:55:42 -05:00
Pinny
da77fb1c3f Bump dependencies 2024-09-16 13:04:19 +00:00
Joshua Casey
d9ccb11092 Merge pull request #2058 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-09-11 10:16:57 -05:00
Pinny
e62f9b2b48 Bump dependencies 2024-09-11 13:03:58 +00:00
Joshua Casey
62d17155ec Merge pull request #2057 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-09-10 18:54:55 -05:00
Joshua Casey
702d5bdc01 Bump golangci-lint to 1.61.0 2024-09-10 15:14:53 -05:00
Pinny
8ee08050cc Bump dependencies 2024-09-10 13:02:05 +00:00
Ashish Amarnath
1d81474d1b Merge pull request #2052 from vmware-tanzu/jtc/bump-all
Bump dependencies and lint
2024-09-06 13:30:00 -07:00
Joshua Casey
00e9b347db Bump BUILD_IMAGE in Dockerfiles 2024-09-05 08:16:36 -05:00
Joshua Casey
72fa369fc9 Integration tests should use PINNIPED_TEST_SUPERVISOR_SERVICE_NAME to decide where to port-forward 2024-09-04 20:52:01 -05:00
Joshua Casey
08abff1cae Bump golanglint-ci to 1.60.3 2024-09-04 20:52:01 -05:00
Joshua Casey
f476259bbf Bump all dependencies 2024-09-04 20:52:01 -05:00
Joshua Casey
c87f091a44 Upcoming k8s versions have an additional extra field in the CSR response
- failure due to https://github.com/kubernetes/kubernetes/pull/125634
2024-09-04 11:23:11 -05:00
Joshua Casey
d165899870 Merge pull request #2049 from vmware-tanzu/log_msg_level
failed upstream OIDC token exchanges should show in log at default log config
2024-09-03 10:50:41 -05:00
Joshua Casey
6c97600174 Merge branch 'main' into log_msg_level 2024-09-03 06:22:09 -05:00
Joshua Casey
3e2f7456c4 Merge pull request #2047 from vmware-tanzu/jtc/bump-to-k8s-1-31
Bump K8s libs to 1.31 and add generated code for 1.31
2024-09-03 06:21:54 -05:00
Joshua Casey
ca9503e4c0 Be sure to update the DEFAULT cert instead of the per-FederationDomain cert when the supervisor is using an IP address 2024-09-02 07:46:15 -05:00
Joshua Casey
dc72a36cb1 Add some logging to debug TLS validation failures with IP addresses 2024-09-01 08:26:23 -05:00
Joshua Casey
18e2024e3f Environment variables with 'https_address' in them should have 'https://' scheme 2024-08-31 17:46:35 -05:00
Joshua Casey
7d83e209c8 Integration tests should expect that the Supervisor hostname might be an IP address 2024-08-31 08:51:31 -05:00
Joshua Casey
1bbfa4984d Test refactor for clarity 2024-08-30 17:50:29 -05:00
Joshua Casey
557dee06f0 Allow the integration tests to set an IP address for the Supervisor issuer
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-30 15:48:04 -05:00
Joshua Casey
c0bab69cd1 Allow the Dex hostname to be set by integration tests
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-30 12:42:03 -05:00
Joshua Casey
f480daf7dc Upgrade all dependencies 2024-08-27 13:31:08 -05:00
Joshua Casey
cf56d808f2 No longer ship or generate code for Kubernetes 1.24 2024-08-27 13:26:40 -05:00
Joshua Casey
b78e2c7ded Update comments for testing 2024-08-27 13:26:40 -05:00
Joshua Casey
9b3bcca15e Add test to confirm that pversion.Get() returns something that utilversion.NewEffectiveVersion can consume 2024-08-27 13:26:40 -05:00
Joshua Casey
f7f25a8815 Refactor pversion_test to use a test table 2024-08-27 13:26:39 -05:00
Joshua Casey
94809ee396 Use a real binary version when setting up the aggregated API servers 2024-08-27 13:26:39 -05:00
Joshua Casey
851855d0ee Upgrade all dependencies 2024-08-27 13:26:39 -05:00
Joshua Casey
2a6a0d2997 Refactor certauthority_test to not need pool.Subjects() 2024-08-27 13:26:39 -05:00
Joshua Casey
c6516af31e Bump dependencies 2024-08-27 13:26:39 -05:00
Joshua Casey
05098c68f6 Refactor kubeclient_test to not use pool.Subjects() 2024-08-27 13:26:39 -05:00
Joshua Casey
a1dafcf45a Refactor provider_test to not use pool.Subjects() 2024-08-27 13:26:39 -05:00
Joshua Casey
0ee8ee80e1 Use sha256.Size 2024-08-27 13:26:39 -05:00
Joshua Casey
436112252d Lint fixes 2024-08-27 13:26:39 -05:00
Joshua Casey
8bd9b94d0a Impersonator server should take in a cancellable context instead of a stop channel 2024-08-27 13:26:39 -05:00
Joshua Casey
504f0dc26f Fix some unit tests 2024-08-27 13:26:38 -05:00
Joshua Casey
c12402ee49 Run code generation for updated K8s versions, including 1.31 2024-08-27 13:26:38 -05:00
Joshua Casey
f09b3c2f72 Bump K8s libs to 1.31 and fix compilation errors 2024-08-27 13:26:38 -05:00
Joshua Casey
90c1f6a8c9 Merge branch 'main' into log_msg_level 2024-08-27 13:03:29 -05:00
Joshua Casey
844c169bdc Merge pull request #2050 from vmware-tanzu/site_footer
Add reference to hosting provider in site's page footer
2024-08-26 11:24:47 -05:00
Ryan Richard
c1930833eb add reference to hosting provider in site's page footer 2024-08-26 09:22:32 -07:00
Ryan Richard
f194594e5b failed token exchanges should show in log at default log config 2024-08-22 10:09:19 -07:00
Joshua Casey
5bb4adea30 Merge pull request #2048 from vmware-tanzu/golang1.23
Upgrade to Go 1.23
2024-08-19 19:21:05 -05:00
Ryan Richard
376b83050a upgrade linter and fix new lint errors 2024-08-19 15:45:32 -07:00
Ryan Richard
bee87395b1 ran update.sh 2024-08-19 15:23:51 -07:00
Ryan Richard
21ee90ae41 unit tests should not depend on real KUBECONFIG env var value to pass 2024-08-19 15:02:10 -07:00
Ryan Richard
d2f00d832e upgrade golang from 1.22.6 to 1.23.0 2024-08-19 14:58:10 -07:00
Ryan Richard
764064716f Merge pull request #2046 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-08-13 11:08:22 -07:00
Pinny
7b051ddc22 Bump dependencies 2024-08-13 10:11:21 -07:00
Joshua Casey
9aac96313a Merge pull request #2045 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-08-12 09:41:14 -05:00
Pinny
fcdb340623 Bump dependencies 2024-08-12 13:02:20 +00:00
Ryan Richard
4301eb6553 Merge pull request #2037 from vmware-tanzu/jtc/refactor-conditions-util
Refactor conditions util
2024-08-09 12:17:09 -07:00
Joshua Casey
649bbc7c4f Merge branch 'main' into jtc/refactor-conditions-util 2024-08-09 11:52:32 -05:00
Joshua Casey
1eb6145080 Merge pull request #2044 from vmware-tanzu/upgrade_lint
upgrade linter from 1.58.1 to 1.59.1: no new linter errors/warnings
2024-08-09 11:52:19 -05:00
Ryan Richard
00f6f39b1c upgrade linter from 1.58.1 to 1.59.1: no new linter errors/warnings 2024-08-09 09:26:02 -07:00
Joshua Casey
d0f5c2c7ab Merge branch 'main' into jtc/refactor-conditions-util 2024-08-09 11:22:59 -05:00
Joshua Casey
1cfb83bca9 Merge pull request #2043 from vmware-tanzu/kube_cert_agent_controller_manager_cli_flags
support alternate controller-manager flags in kubecertagent controller (e.g. for RKE2)
2024-08-09 11:22:45 -05:00
Joshua Casey
4ef705ae0f Merge branch 'main' into jtc/refactor-conditions-util 2024-08-09 10:57:08 -05:00
Ryan Richard
5e6f6a1c50 support alternate controller-manager flags in kubecertagent controller 2024-08-08 15:52:50 -07:00
Ryan Richard
59c36ee972 Merge pull request #2042 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-08-08 14:19:24 -07:00
Pinny
ae3cfad10b Bump dependencies 2024-08-08 19:46:18 +00:00
Joshua Casey
21010b000e Merge pull request #2041 from vmware-tanzu/auto_update_toolchain_directives
Auto-update toolchain directives in all go.mod files
2024-08-08 12:29:51 -05:00
Ryan Richard
4d2b00f612 auto-update toolchain directives in go.mod files
Also ran the auto-formatter on the shell script.
2024-08-08 10:23:28 -07:00
Joshua Casey
bab8b54ed8 Update godoc 2024-08-08 10:38:12 -05:00
Joshua Casey
4bd5db14b4 Refactor branching logic when using an early return 2024-08-08 08:12:41 -05:00
Joshua Casey
4a9136040c Refactor to make it obvious that newCondition is a copy 2024-08-08 08:12:41 -05:00
Joshua Casey
8b97414f3d Refactor to simplify logic 2024-08-08 08:12:41 -05:00
Joshua Casey
1e8e9ecc98 Refactor to use slices helpers instead of harder-to-read loops 2024-08-08 08:12:41 -05:00
Joshua Casey
2d8ab9ff5d Refactor variable name for clarity 2024-08-08 08:12:41 -05:00
Joshua Casey
17f66331ea Refactor parameter names for clarity 2024-08-08 08:12:41 -05:00
Joshua Casey
6bf30bc6b5 Backfill test for existing exported function HadErrorCondition 2024-08-08 08:12:41 -05:00
Joshua Casey
f798777a3b Refactor: reorder parameters to MergeConditions 2024-08-08 08:12:41 -05:00
Joshua Casey
6207121c03 Merge pull request #2038 from vmware-tanzu/ci_doc_update
update cicd.md to discuss using multiple IDPs for human vs bot accounts
2024-08-08 08:12:08 -05:00
Pinny
248994dab6 Updated versions in docs for v0.33.0 release 2024-08-08 04:58:23 +00:00
Ryan Richard
a68db4f0db Merge pull request #2039 from vmware-tanzu/jtc/add-blog-post-for-v0.33.0
Add blog post for v0.33.0 - externally managed CA bundles
2024-08-07 14:58:33 -07:00
Ryan Richard
aad6b676b0 add section to blog post 2024-08-07 14:57:46 -07:00
Joshua Casey
bf91b2045c Add blog post for v0.33.0 - externally managed CA bundles 2024-08-07 14:57:15 -07:00
Ryan Richard
fcf6ec6731 update cicd.md to discuss using multiple IDPs for human vs bot accounts 2024-08-07 10:39:30 -07:00
Ryan Richard
b377040144 Merge pull request #2034 from vmware-tanzu/jtc/older-idps-should-use-unknown-condition-status
OIDC/LDAP/AD IDPs should use unknown condition status
2024-08-06 20:13:02 -07:00
Ryan Richard
c1328d9619 update expectation in supervisor_ldap_idp_test.go 2024-08-06 16:08:25 -07:00
Joshua Casey
f918edd846 Add integration tests to ensure that LDAP/AD conditions with status Unknown if they cannot be validated
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-06 16:08:25 -07:00
Ryan Richard
6b49cd7d28 add Unknown SearchBaseFound status condition for AD only 2024-08-06 16:08:25 -07:00
Joshua Casey
afa3aa2232 LDAP and AD IDPs now always report condition with type LDAPConnectionValid, even if the status is unknown
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-06 16:08:25 -07:00
Joshua Casey
1c59a41cc5 Remove some dead code from LDAP/AD controllers 2024-08-06 16:08:25 -07:00
Joshua Casey
0626b22c70 OIDC Upstream Watcher now reports condition OIDCDiscoverySucceeded with status Unknown if TLS validation fails 2024-08-06 16:08:25 -07:00
Ryan Richard
fbbec507d1 Merge pull request #2036 from vmware-tanzu/bump_codegen
Bump codegen
2024-08-06 15:08:32 -07:00
Ryan Richard
a4b0416174 Merge pull request #2035 from vmware-tanzu/go-github-v62
upgrade github.com/google/go-github from v62 to v63
2024-08-06 15:08:10 -07:00
Ryan Richard
659f33dc55 run codegen for updated kube-versions.txt 2024-08-06 13:53:44 -07:00
Ryan Richard
20ddf553ce update kube-versions.txt 2024-08-06 13:50:25 -07:00
Ryan Richard
7483de5e90 upgrade github.com/google/go-github from v62 to v63 2024-08-06 13:45:38 -07:00
Joshua Casey
9f1d6258a2 Merge pull request #2032 from vmware-tanzu/github_api_host
When testing connection for GitHubIdentityProvider host `github.com`, actually dial `api.github.com`
2024-08-06 12:53:08 -05:00
Ryan Richard
99b59a90b6 run codegen for gihub doc change from previous commit 2024-08-06 08:58:30 -07:00
Ryan Richard
56bf9bad25 GitHubIdentityProvider: document github.com vs. api.github.com
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-06 08:58:30 -07:00
Ryan Richard
229b6a262e when dialing github to test connection, dial api.github.com
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-06 08:58:30 -07:00
Ryan Richard
74d9fb863f Merge pull request #2028 from vmware-tanzu/doc_typo
fix WS1 doc typo
2024-08-06 08:58:00 -07:00
Joshua Casey
e332fb505c Merge branch 'main' into doc_typo 2024-08-06 09:10:21 -05:00
Ashish Amarnath
dafde586ec Merge pull request #2033 from vmware-tanzu/update-comments
fix typo in integration test function comments
2024-08-06 06:50:44 -07:00
Joshua Casey
cb101e4dbe Merge branch 'main' into doc_typo 2024-08-06 08:28:22 -05:00
Ashish Amarnath
6fdfee36fe fix typo in integration test function comments
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 23:33:31 -07:00
Ryan Richard
0787301ddb Merge pull request #1996 from ashish-amarnath/ca-bundles-ref
Implement proposal to allow Pinniped custom resources to ref configmaps or secrets for CA bundles
2024-08-05 14:28:39 -07:00
Ryan Richard
2af510a3ee Revert "add integration test for TLS config validation in GitHubIdentityProvider"
This reverts commit 23129da3e2.
2024-08-05 12:52:41 -07:00
Ryan Richard
fdeca2c026 Revert "add integration test for TLS config validation in OIDCIdentityProvider"
This reverts commit 59402bca7b.
2024-08-05 12:52:29 -07:00
Ryan Richard
23fd15f840 Revert "Add integration tests for tls spec validation in JWTAuthenticator and WebhookAuthenticator"
This reverts commit c3405095b2.
2024-08-05 12:52:21 -07:00
Ryan Richard
06b7d302a2 fix typo in tmpl and run codegen 2024-08-05 11:32:21 -07:00
Ashish Amarnath
b70db9dc03 refactor to use new certificateAuthorityDataSourceKind enum
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ryan Richard
d4ac69d88e run codegen for changes in previous commit 2024-08-05 11:32:21 -07:00
Ryan Richard
59c2295dfd improve api docs for TLSSpec in authenticator and IDP specs
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ryan Richard
4eb9a09385 test more condition message cases in concierge_tls_spec_test.go and supervisor_tls_spec_test.go 2024-08-05 11:32:21 -07:00
Ryan Richard
db2d7c8c50 assert on condition message in concierge_tls_spec_test.go and supervisor_tls_spec_test.go 2024-08-05 11:32:21 -07:00
Ryan Richard
2ebf9d3d00 minor test refactor 2024-08-05 11:32:21 -07:00
Ryan Richard
67de14a3b8 ran codegen on previous commit's changes 2024-08-05 11:32:21 -07:00
Ryan Richard
a40c88ebf3 document allowed enum values and default values in all CR spec fields 2024-08-05 11:32:21 -07:00
Ashish Amarnath
23129da3e2 add integration test for TLS config validation in GitHubIdentityProvider
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ashish Amarnath
59402bca7b add integration test for TLS config validation in OIDCIdentityProvider
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ashish Amarnath
c3405095b2 Add integration tests for tls spec validation in JWTAuthenticator and WebhookAuthenticator
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ryan Richard
2181418cc5 refactor test helpers in supervisor_login_test.go
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ryan Richard
e0235ed190 update docs and change struct name in types_tls.go.tmpl files
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:21 -07:00
Ryan Richard
02e41baa47 small refactors 2024-08-05 11:32:21 -07:00
Ryan Richard
91ef68992c document new CA bundle source option in howto docs 2024-08-05 11:32:20 -07:00
Ashish Amarnath
43964ff7a2 update generated api docs
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ashish Amarnath
19c4acf391 secret/configmap with CA bundle to be created in namespace where pinniped is installed
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
ed502949dd webhookcachefiller and jwtcachefiller always update status when needed
Even when the authenticator is found in the cache, try to update its
status. Failing to do so would mean that the actual status will not
be overwritten by the controller's newly computed desired status.

Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ashish Amarnath
a0c259ffbc update expectation conditions message when CA bundle is not configured
fix a typo where we intended to use a configmap instead of a secret

Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
d6d66faae3 jwtcachefiller now tests for exact log lines and prints when it chooses to not update the status 2024-08-05 11:32:20 -07:00
Ryan Richard
15c84fcc94 extract helper func in jwtcachefiller and webhookcachefiller 2024-08-05 11:32:20 -07:00
Joshua Casey
1438f06c12 webhookcachefiller adds more detail when it chooses to update or not update status conditions 2024-08-05 11:32:20 -07:00
Joshua Casey
ca5bb2170c webhookcontroller should use a logger that is built for each webhook authenticator 2024-08-05 11:32:20 -07:00
Joshua Casey
05a2fd97f8 webhookcontroller now only logs the webhook authenticator name instead of an object
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
dedd51df91 Test Refactor: webhookauthenticator_test checks exact log line equality
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
290676e4d1 improve info/debug log messages for jwtcachefiller & webhookcachefiller
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
8725ab4caa do not make any assumption about OIDC issuer 404 page body in test
Instead of using Dex or Okta, use a fake localhost issuer which
does not exist. This will give a consistent connection error
message. Needed because Dex and Okta return different 404 error
pages, so we can't easily make a test assertion that works for both.

Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
3891f90f43 skip external CA bundle tests when CA bundle is empty
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
9f17ba5ae4 change wording of TLS config loaded success messages 2024-08-05 11:32:20 -07:00
Ashish Amarnath
81d42cb3b9 add unit tests for validatedsettings cache storing ca bundle hash
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
dfef9f470f fix bug in webhookcachefiller caused when status update returns error
Also refactor test assertions regarding log statements in
jwtcachefiller_test.go and webhookcachefiller_test.go

Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
f5da417450 fix bug in jwtcachefiller caused when status update returns error
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
a888083c50 Introduce type alias CABundleHash for the hash of a CA bundle ([32]byte)
Co-authored-by: Ryan Richard <richardry@vmware.com>
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
99cfc4fbce Remove tlsconfigutil.CABundle.IsEqual and ensure that tlsconfigutil.NewCABundle handles nil/empty input
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
fcceeed9fa Refactor tlsconfigutil.CABundle 'getters' to not have 'get' in the name
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
4cf0e46c38 tlsconfigutil.CABundle should generate its own certPool 2024-08-05 11:32:20 -07:00
Joshua Casey
34eff2a2f9 Refactor tlsconfigutil.buildCABundle to make it more clear where the bundle is coming from 2024-08-05 11:32:20 -07:00
Joshua Casey
e82cb2c7ba Refactor tlsconfigutil.getCertPool to return a CABundle and change its name to buildCABundle 2024-08-05 11:32:20 -07:00
Joshua Casey
0711093ccd Add tests for tlsconfigutil.CABundle and all callers should use the constructor 2024-08-05 11:32:20 -07:00
Joshua Casey
15d0006841 Pull tlsconfigutil.CABundle into a separate file 2024-08-05 11:32:20 -07:00
Ashish Amarnath
282b949c24 update jwtcachefiller to use new tlsconfigutil.CABundle type
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ashish Amarnath
005dbf3aa8 refactor tlsconfigutil to return a caBundle type
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ashish Amarnath
a1dcba4731 add unit tests for validatedsettings cache storing ca bundle hash
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Ashish Amarnath
2a62beeb5f store ca bundle hash in validated settings cache
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
242fa8afb2 When reading CA bundle from a secret/configmap, return more specific err
When the bundle does not contain any certs, make the error more
specific.

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
e3ed722252 Minor refactor
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
9a16dc28b7 Fix another integration test 2024-08-05 11:32:20 -07:00
Joshua Casey
de86809b69 Fix some integration tests 2024-08-05 11:32:20 -07:00
Joshua Casey
9420bfde5b webhookcachefiller controller loops over all webhookauthenticators 2024-08-05 11:32:20 -07:00
Ryan Richard
adb460b644 refactor integration test to use proper test table 2024-08-05 11:32:20 -07:00
Ryan Richard
06b47a5792 jwtcachefiller controller loops over all jwtauthenticators
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
ca2dd2d476 refactor InferSupervisorIssuerURL() func; remove a TODO
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
Co-authored-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
60f82d2a55 Fix integration test typo 2024-08-05 11:32:20 -07:00
Ryan Richard
414ff503ef extract some common condition reason string constants 2024-08-05 11:32:20 -07:00
Joshua Casey
4ec5766ea9 Modify Concierge/Superivsor TLS spec integration tests to allow for older K8s versions 2024-08-05 11:32:20 -07:00
Joshua Casey
b7c26c43ca Add LDAPIdentityProvider and ActiveDirectoryIdentityProvider to the Supervisor TLS config static validation integration tests
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
4b2ed52f44 Add GitHubIdentityProvider to the Supervisor TLS config static validation integration tests
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:20 -07:00
Ryan Richard
f381c92f0b Use templates to reduce duplication in concierge_tls_spec_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-05 11:32:20 -07:00
Joshua Casey
3a303cc8fb Supervisor TLS Spec validation integration tests should use helper method 2024-08-05 11:32:20 -07:00
Ryan Richard
09724cfa71 Add unit test: when discovery is already cached for OIDCIdentityProvider 2024-08-05 11:32:20 -07:00
Joshua Casey
d74c2a6e3f Supervisor TLS spec integration tests should use an OIDC issuer url from the test environment 2024-08-05 11:32:19 -07:00
Joshua Casey
0f9352db3b Integration tests should use a helper func to infer Supervisor's downstream issuer URL 2024-08-05 11:32:19 -07:00
Joshua Casey
afec420ce6 Add JWTAuthenticators to the static validation checks for concierge TLS spec 2024-08-05 11:32:19 -07:00
Joshua Casey
d5e3ad9da0 Concierge external TLS static integration tests use the real URL of the deployed local-user-authenticator 2024-08-05 11:32:19 -07:00
Ryan Richard
0f103ed2a4 Add unit tests for external CA bundle in oidc_upstream_watcher_test.go 2024-08-05 11:32:19 -07:00
Joshua Casey
d62d6a1f27 Refactor github_controller_watcher to simplify the tls Dial 2024-08-05 11:32:19 -07:00
Ryan Richard
a4ad5d68a9 Fix *_tls_spec_test.go for old versions of Kubernetes
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-05 11:32:19 -07:00
Ryan Richard
30c0fd479e Fix e2e_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-05 11:32:19 -07:00
Ryan Richard
756966c55b add "Status" printer column to JWTAuthenticator and WebhookAuthenticator 2024-08-05 11:32:19 -07:00
Joshua Casey
288e092d2e GitHub IDP watcher should not dial an address that has already been validated 2024-08-05 11:32:19 -07:00
Ryan Richard
72745cd8fe run codegen to update copyrights 2024-08-05 11:32:19 -07:00
Ryan Richard
8060e82745 include external CA bundles in the cache key in oidc_upstream_watcher.go 2024-08-05 11:32:19 -07:00
Ryan Richard
373713f7e0 webhook controller redoes validations when external CA bundle changes 2024-08-05 11:32:19 -07:00
Joshua Casey
66401b42d8 Add GitHubIDP tests for a CA bundle in a Secret or a ConfigMap 2024-08-05 11:32:19 -07:00
Joshua Casey
2d5943b21a Move conditions reason Success to conditions_util 2024-08-05 11:32:19 -07:00
Ryan Richard
920b519ebf error when CA bundle from Secret or ConfigMap is empty
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-08-05 11:32:19 -07:00
Joshua Casey
bf1c02d328 jwtauthenticator controller redoes validations when external CA bundle changes
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:19 -07:00
Joshua Casey
6e9023e090 add code review todos and light refactoring
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
1b7a26d932 test secret and configmap filtering in concierge authenticator controllers
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
cb4b63f8b3 integration tests for concierge authenticators
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
8eb15a924f integration tests for supervisor oidc, ldap, activedirectory IDP
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
6a610a9d51 add namespace to jwt authenticator controller
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
821a893f70 integration tests for supervisor oidc, ldap, activedirectory IDP
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
afcd80de37 more integration tests pass
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
edc327ba33 update supervisor RBAC to allow get, list, and watch on configmaps
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
90e8cc86c2 integration tests pass 2024-08-05 11:32:19 -07:00
Ashish Amarnath
9ab7c39d56 jwt cache filler
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
207bac9452 webhook cache filler
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
199562fd05 get all supervisor unit tests to pass
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
3a969a83b7 update supervisor controllers
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
aab1ee9edc unify TLS Spec between supervisor and concierge
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
080c75efe6 refactor tls spec validation into its own package
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
7e6dadb508 add CRD validation integration tests
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
19c3f2cb04 run hack/update.sh
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:19 -07:00
Ashish Amarnath
842f14af4c update go templates for TLSSpec for concierge and supervisor
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-08-05 11:32:18 -07:00
Joshua Casey
05c258026a Merge branch 'main' into doc_typo 2024-08-05 13:31:05 -05:00
Joshua Casey
1bb38911dc Merge pull request #2030 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-08-05 13:23:30 -05:00
Joshua Casey
ec943fffdc Bump golang.org/x/mod from 0.19.0 to 0.20.0 in /hack/update-go-mod 2024-08-05 12:08:46 -05:00
Pinny
ae1d182b30 Bump dependencies 2024-08-05 13:01:14 +00:00
Joshua Casey
82c056b955 Merge branch 'main' into doc_typo 2024-08-02 16:05:03 -05:00
Joshua Casey
7acc2aa383 Merge pull request #2026 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-08-02 16:04:46 -05:00
Ryan Richard
4e6a39ed11 fix WS1 doc typo 2024-08-02 09:12:08 -07:00
Pinny
d587c6b10e Bump dependencies 2024-08-02 13:02:39 +00:00
Ryan Richard
51c5a05ea7 Merge pull request #2024 from vmware-tanzu/hack_improvements
small improvements to some hack scripts
2024-08-01 12:50:13 -07:00
Ryan Richard
f0cac8c5d3 small improvements to some hack scripts 2024-08-01 10:00:27 -07:00
Joshua Casey
76f3430c68 Merge pull request #2023 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-31 08:57:24 -05:00
Pinny
0e4f7082b0 Bump dependencies 2024-07-31 13:02:19 +00:00
Ashish Amarnath
66f005f275 Merge pull request #2022 from ashish-amarnath/host-name-case-insensitve
make host name parsing case-insensitive
2024-07-30 10:31:48 -07:00
Joshua Casey
bc10d500b7 Merge branch 'main' into host-name-case-insensitve 2024-07-30 09:27:45 -05:00
Ashish Amarnath
7c7f0fdae3 make host name parsing case-insensitive
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-07-29 14:32:01 -07:00
Joshua Casey
4fa901c017 Merge pull request #2021 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-29 09:52:44 -05:00
Pinny
fd11c37825 Bump dependencies 2024-07-29 13:02:10 +00:00
Joshua Casey
f1b82dbf1f Merge pull request #2020 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-26 15:39:47 -05:00
Pinny
8891455e10 Bump dependencies 2024-07-26 13:03:12 +00:00
Joshua Casey
5540f25932 Merge pull request #2019 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-24 09:45:57 -05:00
Pinny
ee9bbbe50b Bump dependencies 2024-07-24 13:02:40 +00:00
Joshua Casey
e013c90993 Merge pull request #2018 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-22 10:54:22 -05:00
Pinny
fa85be4b94 Bump dependencies 2024-07-22 13:02:35 +00:00
Ryan Richard
276cba08ee Merge pull request #2015 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-19 06:54:49 -07:00
Pinny
0e312c88c1 Bump dependencies 2024-07-19 13:01:19 +00:00
Ryan Richard
00301e3642 Merge pull request #2013 from vmware-tanzu/authenticators_bugfix
fix authenticators bug: stop allowing usage when validation fails
2024-07-17 11:35:24 -07:00
Ryan Richard
a2be4b7b5e clarify some comments based on PR feedback 2024-07-17 09:58:26 -07:00
Ryan Richard
b5a509f27f fix authenticators bug: stop allowing usage when validation fails 2024-07-16 09:59:19 -07:00
Ryan Richard
6b722a14c8 Merge pull request #2014 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-16 09:38:58 -07:00
Pinny
dd0c805b09 Bump dependencies 2024-07-16 13:01:44 +00:00
Ryan Richard
6c35490cfb Merge pull request #2012 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-15 09:48:11 -07:00
Pinny
19a04ea804 Bump dependencies 2024-07-15 13:02:37 +00:00
Ryan Richard
a9a63914b2 Merge pull request #2008 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.19.0
Bump golang.org/x/mod from 0.18.0 to 0.19.0 in /hack/update-go-mod
2024-07-12 09:00:02 -07:00
Ryan Richard
b7d1c3f5f6 Merge pull request #2010 from vmware-tanzu/remove_warning
remove unnecessary warning log message
2024-07-12 08:59:45 -07:00
Ryan Richard
a8ccdbc833 Merge pull request #2011 from vmware-tanzu/update_toolchain
update Go toolchain directives to match current version of Go
2024-07-12 08:59:29 -07:00
Ryan Richard
decf1cf537 update Go toolchain directives to match current version of Go 2024-07-10 10:27:39 -07:00
Ryan Richard
e5cfa521da remove unnecessary warning log message
This message is not needed because the IDP chooser page will take
care of the case where a browser-based authorization flow did not
request any specific IDP. For browserless flows (only allowed for
the `pinniped-cli` client), the client must request a specific IDP
(except in backwards-compatibility mode) because there is no browser
in which to show the IDP chooser page. Failing to request a specific
IDP in a browserless flow will result in a helpful error message
being returned.
2024-07-10 09:32:23 -07:00
Ryan Richard
dd80627dfa Merge pull request #2007 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-10 08:58:13 -07:00
Pinny
f79c844c71 Bump dependencies 2024-07-10 13:01:25 +00:00
dependabot[bot]
cb550dfed0 Bump golang.org/x/mod from 0.18.0 to 0.19.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.18.0 to 0.19.0.
- [Commits](https://github.com/golang/mod/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 01:48:54 +00:00
Ryan Richard
602623a0ba Merge pull request #2005 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-02 15:30:16 -07:00
Pinny
6d7646c0a2 Bump dependencies 2024-07-02 13:02:03 +00:00
Ryan Richard
51518aeb03 Merge pull request #2004 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-07-01 10:43:24 -07:00
Pinny
f3e710c814 Bump dependencies 2024-07-01 13:02:17 +00:00
Ryan Richard
b132b14982 Merge pull request #2003 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-27 13:29:03 -07:00
Pinny
6cd45fa81c Bump dependencies 2024-06-27 17:43:41 +00:00
Ryan Richard
95e4b8fcdf Merge pull request #2001 from vmware-tanzu/replace_go-retryablehttp
replace indirect dep go-retryablehttp
2024-06-27 10:23:12 -07:00
Ryan Richard
b4cd64e999 replace indirect dep go-retryablehttp 2024-06-25 11:22:42 -07:00
Ryan Richard
82dbb93e2c Merge pull request #1999 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-24 12:03:08 -07:00
Pinny
b7e12334d6 Bump dependencies 2024-06-24 17:42:49 +00:00
Ryan Richard
a39eac6f1b Merge pull request #1998 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-21 16:10:57 -07:00
Ryan Richard
418ec2a01f Merge pull request #1997 from vmware-tanzu/upgrade_jose_and_coreosoidc
upgrade github.com/go-jose/go-jose and github.com/coreos/go-oidc
2024-06-21 13:10:45 -07:00
Ryan Richard
0380a9ce33 upgrade github.com/go-jose/go-jose and github.com/coreos/go-oidc
Also standardize some related imports and fix some whitespace in a test
2024-06-21 11:16:40 -07:00
Pinny
ed338d1455 Bump dependencies 2024-06-21 13:05:15 +00:00
Ryan Richard
10699314d4 Merge pull request #1995 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-20 09:01:59 -07:00
Pinny
1f7b6133cd Bump dependencies 2024-06-20 13:02:20 +00:00
Ashish Amarnath
3c0ed4d5e3 Merge pull request #1984 from vmware-tanzu/jtc/add-proposal-for-secret-ref-ca-bundles
Add proposal for CA bundles to be sourced from configmaps or secrets
2024-06-19 16:21:47 -07:00
Ashish Amarnath
e38f0824dc update proposal for CA bundles from secret and configmap refs
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
2024-06-19 16:19:31 -07:00
Ryan Richard
a7d2c50550 Merge pull request #1993 from vmware-tanzu/local_demo
add local demo tutorial to site
2024-06-19 14:21:43 -07:00
Joshua Casey
9fee276214 Add proposal for CA bundles from secret refs 2024-06-19 13:48:44 -07:00
Ryan Richard
ef7c7d879b add local demo tutorial to site 2024-06-19 13:02:02 -07:00
Pinny
ea64444c8b Updated versions in docs for v0.32.0 release 2024-06-19 19:08:25 +00:00
Ashish Amarnath
84308f3518 Merge pull request #1992 from vmware-tanzu/update_flaky_test
rewrite flaky category test
2024-06-18 10:56:26 -07:00
Ryan Richard
88bcdbadce rewrite flaky category test 2024-06-18 08:40:56 -07:00
Ryan Richard
b50d1384dc Merge pull request #1991 from vmware-tanzu/update_codegen_kube_versions
bump codegen kube versions
2024-06-17 15:10:09 -07:00
Ryan Richard
b3457271a9 bump codegen kube versions 2024-06-17 11:38:28 -07:00
Ryan Richard
fc6de7e86c Merge pull request #1990 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-17 10:11:31 -07:00
Pinny
6b87bc3fa9 Bump dependencies 2024-06-17 13:02:34 +00:00
Ryan Richard
238df12920 Merge pull request #1952 from vmware-tanzu/jtc/issue-1605-limit-tls-ciphers-for-tls1.2-v2
Allow admin user to further limit TLS ciphers used for TLS1.2 client requests and server ports (not including CLI)
2024-06-14 15:52:52 -07:00
Ryan Richard
f7f32f2f98 some mild refactoring of ptls common.go (mostly renames) 2024-06-14 13:27:38 -07:00
Ryan Richard
1f8ac0ff23 Also probe aggregated API ports in new ciphers test
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-06-14 13:27:38 -07:00
Joshua Casey
75ff3efb59 fix lint 2024-06-14 10:42:17 -07:00
Ryan Richard
f0f9efa277 Refactor to make profiles.go and profiles_fips_strict.go more similar
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-06-14 10:42:17 -07:00
Joshua Casey
4ab2ed10f5 Add integration test for allowed ciphers 2024-06-14 10:42:17 -07:00
Joshua Casey
53031ad8d4 User can now configured allowed ciphers, to restrict the ciphers used by the Default profile 2024-06-14 10:42:17 -07:00
Joshua Casey
ce1ad010e9 Remove Legacy TLS Config, which is not used in the source code 2024-06-14 10:42:17 -07:00
Ryan Richard
5d6dbe1fc3 Merge pull request #1989 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-13 12:22:21 -07:00
Pinny
774504e209 Bump dependencies 2024-06-13 14:57:22 +00:00
Joshua Casey
2275cd5985 Merge pull request #1988 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-12 09:00:06 -05:00
Pinny
3b520d6e93 Bump dependencies 2024-06-12 13:02:54 +00:00
Ryan Richard
80e1fee208 Merge pull request #1949 from vmware-tanzu/jtc/remove-logr-logger
Use plog.Logger instead of logr.Logger wherever possible
2024-06-11 22:17:10 -04:00
Joshua Casey
011d6ba71b Remove plog.Logr, make plog.TestZapr private, and CLI logs do not need a name
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-06-11 17:27:45 -05:00
Joshua Casey
9296d95084 No need for calling code to use deprecated options 2024-06-11 13:09:59 -05:00
Joshua Casey
c6463831ac Use plog.Logger instead of logr.Logger wherever possible 2024-06-11 12:47:19 -05:00
Joshua Casey
247ac10215 Merge pull request #1947 from vmware-tanzu/jtc/add-importas-linter
Enforce import aliases
2024-06-11 12:27:57 -05:00
Joshua Casey
678be9902a Lint new files from the GitHub branch 2024-06-11 10:16:18 -05:00
Joshua Casey
bafd578866 Merge branch 'main' into jtc/add-importas-linter 2024-06-11 09:39:48 -05:00
Ryan Richard
8ac2dc2e9e Merge pull request #1986 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-10 11:04:51 -04:00
Pinny
5689bf621c Bump dependencies 2024-06-10 13:02:50 +00:00
Joshua Casey
ae1cf53dcf Merge pull request #1981 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.18.0
Bump golang.org/x/mod from 0.17.0 to 0.18.0 in /hack/update-go-mod
2024-06-06 20:33:49 -05:00
Joshua Casey
ced019291b Merge branch 'main' into dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.18.0 2024-06-06 16:06:46 -05:00
Joshua Casey
b483409c63 Merge pull request #1983 from vmware-tanzu/handle_another_github_interstitial
handle another github login interstitial page
2024-06-06 16:00:58 -05:00
Ryan Richard
1fe6f2eff9 update toolchain version in some go.mod files 2024-06-06 14:00:22 -04:00
Ryan Richard
07f8c327e4 handle another githug login interstitial page 2024-06-06 14:00:22 -04:00
Pinny
e9fa98edfb Updated versions in docs for v0.31.0 release 2024-06-06 15:45:25 +00:00
Ryan Richard
6c102f09f2 Merge pull request #1980 from vmware-tanzu/v31_blog_post
blog post for v0.31.0: github IDP support
2024-06-06 11:34:27 -04:00
Ryan Richard
ea9d06c819 blog post for v0.31.0: github IDP support 2024-06-06 11:26:28 -04:00
Ryan Richard
05fb8b75ef Merge pull request #1982 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-05 12:24:13 -05:00
Pinny
ee2aa9ce50 Bump dependencies 2024-06-05 13:00:42 +00:00
dependabot[bot]
8b1bf8d4f9 Bump golang.org/x/mod from 0.17.0 to 0.18.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.17.0 to 0.18.0.
- [Commits](https://github.com/golang/mod/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 01:50:41 +00:00
Ryan Richard
ca9560effb Merge pull request #1978 from vmware-tanzu/github_identity_provider
Add GitHubIdentityProvider and support browser-based auth in the Pinniped Supervisor
2024-06-04 10:26:46 -07:00
Ryan Richard
6b64a8a9c6 ran update.sh to update generated code 2024-06-03 16:48:57 -07:00
Ryan Richard
dd3c1ac3cf Merge branch 'main' into github_identity_provider 2024-06-03 16:40:36 -07:00
Ryan Richard
16c8911dfd Merge pull request #1979 from vmware-tanzu/update_codegen_kube_versions
update kube versions for codegen
2024-06-03 16:39:52 -07:00
Ryan Richard
8ea9ba8860 ran go generate to update mocks 2024-06-03 14:48:06 -07:00
Ryan Richard
1d8decfdad ran update.sh to update generated code 2024-06-03 14:30:53 -07:00
Ryan Richard
57431ce6c2 update kube versions for codegen 2024-06-03 14:20:00 -07:00
Ryan Richard
01723e0d12 Merge branch 'main' into github_identity_provider 2024-06-03 13:21:32 -07:00
Joshua Casey
8733a24ebf Merge pull request #1976 from vmware-tanzu/resolve_github_todos
Resolve remaining GitHub todos
2024-06-03 13:54:13 -05:00
Joshua Casey
58b4ecc0aa user sees error msg when GitHub login is denied due to allowed orgs
Also renamed an interface function from GetName to GetResourceName.

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-06-03 10:56:28 -07:00
Joshua Casey
b43b8439c4 Merge pull request #1977 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-06-03 12:06:07 -05:00
Pinny
f2747ef4e7 Bump dependencies 2024-06-03 13:03:02 +00:00
Ryan Richard
e3d8c71f97 sleep longer before generating any GitHib OTP codes 2024-05-31 12:03:36 -07:00
Ryan Richard
0ace5cf477 update github proposal doc to reflect current status 2024-05-31 09:59:50 -07:00
Ryan Richard
6364ac9ac7 change status condition type name to be "ClientCredentialsSecretValid"
For both GitHubIdentityProvider and OIDCIdentityProvider to make them
consistent with each other.
2024-05-31 09:59:30 -07:00
Ryan Richard
e89daadfcf dump debugging info when a browser-based test fails 2024-05-31 09:09:24 -07:00
Joshua Casey
eee737186f Clean up how lastTransitionTime and observedGeneration are checked in github_upstream_watcher_test 2024-05-30 21:34:29 -05:00
Ryan Richard
c5b54ec27e resolve a todo in supervisor_discovery_test.go 2024-05-30 14:48:35 -07:00
Joshua Casey
2ad43789cc Merge pull request #1975 from vmware-tanzu/another_github_doc_change
mention GitHubIdentityProvider in some more website documentation
2024-05-30 16:32:55 -05:00
Ryan Richard
38a90fa01e mention GitHubIdentityProvider in some more website documentation 2024-05-30 14:21:33 -07:00
Joshua Casey
037fa65c63 Merge pull request #1963 from vmware-tanzu/github-issues-downstream-tokens
Issue and refresh downstream ID tokens derived from a GitHub IDP
2024-05-30 16:16:37 -05:00
Joshua Casey
de68594fd6 Merge pull request #1974 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-30 12:03:49 -05:00
Ryan Richard
6327f51f5b repeat same github int tests using OAuth client in supervisor_login_test 2024-05-30 09:58:10 -07:00
Joshua Casey
781ee82b9d Merge branch 'main' into pinny/bump-deps 2024-05-30 11:15:35 -05:00
Ryan Richard
34d02466d9 Merge pull request #1973 from vmware-tanzu/jtc/use-dependabot-for-major-versions-only
Use dependabot to automate major-only dependency bumps
2024-05-30 07:44:33 -07:00
Pinny
8dd34d9ea9 Bump dependencies 2024-05-30 13:01:05 +00:00
Joshua Casey
3c0bad9ea2 Use dependabot to automate major-only dependency bumps 2024-05-29 17:37:25 -05:00
Ryan Richard
2bf11ffde1 update error message assertion for github in supervisor_login_test.go 2024-05-29 09:45:43 -07:00
Ryan Richard
bb9cb739c6 more unit tests for github in token_handler_test.go 2024-05-29 08:55:41 -07:00
Joshua Casey
cc8d637715 Fix lint 2024-05-28 20:33:55 -05:00
Joshua Casey
eafc9ad78c Merge pull request #1970 from vmware-tanzu/use_latest_dir_for_api_docs
use "latest" dir for API docs in doc URLs on the web site
2024-05-28 18:10:22 -05:00
Ryan Richard
c1719c8f1a use "latest" dir for API docs in doc URLs on the web site 2024-05-28 15:59:40 -07:00
Joshua Casey
d3fb567fdb Add callback_handler tests for GitHub+IdentityTransformations
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 15:59:52 -05:00
Joshua Casey
8b1e5aa320 Add callback_handler tests to confirm GitHub with downstream form_post and GitHub with an error case
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 15:17:04 -05:00
Joshua Casey
37e654faa0 bunch of renames
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 13:41:52 -05:00
Joshua Casey
7c73b5e3df Merge pull request #1969 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-27 11:49:02 -05:00
Pinny
6a9661b374 Bump dependencies 2024-05-27 13:03:01 +00:00
Joshua Casey
6429164852 Merge pull request #1968 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-24 08:55:22 -05:00
Pinny
fa68cbbe4e Bump dependencies 2024-05-24 13:02:57 +00:00
Ryan Richard
f323690049 refactor upstream refresh test helpers to be more specific to IDP type 2024-05-23 13:35:31 -07:00
Joshua Casey
02ffff01d5 fix lint 2024-05-23 12:32:18 -05:00
Joshua Casey
2cdeb85cd6 Merge pull request #1967 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-23 12:29:41 -05:00
Pinny
6ea7c48ae9 Bump dependencies 2024-05-23 13:01:01 +00:00
Joshua Casey
65682aa60d Add sample unit test for GitHub in token_handler_test.go 2024-05-22 23:04:15 -05:00
Ryan Richard
bb1737daec slow down github integration tests to avoid OTP reuse errors from github 2024-05-22 21:21:45 -05:00
Ryan Richard
fef494949f implement upstream refresh for github 2024-05-22 21:21:45 -05:00
Ryan Richard
0a15d488c8 Merge callback_handler_github_test.go into callback_handler_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
e69eb46911 Add github integration tests to supervisor_login_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
8f8db3f542 Make github org comparison case-insensitive, but return original case
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
8923704f3c Finish initial github login flow
Also:
- fix github teams query: fix bug and sort/unique the results
- add IDP display name to github downstream subject
- fix error types returned by LoginFromCallback
- add trace logs to github API results
- update e2e test
- implement placeholder version of refresh for github
2024-05-22 21:21:45 -05:00
Joshua Casey
ba2d122308 fix lint 2024-05-22 21:21:45 -05:00
Joshua Casey
938bea9910 upstreamgitub.go now uses githubclient to determine username and groups 2024-05-22 21:21:45 -05:00
Joshua Casey
8719c7a2db Standardize error messages and url handling within NewGitHubClient
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
16fa12f455 Handle empty or invalid github API responses
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
555b1c80e3 Use passed-in context
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
a12a5f387a Empty allowedOrganizations will return all teams
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
c087e33b86 Add client wrapper for github.com/google/go-github/v62 2024-05-22 21:21:45 -05:00
Ryan Richard
49c468f00a Add GetUser() interface and implement LoginFromCallback() for GitHub
ALso fixed some of the GitHub test helpers
2024-05-22 21:21:45 -05:00
Joshua Casey
b7f79f0adc Add github-specific tests in callback_handler_github_test.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
2756a106a9 Merge pull request #1966 from vmware-tanzu/jtc/add-docs-for-github-app
Add docs for GitHub app and GitHub OAuth app
2024-05-22 15:04:38 -07:00
Ryan Richard
efffa0def2 document creating GitHub OAuth App 2024-05-22 15:03:09 -07:00
Joshua Casey
6beb1c135c Add docs for GitHub App configuration on github.com 2024-05-22 16:25:42 -05:00
Joshua Casey
24ab2e85e5 Merge pull request #1965 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-22 13:27:11 -05:00
Joshua Casey
c6749560b5 Fix plog test assertions that contain the plog library version 2024-05-22 09:35:16 -05:00
Pinny
a0160b8e47 Bump dependencies 2024-05-22 13:01:15 +00:00
Joshua Casey
2f9df8c8e2 Add module generate command and update all generated files 2024-05-21 10:43:52 -05:00
Joshua Casey
0076f1251c Move all mock files into internal/mocks and use mock prefix 2024-05-21 10:38:25 -05:00
Joshua Casey
fe911a7b7a Prefer slices package and slices.Concat where possible 2024-05-21 09:31:16 -05:00
Joshua Casey
bdd79a9984 Enforce more imports
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/fake
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/fake
- go.pinniped.dev/generated/latest/client/concierge/informers/externalversions
- go.pinniped.dev/generated/latest/client/supervisor/informers/externalversions
2024-05-21 09:31:15 -05:00
Joshua Casey
513f43f465 Enforce more imports
- go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/scheme
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/scheme
2024-05-21 09:31:15 -05:00
Joshua Casey
f5116cddb4 Enable 'makezero' and 'prealloc' linters, and require 'any' instead of 'interface{}'
Enforce importas:

- go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1
- go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1
2024-05-21 09:31:15 -05:00
Joshua Casey
bbe10004b4 Enforce more imports
- go.pinniped.dev/generated/latest/apis/supervisor/clientsecret/v1alpha1
- go.pinniped.dev/internal/concierge/scheme
2024-05-21 09:31:15 -05:00
Joshua Casey
e9252a9ee3 Enforce more imports
- k8s.io/apimachinery/pkg/apis/meta/v1
- k8s.io/api/core/v1
- github.com/coreos/go-oidc/v3/oidc
- github.com/ory/fosite/handler/oauth2
- go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1
2024-05-21 09:31:15 -05:00
Joshua Casey
875b0739aa Enforce aliases for 'k8s.io/apimachinery/pkg/util/errors' and 'k8s.io/apimachinery/pkg/api/errors' 2024-05-21 09:31:15 -05:00
Joshua Casey
7f56115abc Merge pull request #1964 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-21 08:56:10 -05:00
Pinny
5a29f19faa Bump dependencies 2024-05-21 13:02:31 +00:00
Joshua Casey
ae45e158a3 Merge pull request #1962 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-20 10:02:00 -05:00
Pinny
81c44528ba Bump dependencies 2024-05-20 13:02:19 +00:00
Ryan Richard
9cfb6baaf2 Merge pull request #1961 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-17 14:12:20 -07:00
Pinny
1de902fe8d Bump dependencies 2024-05-17 13:02:24 +00:00
Joshua Casey
7ac141ba08 Merge pull request #1960 from vmware-tanzu/jtc/merge-main-at-3fe3cf71-into-github
Merge main at `3fe3cf71` into `github_identity_provider`
2024-05-16 20:37:42 -05:00
Joshua Casey
fd7838ef2c Add 'github' as an example to the 'pinniped login oidc --upstream-identity-provider-type' help text 2024-05-16 16:22:13 -05:00
Joshua Casey
7ffb1de1c9 Merge branch 'github_identity_provider' into jtc/merge-main-at-3fe3cf71-into-github 2024-05-16 16:07:30 -05:00
Joshua Casey
e4daa5a924 Merge branch 'main' into jtc/merge-main-at-3fe3cf71-into-github 2024-05-16 16:05:34 -05:00
Joshua Casey
147022234e Merge pull request #1959 from vmware-tanzu/github_hack_prepare_supervisor
update hack/prepare-supervisor-on-kind.sh for GitHub IDPs
2024-05-16 16:04:41 -05:00
Ryan Richard
2054708c53 update hack/prepare-supervisor-on-kind.sh for GitHub IDPs 2024-05-16 13:49:53 -07:00
Ryan Richard
3fe3cf71ab Merge pull request #1928 from vmware-tanzu/jtc/add-idp-type-discovery
Add `pinniped_supported_identity_provider_types` to the IDP discovery endpoint
2024-05-16 13:06:38 -07:00
Joshua Casey
7787885463 Add federation domain cleanup in E2E integration test
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-16 14:18:43 -05:00
Ryan Richard
f320980006 Add integration test to prove that 'pinniped login oidc' will infer the flowtype from the Supervisor's IDP discovery
Co-authored-by: Joshua T Casey <caseyj@vmware.com>
2024-05-16 12:57:33 -05:00
Ryan Richard
7e0a3c114d Pinniped CLI and the oidc-client package are now enhanced by pinniped_supported_identity_provider_types
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-16 12:57:12 -05:00
Joshua Casey
a86d7d27c1 Add pinniped_supported_identity_provider_types to the IDP discovery endpoint 2024-05-16 12:55:45 -05:00
Joshua Casey
b00cf65732 Merge pull request #1958 from vmware-tanzu/jtc/merge-main-at-6b3f175-into-github
Merge main at `6b3f175` into `github_identity_provider`
2024-05-16 11:02:50 -05:00
Joshua Casey
69364b2183 Merge branch 'main' into jtc/merge-main-at-6b3f175-into-github 2024-05-16 09:22:28 -05:00
Joshua Casey
6b3f175885 Merge pull request #1957 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-16 08:55:13 -05:00
Pinny
cb7aa561cf Bump dependencies 2024-05-16 13:02:49 +00:00
Joshua Casey
253869ad46 Merge pull request #1954 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-15 14:41:24 -05:00
Pinny
109da32164 Bump dependencies 2024-05-15 17:50:34 +00:00
Joshua Casey
b69c0ac746 Merge pull request #1860 from vmware-tanzu/github_proposal
Add proposal for Authenticating Users via GitHub
2024-05-15 12:11:42 -05:00
Joshua Casey
4cc61c038e Merge pull request #1951 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-15 08:54:31 -05:00
Pinny
ae725feee9 Bump dependencies 2024-05-15 13:02:47 +00:00
Joshua Casey
49a57576dd Merge pull request #1953 from vmware-tanzu/site_and_readme_updates
some small readme and site updates
2024-05-14 14:45:46 -05:00
Ryan Richard
b94b9ad2d8 some small readme and site updates 2024-05-14 09:57:16 -07:00
Joshua Casey
b28e416d0c Merge pull request #1950 from vmware-tanzu/refactor_ptls
refactor ptls to clarify the difference between FIPS and non-FIPS modes
2024-05-13 20:32:43 -05:00
Ryan Richard
e13f4a7f29 refactor ptls to clarify the difference between FIPS and non-FIPS modes
and backfill some basic tests
2024-05-13 16:52:15 -07:00
Joshua Casey
f96cbea521 Merge pull request #1948 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-13 09:33:18 -05:00
Pinny
d4fb9be250 Bump dependencies 2024-05-13 13:01:21 +00:00
Joshua Casey
41cdb6bbaf Merge pull request #1946 from vmware-tanzu/jtc/merge-main-at-d7849c79-to-github
Merge main at `d7849c79` to `github_identity_provider`
2024-05-10 16:35:35 -05:00
Joshua Casey
f43b6f04dc Fix lint issues from golangci-lint 1.58.1 2024-05-10 15:15:59 -05:00
Joshua Casey
791b785dea Merge branch 'main' into jtc/merge-main-at-d7849c79-to-github 2024-05-10 14:22:09 -05:00
Ryan Richard
d7849c793c Merge pull request #1939 from vmware-tanzu/jtc/bump-golangci-lint-to-1-58
Bump golangci-lint to 1.58.1
2024-05-10 12:17:18 -07:00
Joshua Casey
5568372bb9 Do not use v for the version prefix in lint-version.txt 2024-05-10 13:27:15 -05:00
Joshua Casey
cba26c92f5 Remove with_modules from hack/module.sh 2024-05-10 13:12:00 -05:00
Joshua Casey
47de5118f2 Remove deprecated .golangci.yaml options 2024-05-10 12:51:03 -05:00
Joshua Casey
81f3acfa38 Update some build tags since go1.22+ is now required 2024-05-10 12:51:03 -05:00
Joshua Casey
aac48fc308 Enable 'spancheck' linter 2024-05-10 12:51:03 -05:00
Joshua Casey
5635d6c862 Enable 'fatcontext' linter and mark 'canonicalheader' as unusable 2024-05-10 12:51:02 -05:00
Joshua Casey
e9d0ac5110 Enable 'intrange' linter 2024-05-10 12:51:02 -05:00
Joshua Casey
7b36c8ab54 Enable 'copyloopvar' linter 2024-05-10 12:51:02 -05:00
Joshua Casey
e04e5e0185 Fix revive linter issues for all production code, and exclude revive linter issues for test code 2024-05-10 12:51:02 -05:00
Joshua Casey
67d3b5fb82 Fix misspell lint issues 2024-05-10 12:51:01 -05:00
Joshua Casey
c31a0e37bf Add module command lint_with_docker to run lint within docker with a pinned golangci-lint version 2024-05-10 12:51:01 -05:00
Joshua Casey
ab01ce41ed Merge pull request #1929 from vmware-tanzu/ben/github/UpstreamAuthorizeRedirectURL
GitHub upstream authorize redirect url
2024-05-10 12:19:00 -05:00
Ryan Richard
1e6b8a0be0 Merge pull request #1945 from vmware-tanzu/jtc/update-codegen
Bump generated 1.30 toolchains to go1.22.3
2024-05-10 09:22:12 -07:00
Joshua Casey
dba0de88f3 Bump generated 1.30 toolchains to go1.22.3 2024-05-10 09:17:22 -05:00
Ryan Richard
0cdbb710d2 add test for github redirect in auth_handler_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-09 15:35:37 -07:00
Joshua Casey
75f024cb19 Fix lint 2024-05-09 15:35:37 -07:00
Joshua Casey
32e4e0d835 Add TestGenerateOTPCode 2024-05-09 15:35:37 -07:00
Ryan Richard
7c85a511a2 first draft of an e2e integration test for GitHub login (skip while WIP) 2024-05-09 15:35:37 -07:00
Ryan Richard
6be92f92fb bump Supervisor session storage versions 2024-05-09 15:35:37 -07:00
Ryan Richard
7277d00e1a refactor upstreamgithub.ProviderConfig to hold more config 2024-05-09 15:35:37 -07:00
Benjamin A. Petersen
29eb3dd384 Update GitHub UpstreamAuthorizeRedirectURL to generate URLs 2024-05-09 15:35:37 -07:00
Ryan Richard
501ec25f5a Merge pull request #1944 from vmware-tanzu/jtc/merge-main-at-0612654-into-github_identity_provider
Merge main at `0612654` into `github_identity_provider`
2024-05-09 15:04:18 -07:00
Joshua Casey
6ae0c0bd22 Merge pull request #1941 from vmware-tanzu/hack_prepare_webhook
prepare-webhook-on-kind.sh specifies type and name
2024-05-09 16:33:37 -05:00
Joshua Casey
d9c1b104cd Merge branch 'main' into jtc/merge-main-at-0612654-into-github_identity_provider 2024-05-09 16:06:04 -05:00
Joshua Casey
fbf4284866 Merge branch 'main' into hack_prepare_webhook 2024-05-09 15:41:41 -05:00
Pinny
06126544bd Updated versions in docs for v0.30.0 release 2024-05-09 19:41:57 +00:00
Ryan Richard
e9c93305b9 prepare-webhook-on-kind.sh specifies type and name 2024-05-09 12:29:50 -07:00
Ryan Richard
3197156aa1 Merge pull request #1910 from vmware-tanzu/jtc/github_docs
Add GitHub Docs to configure the Supervisor with a GitHub IDP
2024-05-09 11:09:11 -07:00
Ryan Richard
f377292ffe change some wording in github doc 2024-05-09 11:05:48 -07:00
Joshua Casey
ca6a60b534 Merge pull request #1940 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-09 12:10:01 -05:00
Pinny
99755624e8 Bump dependencies 2024-05-09 16:26:27 +00:00
Joshua Casey
96e4442181 Add docs to configure the Supervisor with a GitHub IDP.
- Does not include docs for configuring GitHub Apps or GitHub OAuth Apps
2024-05-08 15:57:21 -05:00
Joshua Casey
bc5eb3cf57 Merge pull request #1938 from vmware-tanzu/skip_auth_url_also_skips_authcode_prompt
CLI also skips authcode prompt when PINNIPED_SKIP_PRINT_LOGIN_URL=true
2024-05-07 15:38:29 -05:00
Ryan Richard
afb032f8f9 Merge branch 'main' into github_identity_provider 2024-05-07 13:08:50 -07:00
Ryan Richard
c86a615713 CLI also skips authcode prompt when PINNIPED_SKIP_PRINT_LOGIN_URL=true 2024-05-07 12:44:38 -07:00
Joshua Casey
c494add2ce Merge pull request #1937 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-07 12:16:43 -05:00
Pinny
f94b1e70fc Bump dependencies 2024-05-07 11:32:13 -05:00
Joshua Casey
42ed11a5cb Merge pull request #1936 from vmware-tanzu/doc_goland
add doc for how to use GoLand to run integration tests
2024-05-06 14:15:35 -05:00
Joshua Casey
a7c6c43112 Merge branch 'main' into doc_goland 2024-05-06 14:15:25 -05:00
Ryan Richard
17d6def081 Merge pull request #1935 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-06 12:15:09 -07:00
Ryan Richard
73e7aeca6e add doc for how to use GoLand to run integration tests 2024-05-06 11:50:39 -07:00
Joshua Casey
305f3f6abe Merge pull request #1934 from vmware-tanzu/admission_plugins_need_v1
only auto-detect version v1 of ValidatingAdmissionPlugin during startup
2024-05-06 12:58:25 -05:00
Pinny
e4d6a72087 Bump dependencies 2024-05-06 09:24:10 -07:00
Ryan Richard
85e5970d6e only auto-detect version v1 of ValidatingAdmissionPlugin during startup 2024-05-06 09:11:39 -07:00
Joshua Casey
424e7406af Merge pull request #1933 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-03 10:28:43 -05:00
Pinny
3e148b629d Bump dependencies 2024-05-03 13:02:36 +00:00
Joshua Casey
545df755b8 Merge pull request #1932 from vmware-tanzu/ben/fuzzing-error-message
Improve Fuzzing error message to remind us to update storage versions
2024-05-02 13:07:55 -05:00
Joshua Casey
e6cb439d9c Merge branch 'main' into ben/fuzzing-error-message 2024-05-02 12:12:18 -05:00
Ryan Richard
879b840ee2 Merge pull request #1931 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-02 09:22:22 -07:00
Ryan Richard
773fad9701 Merge pull request #1926 from vmware-tanzu/jtc/remove-deprecated-deploy-options
Remove deprecated deploy options
2024-05-02 08:57:27 -07:00
Benjamin A. Petersen
fbc3334e8c Improve TestFuzzAndJSONNewValidEmptyAuthorizeCodeSession message 2024-05-02 11:36:24 -04:00
Pinny
0baae51425 Bump dependencies 2024-05-02 13:01:17 +00:00
Ryan Richard
ad7df9f7d1 don't remove user's ability to configure http port to listen on loopback 2024-05-01 12:36:39 -07:00
Joshua Casey
460fbbacc7 Update documentation to remove reference to legacy HTTP ports 2024-05-01 12:36:39 -07:00
Joshua Casey
d67238d46f Remove code related to deprecated config params logLevel and HTTP networking 2024-05-01 12:36:39 -07:00
Joshua Casey
5ec1ee086d Remove deprecated deploy options 2024-05-01 12:36:39 -07:00
Ryan Richard
c0f1e408da Merge pull request #1916 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-01 11:47:13 -07:00
Ryan Richard
0a63dd104d fix test failures caused by dep bump and update replace statements 2024-05-01 11:01:13 -07:00
Benjamin A. Petersen
d34f297b37 Update generated code 2024-05-01 12:59:27 -04:00
Benjamin A. Petersen
e0591500ce Update fuzz test 2024-05-01 12:57:00 -04:00
Benjamin A. Petersen
c43193a0c8 Merge branch 'main' into github_identity_provider 2024-05-01 12:15:08 -04:00
Ben Petersen
0896e7164a Merge pull request #1930 from vmware-tanzu/ben/discovery-test/oidc-and-ldap
IDP Discovery Test improvement: Add OIDC, LDAP
2024-05-01 10:35:26 -04:00
Pinny
070819754f Bump dependencies 2024-05-01 13:01:39 +00:00
Ryan Richard
56d7dee25d Merge pull request #1921 from vmware-tanzu/jtc/use-k8s-1.30
Bump libs to K8s 1.30
2024-04-30 16:16:44 -07:00
Ryan Richard
9d21bcacb6 rerun codegen: adds rest of 1.30 codegen, updates old generated doc files 2024-04-30 14:06:40 -07:00
Ryan Richard
d0781c42dc make codegen work for Kube 1.30 2024-04-30 13:55:27 -07:00
Benjamin A. Petersen
00567645d0 Add conditional AD to IDP discovery test 2024-04-30 15:43:32 -04:00
Benjamin A. Petersen
92b9d68863 Add OIDC, LDAP to supervisor discovery test 2024-04-30 14:19:54 -04:00
Ryan Richard
1f2d2bff71 rerun kube 1.30 codegen after merging main 2024-04-29 14:24:57 -07:00
Ryan Richard
3bdb380a1a don't change public signature of endpointaddr.Parse() 2024-04-29 13:31:49 -07:00
Ryan Richard
1ac2215724 update an assertion in integration test leaderelection_test.go 2024-04-29 13:22:14 -07:00
Ryan Richard
9d92f21638 remove codegen for 1.21, 1.22, 1.23 2024-04-29 13:22:14 -07:00
Ryan Richard
9838a7cb6d avoid the ValidatingAdmissionPolicy admission plugin when it can't work 2024-04-29 13:22:14 -07:00
Ben Petersen
0d709ea8db Merge pull request #1908 from vmware-tanzu/ben/github/identity-provider/federation-domain-resolved-github
Allow GitHub IDP type in FederationDomains
2024-04-29 16:07:51 -04:00
Benjamin A. Petersen
9a21cb9cc7 update code generation 2024-04-29 15:21:35 -04:00
Benjamin A. Petersen
6424f45c19 Add IDP Discovery integration test for GitHub 2024-04-29 14:57:14 -04:00
Joshua Casey
51b1dbd2af WIP for deployment templates 2024-04-26 11:54:53 -07:00
Joshua Casey
9a8df262d9 Code generation: Add 1.30.0 and bump other patch versions 2024-04-26 11:54:53 -07:00
Joshua Casey
9c2df74e54 Adjust to new K8s 1.30 API 2024-04-26 11:54:53 -07:00
Joshua Casey
581f671643 Bump all dependencies 2024-04-26 11:54:53 -07:00
Ryan Richard
b99da0c805 Merge pull request #1914 from vmware-tanzu/configurable_id_token_length
Make ID token lifetime configurable for `OIDCClients`
2024-04-25 15:50:18 -07:00
Benjamin A. Petersen
8a961bfa21 Add upstreamgithub unit tests 2024-04-25 17:02:08 -04:00
Benjamin A. Petersen
cd86d57763 review cleanup, remove TODOs 2024-04-25 17:02:07 -04:00
Benjamin A. Petersen
2753b468fd Update TestSupervisorFederationDomainStatus test 2024-04-25 17:02:07 -04:00
Joshua Casey
be1915d2d7 fixed fuzzing 2024-04-25 17:02:07 -04:00
Benjamin A. Petersen
42ef46b74e expand TestUpstreamGitHubIdentityProvider 2024-04-25 17:02:07 -04:00
Benjamin A. Petersen
79d0e74056 Fix github_upstream_watcher so GitHub is listed in Supervisor idp discovery doc 2024-04-25 17:02:06 -04:00
Benjamin A. Petersen
8de4524428 Add github to kubeconfig.go 2024-04-25 17:02:06 -04:00
Benjamin A. Petersen
8f71f965b9 Add github to login_oidc.go 2024-04-25 17:02:06 -04:00
Benjamin A. Petersen
0e3641bba2 Fix test idp lister 2024-04-25 17:02:06 -04:00
Benjamin A. Petersen
e3aa495e0b Update idp discovery handler test 2024-04-25 17:02:06 -04:00
Benjamin A. Petersen
0edee37498 Update idp discovery types 2024-04-25 17:02:05 -04:00
Benjamin A. Petersen
7968ed6d69 Allow GitHubIdentityProvider IDP type by FederationDomainWatcher 2024-04-25 17:02:05 -04:00
Benjamin A. Petersen
44edba6f75 Add tests for Github in FederationDomain ListerFinder 2024-04-25 17:01:57 -04:00
Benjamin A. Petersen
0c7e95539f Add GitHub to FederationDomain IdP ListerFinder 2024-04-25 16:51:47 -04:00
Ben Petersen
8938990c04 Merge pull request #1925 from vmware-tanzu/jtc/polish-up-github-validations
Polish up GitHub validations
2024-04-25 16:40:24 -04:00
Ryan Richard
57a07a498f Refactors for custom ID token lifetime based on PR feedback 2024-04-24 15:05:00 -07:00
Ryan Richard
136bc7ac09 Mild refactor of integration test for custom ID token lifetimes 2024-04-24 14:13:41 -07:00
Ryan Richard
a1efcefdce Unit tests for token endpoint for custom ID token lifetimes 2024-04-24 14:13:41 -07:00
Ryan Richard
5dbf05c31d Update the session storage versions due to new ID token lifetime field 2024-04-24 14:13:41 -07:00
Ryan Richard
af9612e98e Update more unit tests for configurable token lifetimes 2024-04-24 14:13:41 -07:00
Joshua Casey
b31a893caf Add integration test and fix totalExpectedAPIFields 2024-04-24 14:13:40 -07:00
Joshua Casey
c8bc192e0b Start working on units tests for configurable token lifetimes 2024-04-24 14:13:40 -07:00
Ryan Richard
def2b35e6e Make ID token lifetimes configurable on OIDCClient resources 2024-04-24 14:13:40 -07:00
Joshua Casey
14b1b7c862 Polish up the github_upstream_watcher: default and verify spec.claims correctly 2024-04-24 13:37:40 -05:00
Joshua Casey
c8b90df6f1 Inline using phttp.Default 2024-04-23 18:06:26 -05:00
Joshua Casey
d0bbfca831 Merge pull request #1924 from vmware-tanzu/jtc/merge-main-5fe94c4e-into-github
Merge main (at 5fe94c4e) into `github_identity_provider`
2024-04-23 14:25:02 -05:00
Joshua Casey
fe5d037600 Merge branch 'main' into jtc/merge-main-5fe94c4e-into-github 2024-04-23 12:42:07 -05:00
Ryan Richard
5fe94c4e2b Merge pull request #1922 from vmware-tanzu/clarify_err_msg
clarify error message for when there is no healthy controller manager
2024-04-22 10:15:41 -07:00
Ryan Richard
1d8310ed44 clarify error message for when there is no healthy controller manager 2024-04-22 09:29:37 -07:00
Ryan Richard
c79f8c89d7 Merge pull request #1917 from vmware-tanzu/dial_config
Make WebhookAuthenticators use Pinniped's preferred TLS version and ciphers when testing connection and during authentication attempts
2024-04-19 13:37:32 -07:00
Ryan Richard
7c0c3211d1 fix typo in securetls_fips_test.go 2024-04-19 12:50:05 -07:00
Ryan Richard
0ef98f0558 Use new helpers to assert that all webhook dials use ptls settings 2024-04-19 11:15:59 -07:00
Joshua Casey
94bee9e882 Remove testutil.TLSTestServerWithCert in favor of the testutil/tlsserver package 2024-04-19 10:30:23 -05:00
Joshua Casey
da135d9958 Webhookcachefiller now uses a real tls.Dial, which means we can test IPv6 2024-04-19 09:24:17 -05:00
Joshua Casey
206a16f9e3 Integration test fixes - updated condition messages 2024-04-18 21:32:54 -05:00
Ryan Richard
e048859afd Use ptls package when calling webhook during authentication 2024-04-18 16:00:57 -07:00
Ryan Richard
8c081c50d4 Use ptls package to determine TLS config when probing webhook for status 2024-04-18 12:55:49 -07:00
Ben Petersen
0dc7dfcb50 Merge pull request #1907 from vmware-tanzu/jtc/add-github-idp-validations
Add GitHub IDP validations
2024-04-16 17:09:48 -04:00
Joshua Casey
c9b61ef010 Populate internal GitHub IDP Config from CRD 2024-04-16 14:33:01 -05:00
Joshua Casey
59fef0c1b2 Merge pull request #1913 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-04-12 08:50:23 -05:00
Pinny
23d8a279c4 Bump dependencies 2024-04-12 13:03:21 +00:00
Joshua Casey
349039ff5d Merge pull request #1912 from vmware-tanzu/ben/github/identity-provider/supervisor-hack-script
Add GitHub to Supervisor hack script
2024-04-11 16:01:25 -05:00
Ben Petersen
a72155a57f Update prepare-supervisor-on-kind.sh final polish 2024-04-11 16:51:53 -04:00
Ben Petersen
41f8663dcd Update prepare-supervisor-on-kind.sh & remove hard-coded github claims 2024-04-11 16:50:14 -04:00
Ben Petersen
84007cb1ec Update prepare-supervisor-on-kind.sh add github environment variables 2024-04-11 16:44:58 -04:00
Ben Petersen
265c51b8aa Update prepare-supervisor-on-kind.sh to use vars for github secret 2024-04-11 16:23:18 -04:00
Joshua Casey
f50ab87b53 Merge pull request #1911 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-04-11 13:34:54 -05:00
Benjamin A. Petersen
4c5d041c21 Initial add Github to hack/prepare-supervisor-on-kind.sh 2024-04-11 13:04:45 -04:00
Pinny
df9a06ddfe Bump dependencies 2024-04-11 13:02:28 +00:00
Joshua Casey
55aaf33d94 Merge pull request #1902 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-04-08 07:36:22 -05:00
Joshua Casey
8ea339139e ldap.Conn.Start() is now deprecated as of https://github.com/go-ldap/ldap/releases/tag/v3.4.7 2024-04-08 06:49:03 -05:00
Joshua Casey
e950e7e001 bump deps 2024-04-08 05:41:59 -05:00
Joshua Casey
68339f3acb Bump deps 2024-04-04 21:57:34 -05:00
Joshua Casey
f4660f0250 Merge remote-tracking branch 'origin/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.17.0' into pinny/bump-deps 2024-04-04 21:56:30 -05:00
dependabot[bot]
bf3cda54ba Bump golang.org/x/mod from 0.16.0 to 0.17.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/mod/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 01:44:49 +00:00
Joshua Casey
1b4194373b Pin go-oidc to v3.9.0 2024-04-04 15:52:24 -05:00
Pinny
241093bb96 Bump dependencies 2024-04-04 13:03:04 +00:00
Ben Petersen
ccef7bd1bc Merge pull request #1903 from vmware-tanzu/ben/github/identity-provider/controller
WIP: Add GitHub upstream observer controller
2024-04-02 14:49:07 -04:00
Benjamin A. Petersen
e2db152c6c Stub in TestUpstreamGithubIdentityProvider for unit tests 2024-04-02 13:59:11 -04:00
Benjamin A. Petersen
5c490e999d Stub in unit tests for github_upstream_watcher 2024-04-02 12:38:06 -04:00
Benjamin A. Petersen
a11e1527f0 Add github-upstream-observer Controller 2024-04-02 10:53:26 -04:00
Ben Petersen
6ac11a554a Merge pull request #1900 from vmware-tanzu/jtc/github_idp_crd
First draft of a GitHubIdentityProvider CRD
2024-04-01 17:06:54 -04:00
Joshua Casey
42dd8d1d9d First draft of a GitHubIdentityProvider CRD 2024-04-01 15:10:46 -05:00
Ben Petersen
722f00e485 Merge pull request #1904 from vmware-tanzu/ben/site/debugging-with-kapp-and-ytt-enhancements
Revise log level instructions for kapp and kubectl in docs
2024-04-01 10:34:26 -04:00
Benjamin A. Petersen
67c328f4d0 Revise log level instructions for kapp and kubectl in docs 2024-03-28 12:56:34 -04:00
Joshua Casey
146e61ed03 Merge pull request #1824 from vmware-tanzu/ben/site/pinniped-debug-env
Add Debugging subheading to Install CLI page
2024-03-27 16:17:37 -05:00
Benjamin A. Petersen
6718a32fe4 Site debugging revisions. 2024-03-27 17:12:30 -04:00
Ryan Richard
2af6f4cdf6 Update status in proposal docs to reflect current states 2024-03-27 13:15:24 -07:00
Ryan Richard
60bdd3eccd Update proposal for Authenticating Users via GitHub 2024-03-27 13:15:24 -07:00
Ryan Richard
c1b93179ff Add proposal for Authenticating Users via GitHub 2024-03-27 13:15:24 -07:00
Benjamin A. Petersen
7387f675e2 Add debugging page to docs 2024-03-27 12:42:09 -04:00
Ben Petersen
f0a43e0402 Merge pull request #1894 from vmware-tanzu/ben/status/webhook-authenticator
WebhookAuthenticator .Status and validation improvements
2024-03-26 20:25:35 -04:00
Benjamin A. Petersen
c6b0820438 Fix some utils, spacing, func naming, test inputs, etc. 2024-03-26 16:22:51 -04:00
Benjamin A. Petersen
f86c46e160 Update WebhookAuthenticator Status WebhookConnectionValid
- ConnectionProbeValid -> WebhookConnectionValid
  - This is to conform with the pattern of other controllers, ex:
    LDAPConnectionValid
2024-03-26 15:33:44 -04:00
Ben Petersen
eed0c9d5b0 Update ParseFromURL usage comment.
- Carefully note the rfc27732 design for IPv6 in URLs, while also clarifying the handling of IPv6 in Golang.

Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-03-26 15:32:15 -04:00
Benjamin A. Petersen
e38a27d93d Add endpointaddr.ParseFromURL helper, WebhookAuthenticator handle additional IPv6 cases 2024-03-22 15:57:57 -04:00
Benjamin A. Petersen
b0904c2e99 change TestNewWebhookAuthenticator to test table style 2024-03-20 11:39:55 -04:00
Benjamin A. Petersen
bec5fe85cc change WebhookAuthenticator TLSConnectionNegotiationValid to ConnectionProbeValid 2024-03-19 18:00:40 -04:00
Benjamin A. Petersen
5bc4e678bf WebhookAuthenticator Status integration test refactor to test table 2024-03-19 17:45:26 -04:00
Joshua Casey
90e7343fb5 Add IPv6 test to WebhookAuthenticator ctrl tests
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2024-03-19 16:48:08 -04:00
Benjamin A. Petersen
5c0d67dc50 refactor WebhookAuthenticator newWebhookAuthenticator func 2024-03-19 16:48:08 -04:00
Benjamin A. Petersen
b6512bcbb6 add WebhookCacheFiller updateStatus tests 2024-03-19 16:48:07 -04:00
Benjamin A. Petersen
097e6d5340 Always pass spec to CreateTestWebhookAuthenticator 2024-03-19 16:48:07 -04:00
Benjamin A. Petersen
a45a537cdb Improve JWTAuthenticator validation of Issuer,Discovery 2024-03-19 16:48:06 -04:00
Benjamin A. Petersen
0467e5c1d5 Refactor logLines to SplitByNewline, deduplicate 2024-03-19 16:48:06 -04:00
Benjamin A. Petersen
5c1fa6d52c Adjust testlib/client.go for lint quirk 2024-03-19 16:48:06 -04:00
Benjamin A. Petersen
337459feb0 Update webhook status integration tests
- total api fields test 260->261
2024-03-19 16:48:05 -04:00
Benjamin A. Petersen
590e2d18f7 Add WebhookAuthenticator integration tests, expand unit tests
- Add WebhookAuthenticator unit tests, update generated code
- Add validateTLSNegotiation(), update tests
- Update validateTLSNegotiation, add unit tests, factor out helpers
- Update generated code
2024-03-19 16:48:05 -04:00
Benjamin A. Petersen
ef36b454ba Improve WebhookAuthenticator Status and Validations
- Validate TLS Configuration
- Validate Endpoint
- Validate TLS Negotiation
  - Report status handshake negotiation with webhook
- Unit tests
- Integration tests
2024-03-19 16:48:03 -04:00
Ryan Richard
4465810ff8 Merge pull request #1899 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-18 10:14:33 -07:00
Pinny
d301bc60b7 Bump dependencies 2024-03-18 13:02:27 +00:00
Ryan Richard
6307a3212b Merge pull request #1897 from vmware-tanzu/cli_skip_print_url_env_var
Add PINNIPED_SKIP_PRINT_LOGIN_URL env var to CLI
2024-03-15 13:19:48 -07:00
Joshua Casey
92a082b0f7 Merge branch 'main' into cli_skip_print_url_env_var 2024-03-15 09:51:25 -05:00
Pinny
15627e7803 Updated versions in docs for v0.29.0 release 2024-03-14 22:28:54 +00:00
Ryan Richard
a70ce9cef7 Add PINNIPED_SKIP_PRINT_LOGIN_URL env var to CLI 2024-03-14 11:32:09 -07:00
Pinny
eab6f0d713 Updated versions in docs for v0.28.0 release 2024-03-14 17:36:50 +00:00
Joshua Casey
cc96f85ec7 Merge pull request #1893 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-13 09:46:15 -05:00
Pinny
6557197bae Bump dependencies 2024-03-13 13:03:41 +00:00
Ryan Richard
ed351938d4 Merge pull request #1892 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-12 09:13:47 -07:00
Pinny
718cf234b8 Bump dependencies 2024-03-12 13:02:12 +00:00
Joshua Casey
159b2d50eb Merge pull request #1891 from vmware-tanzu/jtc/use-uber-mock-1778
Use go.uber.org/mock instead of github.com/golang/mock and rerun mock generation
2024-03-11 16:08:50 -05:00
Joshua Casey
bc8aebeffe Use go.uber.org/mock instead of github.com/golang/mock and rerun mock generation 2024-03-11 13:42:30 -05:00
Joshua Casey
135eab037e Merge pull request #1890 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-11 10:26:39 -05:00
Pinny
714aa59a34 Bump dependencies 2024-03-11 13:02:32 +00:00
Ryan Richard
33fe2bcff4 Merge pull request #1880 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.16.0
Bump golang.org/x/mod from 0.15.0 to 0.16.0 in /hack/update-go-mod
2024-03-09 09:35:29 -08:00
dependabot[bot]
665b921d63 Bump golang.org/x/mod from 0.15.0 to 0.16.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/mod/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-09 16:38:21 +00:00
Ryan Richard
b99634764f Merge pull request #1883 from vmware-tanzu/ghcr
Use ghcr instead of Harbor as the default for pinniped-server images
2024-03-08 16:40:17 -08:00
Ryan Richard
4a8cd180f8 Use ghcr instead of Harbor as the default for pinniped-server images
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-03-08 15:52:39 -08:00
Joshua Casey
6c7d3e62dd Merge pull request #1885 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-08 17:28:34 -06:00
Pinny
c4b5476088 Bump dependencies 2024-03-08 14:31:58 -08:00
Ryan Richard
61835e9f08 Merge pull request #1887 from vmware-tanzu/cli_callback_cors_get
CLI's localhost listener handles CORS preflight requests for GETs
2024-03-08 14:24:01 -08:00
Ryan Richard
d49b011d65 Merge branch 'main' into cli_callback_cors_get 2024-03-08 11:36:32 -08:00
Ryan Richard
f881bbb137 Merge pull request #1884 from vmware-tanzu/jtc/new-whoami-identity-document-extra-fields
whoami integration test now allows for additional extra fields in K8s 1.30+
2024-03-08 11:16:23 -08:00
Ryan Richard
f55d56bf4a CLI's localhost listener handles CORS preflight requests for GETs 2024-03-08 10:45:57 -08:00
Joshua Casey
ffc49d96b3 Integration tests should use a valid value for CredentialIssuer spec.impersonationProxy.service.type 2024-03-08 11:19:15 -06:00
Joshua Casey
8a40dda3ab Bump google.golang.org/protobuf to v1.33.0 for CVE-2024-24786 2024-03-08 11:19:15 -06:00
Joshua Casey
ab0682917a whoami integration test now allows for additional extra fields in K8s 1.30+ 2024-03-07 08:09:16 -06:00
Joshua Casey
ed15927d90 Merge pull request #1882 from vmware-tanzu/chrome_debugging
Add some logging and comments making it easier to debug with chrome
2024-03-05 16:15:40 -06:00
Ryan Richard
e43cf81c38 Add some logging and comments making it easier to debug with chrome
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-03-05 13:26:08 -08:00
Ryan Richard
eb08a9f91f Merge pull request #1881 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-05 08:18:47 -08:00
Pinny
9423ff5e48 Bump dependencies 2024-03-05 14:01:54 +00:00
Joshua Casey
df580fcb39 Merge pull request #1879 from vmware-tanzu/replace_otelhttptrace
replace verison of otelhttptrace in go.mod
2024-03-04 17:33:00 -06:00
Ryan Richard
ca58911cc2 replace verison of otelhttptrace in go.mod 2024-03-04 14:38:42 -08:00
Ryan Richard
6afc48849a Merge pull request #1878 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-03-01 09:29:44 -08:00
Pinny
5569b114ba Bump dependencies 2024-03-01 14:02:56 +00:00
Ryan Richard
c8bfe780c7 Merge pull request #1877 from vmware-tanzu/codegen-Feb29
Add generated code for Kube 1.29, update other generated code
2024-02-29 12:57:11 -08:00
Ryan Richard
b79a2ccf7c Add 1.29 and update patch versions in kube-versions.txt; run codegen 2024-02-29 12:00:02 -08:00
Ryan Richard
27d0c58319 Change codegen scripts to work with Kube 1.29
- Also add support for having comments in kube-versions.txt.
- Update boilerplate copyright dates for generated code files.
2024-02-29 11:46:26 -08:00
Ryan Richard
ffadca7f68 Merge pull request #1876 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-28 08:18:08 -08:00
Pinny
62c086a725 Bump dependencies 2024-02-28 14:02:53 +00:00
Ryan Richard
99781443b0 Merge pull request #1851 from vmware-tanzu/ben/status/jwt-authenticator
Improve JWTAuthenticator Status
2024-02-27 16:41:54 -08:00
Ryan Richard
f498cb3918 wait for JWTAuthenticator to be phase=ready in supervisor warnings test 2024-02-27 15:45:33 -08:00
Benjamin A. Petersen
e8482ab9e9 Update jwtauthenticator unit tests to check actions
- Add test to verify timestamps are particularly updated
- Improve diff output in tests for actions
- Make jwtauthenticator status tests parallel
- Update copyright headers in multiple files
2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
868ff9ed2b Update jwk authenticator status integration tests 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
42acf8dcce Add Status & tests for jwks key fetching 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
1c7e7048a8 Update copyright year in modified files 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
73e4d3144b Add integration tests for JWTAuthenticators
- paired with changes to e2e_test.go, adds Status.Condition assertions
  around JWTAuthenticators
2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
1a633adde6 add WaitForJWTAuthenticatorStatusPhase() integration helper 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
09bd51f481 fix comment in testlib/client.go 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
084c3114f4 Improve jwtcachefiller tests
- some format updates
- add timestamp to test
- fix order of expect,actual in some assertions
- remove some commented code no longer needed
2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
47639340ec extract status comparison test helpers 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
fd14a5794e ldap upstream watcher: rename local var for clarity 2024-02-27 15:45:32 -08:00
Benjamin A. Petersen
a4447fa606 Add .Status to JWTAuthenticator with Conditions,Phase
- "Ready" condition & supporting conditions
- Legacy "Phase" for convenience
- Refactor newCachedJWTAuthenticator() func
  to improve ability to provide additional conditions
- Update JWTAuthenticator.Status type
- Update RBAC for SA to get/watch/update JWTAuthenticator.Status
- Update logger to plog, add tests for logs & statuses
- update Sync() to reduce enqueue when error is config/user managed, perhaps remove validateJWKSResponse()
2024-02-27 15:45:32 -08:00
Ryan Richard
f18d7310a8 Merge pull request #1875 from vmware-tanzu/pinny/bump-deps
Bump dependencies (adds gotoolchain to go.mod) and fix CodeQL and unit test races
2024-02-27 15:43:32 -08:00
Ryan Richard
28251f8b92 Update some comments in go.mod 2024-02-27 14:54:26 -08:00
Ryan Richard
50b54580de Fix races in login_test.go units tests 2024-02-27 14:54:05 -08:00
Ryan Richard
d88883328a Update codeql workflow actions to latest versions and add setup-go
See deprecation of v2 message in README.md at
https://github.com/github/codeql-action

Added setup-go because codeql code scanning stopped working and gave
this error message:
The go.mod file requires version v1.21.3 of Go, but version v1.20.14 is installed. Consider adding an actions/setup-go step to your workflow.
2024-02-27 12:26:32 -08:00
Pinny
ca6687d428 Bump dependencies 2024-02-27 14:03:11 +00:00
Ryan Richard
848d83c496 Merge pull request #1874 from vmware-tanzu/cli_checks_if_stderr_is_tty
"login oidc" CLI command sometimes skips printing auth URL for non-ttys
2024-02-26 14:56:24 -08:00
Ryan Richard
5bd73fc10d "login oidc" CLI command sometimes skips printing auth URL for non-ttys 2024-02-23 12:23:07 -08:00
Ryan Richard
40e548ebf0 Merge pull request #1873 from vmware-tanzu/1864_followup
CLI deciding if token exchange needed should not look at ID token expiry
2024-02-23 12:17:54 -08:00
Ryan Richard
64b0e69430 Update configure-concierge-jwt.md doc with clarifications 2024-02-23 08:37:43 -08:00
Ryan Richard
daec673b81 Add hack/prepare-jwtauthenticator-on-kind.sh 2024-02-23 08:37:43 -08:00
Ryan Richard
01d6bdb497 CLI deciding if token exchange needed should not look at ID token expiry
This fixes a small mistake in PR #1864. When the "pinniped login oidc"
CLI command is deciding if the RFC8693 token exchange is needed, it
should not look at the expiry of the ID token. This mistake would cause
the RFC8693 token exchange to happen when the OIDC provider is not
a Pinniped Supervisor, which would fail because most other providers
do not support that type of token exchange.

It does not matter if the current ID token is close to expiring when
deciding if the RFC8693 token exchange is needed, because the token
exchange is going to yield a new ID token anyway. It does matter if the
current ID token is close to expiring if the CLI decides that it is
not going to perform the token exchange, and this commit does not change
that logic.
2024-02-23 08:37:01 -08:00
Ryan Richard
216fce70aa Merge pull request #1872 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-23 06:51:43 -08:00
Pinny
5939ce8cc6 Bump dependencies 2024-02-23 14:00:47 +00:00
Ryan Richard
9471ed2d09 Merge pull request #1871 from vmware-tanzu/always_search_groups
Don't skip upstream group memberships when groups scope is not granted
2024-02-22 08:11:08 -08:00
Ryan Richard
0d31e955ae Don't skip upstream group memberships when groups scope is not granted
Background: For dynamic clients, the groups scope is not always allowed
and/or requested by the client, so it will not always be granted by the
Supervisor for an authorization request.

Previously, when the groups scope was not granted, we would skip
searching for upstream groups in some scenarios.

This commit changes the behavior of authorization flows so that even
when the groups scope is not granted we still search for the upstream
group memberships as configured, and we pass the upstream group
memberships into any configured identity transformations. The identity
transformations could potentially reject the user's authentication based
on their upstream group membership.

When the groups scope is not granted, we don't include the groups in
the final Supervisor-issued ID token. This behavior is not changed.
2024-02-21 13:12:18 -08:00
Ryan Richard
5697bb2915 Merge pull request #1870 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-21 08:07:37 -08:00
Pinny
ca7b27de3f Bump dependencies 2024-02-21 14:02:55 +00:00
Ryan Richard
867468ee66 Merge pull request #1867 from vmware-tanzu/refactor_supervisor_authenticators
Refactor Supervisor to make interface for upstream IDPs, to better separate upstream and downstream concerns
2024-02-20 22:11:52 -08:00
Ryan Richard
4b4a4ad592 Rename a func and collapse applying id transforms into creating session 2024-02-20 14:47:28 -08:00
Ryan Richard
b341e52214 Refactor to move invocation of identity transforms out of IDP interfaces
Each endpoint handler is now responsible for applying the identity
transformations and creating most of the session data, rather than each
implementation of the upstream IDP interface. This shares code better,
and reduces the responsibilities of the implementations of the IDP
interface by letting them focus more on the upstream stuff.

Also refactor the parameters and return types of the IDP interfaces to
make them more clear, and because they can be more focused on upstream
identities (pre-identity transformation). This clarifies the
responsibilities of the implementations of the IDP interface.
2024-02-20 10:45:54 -08:00
Ryan Richard
1e8e7b948e Refactor token endpoint to add interface for IDP upstream refresh 2024-02-20 09:26:34 -08:00
Ryan Richard
1bc13e94f7 Refactor to extract interface for upstream IDP interactions
Create an interface to abstract the upstream IDP from the
authorize, IDP discovery, callback, choose IDP, and login
endpoints. This commit does not refactor the token endpoint,
which will be refactored in a similar way in the next commit.
2024-02-20 09:26:34 -08:00
Ryan Richard
9db87132b1 More refactoring of auth handler and related refactor of upstreamldap
- continued refactoring the auth handler to share more code between
  the two supported browserless flows: OIDC and LDAP/AD
- the upstreamldap package should not know about the concept of
  OIDC granted scopes, so refactored it to be a skipGroups bool
2024-02-20 09:26:34 -08:00
Ryan Richard
9992855cb8 Refactor error handling in authorize endpoint (changes some responses)
- Simplify the error handling in the authorize endpoint by making the
  private helper functions return fosite-style errors, and having
  one place that writes those errors to the response.
- Some types of errors were previously returned as regular http-style
  errors. Those have all been converted to be returned as oauth-style
  errors (which can be redirects to the client), except for http method
  not found errors. This is a change in behavior from the client's point
  of view, but only when those unexpected errors happen. These types of
  errors are more consistent with RFC6749 section 4.1.2.1.
- Avoids using the httperr package for error handling.
- Create a struct for the handler as a first step toward making smaller
  functions with fewer parameters.
2024-02-20 09:26:34 -08:00
Ryan Richard
23dce42a94 Merge pull request #1869 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-20 09:25:16 -08:00
Pinny
edf92303ae Bump dependencies 2024-02-20 15:57:22 +00:00
Ryan Richard
719cd75f64 Merge pull request #1866 from vmware-tanzu/upgrade_fosite_feb_2024
Upgrade fosite to latest version
2024-02-13 11:25:24 -08:00
Ryan Richard
ceb9973657 Correct doc which explained bug that has since been fixed. 2024-02-13 10:16:41 -08:00
Ryan Richard
cf82cf996e Adjust tests and comments for upgrade to latest version of fosite 2024-02-13 10:16:41 -08:00
Pinny
5c702738cf Bump dependencies 2024-02-13 16:44:20 +00:00
Ryan Richard
485b2271f0 Merge pull request #1864 from vmware-tanzu/cli_use_cached_access_token
login oidc cmd checks access token expiry before doing token exchange
2024-02-09 14:21:05 -08:00
Ryan Richard
dce9409ccc login oidc cmd checks access token expiry before doing token exchange
In the RFC8693 token exchange, the CLI sends your access token and
receives in exchange a new cluster-scoped ID token.

Fix a bug in the CLI. Whenever the "pinniped login oidc" command was
planning to perform the RFC8693 token exchange, it failed to check if
the cached access token was still valid before performing the exchange,
which sends the access token. It instead checked if the cached ID token
was still valid, but that it not relevant in this situation because the
ID token is not going to be used for anything (instead the new ID token
returned by the RFC8693 token exchange will be used for auth).

This bug doesn't actually matter today, because the Supervisor-issued
access and ID tokens always both have the same 2-minute lifetimes.
However, future enhancements may cause them to have different lifetimes
in certain circumstances. Fixing this CLI bug now to prepare for those
potential future enhancements.
2024-02-09 13:33:30 -08:00
Ryan Richard
d5ce48bd4b Convert double-quoted strings to raw strings in login_test.go 2024-02-09 08:38:51 -08:00
Ryan Richard
492dfa84d8 Merge pull request #1862 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-09 08:20:58 -08:00
Pinny
e4fddc3596 Bump dependencies 2024-02-09 14:02:39 +00:00
Ryan Richard
ad9d9ce1a5 Merge pull request #1863 from vmware-tanzu/revert_support_for_new_goboring
Upgrade to Go 1.22 and revert support for new goboring
2024-02-08 15:05:38 -08:00
Ryan Richard
904a60f04a Fix ptls_test.go for Go 1.22 2024-02-08 14:13:09 -08:00
Ryan Richard
bf3b4bfca7 Rerun codegen after upgrading CI controller-gen from v0.13.0 to v0.14.0 2024-02-08 13:27:02 -08:00
Ryan Richard
560ee45b50 Fix plog_test.go for Go 1.22 2024-02-08 11:53:59 -08:00
Ryan Richard
d2794114f4 Revert support TLS 1.3 in FIPS mode because Go reverted goboring upgrade
Goboring only allows TLS 1.2.

The next goboring will allow both TLS 1.2 and TLS 1.3. We got a preview
of this when the Go team upgraded goboring in Go 1.21.6, but then
downgraded it again in the next Go releases.

When the Go team eventually upgrades goboring again, then we can
revert this commit to bring back TLS 1.3 support in FIPS mode.
2024-02-08 10:43:52 -08:00
Ryan Richard
e303a45dd1 Test util AssertTLS supports both old and new goboring
- Current goboring only allows TLS 1.2.
- The next goboring will allow TLS 1.2 and TLS 1.3. We got a preview
  of this when the Go team upgraded goboring in Go 1.21.6, but then
  downgraded it again in the next Go releases.
2024-02-08 09:39:01 -08:00
Pinny
c47bc74ad0 Bump dependencies 2024-02-07 20:09:08 +00:00
Ryan Richard
a728822993 Merge pull request #1861 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.15.0
Bump golang.org/x/mod from 0.14.0 to 0.15.0 in /hack/update-go-mod
2024-02-07 11:04:16 -08:00
dependabot[bot]
5cd4d47f9e Bump golang.org/x/mod from 0.14.0 to 0.15.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.14.0 to 0.15.0.
- [Commits](https://github.com/golang/mod/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 02:01:12 +00:00
Ryan Richard
2832e7c45e Merge pull request #1858 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-06 08:48:32 -08:00
Pinny
04bb45947d Bump dependencies 2024-02-06 14:01:03 +00:00
Ryan Richard
f2c9b67854 Merge pull request #1856 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-02 10:03:18 -08:00
Pinny
e05ae08b77 Bump dependencies 2024-02-02 17:01:56 +00:00
Ryan Richard
1ab1fd4c50 Merge pull request #1855 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-02-01 10:06:48 -08:00
Pinny
d17dd65d0f Bump dependencies 2024-02-01 17:19:17 +00:00
Ryan Richard
a832bb641b Merge pull request #1854 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-31 06:52:30 -08:00
Pinny
18da164130 Bump dependencies 2024-01-31 14:02:55 +00:00
Ryan Richard
07b1a144b3 Merge pull request #1853 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-29 08:58:42 -08:00
Pinny
4c3f304ba5 Bump dependencies 2024-01-29 14:03:06 +00:00
Ryan Richard
c7445def21 Merge pull request #1852 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-26 09:01:20 -08:00
Pinny
d23f6690af Bump dependencies 2024-01-26 14:02:26 +00:00
Ryan Richard
0a8264c9c8 Merge pull request #1850 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-24 09:44:18 -08:00
Pinny
8c7cda84e1 Bump dependencies 2024-01-24 16:59:33 +00:00
Ryan Richard
6767a07a8d Merge pull request #1839 from vmware-tanzu/update_ci_url
Update CI URL, increase lint timeout, disable some dependabot updates
2024-01-19 12:58:22 -08:00
Ryan Richard
6908c2ab65 disable dependabot for some things in favor of our own tooling 2024-01-19 11:34:47 -08:00
Ryan Richard
80b65619bf Increase the lint timeout in hack/module.sh for when CI workers get slow 2024-01-19 11:34:47 -08:00
Ryan Richard
2aa87dd069 update CI URL in CONTRIBUTING.md 2024-01-19 11:34:47 -08:00
Ryan Richard
bb99d269eb Merge pull request #1836 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-19 11:32:42 -08:00
Pinny
84a1f2a771 Bump dependencies 2024-01-19 17:06:03 +00:00
Ryan Richard
e67838932d Merge pull request #1841 from vmware-tanzu/new_fips_compiler
Support new golang fips compiler
2024-01-19 08:17:43 -08:00
Ryan Richard
50e4d6db6c Support the new Go FIPS compiler which was upgraded inside Go 1.21.6
The release of Go 1.21.6 includes the new boring crypto when compiling
with FIPS enabled. See https://go.dev/doc/devel/release#go1.21.0 and
https://github.com/golang/go/issues/64717.

This new version of boring crypto allows the use of TLS v1.3 for the
first time, so we changed the Pinniped code to use TLS v1.3 where
appropriate when compiled with the FIPS compiler. It also changed the
allowed TLS v1.2 ciphers, so we updated those as well.

After this commit, the project must be compiled by at least Go v1.21.6
when compiling in fips mode. The hack/Dockerfile_fips was already
updated to use that version of Go in a previous commit.

Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2024-01-18 14:23:26 -08:00
Pinny
bcf070cb73 Bump dependencies 2024-01-16 12:33:40 -08:00
Ryan Richard
4ce96634c6 Merge pull request #1835 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-09 09:55:19 -08:00
Pinny
c356754aaa Bump dependencies 2024-01-09 09:24:04 +00:00
Ryan Richard
75a130bafd Merge pull request #1830 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-08 08:59:14 -08:00
Pinny
1d6e51d14a Bump dependencies 2024-01-08 09:03:58 +00:00
Ryan Richard
da9432b5b2 Merge pull request #1829 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-01-05 09:23:14 -08:00
Pinny
d4971ef2da Bump dependencies 2024-01-05 16:34:26 +00:00
Ryan Richard
bdb7f80571 Merge pull request #1825 from vmware-tanzu/kube_v0.29.0
Update dependencies, including Kube packages to v0.29.0
2024-01-04 13:29:44 -08:00
Ryan Richard
c7299f4daf Update dependencies, including Kube packages to v0.29.0 2024-01-04 12:30:22 -08:00
Pinny
659224a207 Updated versions in docs for v0.28.0 release 2023-12-15 18:56:15 +00:00
Ryan Richard
2c5214724b Merge pull request #1815 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-12-13 09:29:34 -08:00
Pinny
b2e3f84156 Bump dependencies 2023-12-13 16:39:49 +00:00
Ben Petersen
a58649faa6 Merge pull request #1813 from vmware-tanzu/disable_feature_gate
Disable UnauthenticatedHTTP2DOSMitigation feature gate
2023-12-12 16:12:14 -05:00
Ryan Richard
a4883507b5 Disable UnauthenticatedHTTP2DOSMitigation feature gate 2023-12-12 08:47:03 -08:00
Ben Petersen
461e272d79 Merge pull request #1812 from vmware-tanzu/tcr_test_more_output_on_failure
Add more output on failure of TokenCredentialRequest integration tests
2023-12-12 11:04:06 -05:00
Ryan Richard
981004eec4 Admin kubeconfigs with system:masters can have kubeadm:cluster-admins 2023-12-11 13:05:29 -08:00
Ryan Richard
0332362598 Add more output on failure of TokenCredentialRequest integration tests 2023-12-11 12:09:12 -08:00
Ryan Richard
f519b271d2 Merge pull request #1810 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-12-11 08:57:12 -08:00
Pinny
be7a4f781f Bump dependencies 2023-12-11 09:04:33 +00:00
Ryan Richard
0e3c815e9b Merge pull request #1809 from vmware-tanzu/sdump_in_whoami_test
Add more debugging output for when concierge_whoami_test.go fails
2023-12-08 12:43:32 -08:00
Ryan Richard
3b4147f90e Add more debugging output for when concierge_whoami_test.go fails 2023-12-08 10:31:40 -08:00
Ryan Richard
3b10cc3097 Merge pull request #1808 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-12-08 09:18:57 -08:00
Pinny
d8ec87d0e1 Bump dependencies 2023-12-08 16:17:12 +00:00
Ryan Richard
cdd38dd55e Merge pull request #1807 from vmware-tanzu/replace_grpc_version
replace version of google.golang.org/grpc
2023-12-07 12:33:30 -08:00
Ryan Richard
236a7cf3fb replace version of google.golang.org/grpc 2023-12-07 10:29:36 -08:00
Ryan Richard
3e74b38a95 Merge pull request #1806 from vmware-tanzu/revert_supervisor_disabling_http2
revert the disabling of http2 for the Supervisor OIDC endpoints
2023-12-06 20:33:27 -08:00
Ryan Richard
a05acadf80 Merge pull request #1594 from vmware-tanzu/jtc/add-ldapsearch-hack-script
Add ldapsearch hack script
2023-12-06 14:02:20 -08:00
Ryan Richard
c5d1f380d2 revert the disabling of http2 for the Supervisor OIDC endpoints
Due to the unintended consequence of potentially breaking Ingresses
which were configured to use http2 on their backends.
2023-12-06 13:10:51 -08:00
Ryan Richard
9883b4e236 rename the ldap debugging hack script and add parens to search filters 2023-12-06 12:56:35 -08:00
Ryan Richard
348187d2f4 Enchance and move the ldapsearch hack script 2023-12-06 09:16:16 -08:00
Joshua Casey
86ee66d21d Add ldapsearch hack script
[#185658904]
2023-12-06 09:16:16 -08:00
Ryan Richard
2198b4820a Merge pull request #1789 from vmware-tanzu/http2
Defensive changes to mitigate potential http2 rapid reset attacks
2023-12-06 09:15:07 -08:00
Ryan Richard
4b7b9e4362 Defensive changes to mitigate potential http2 rapid reset attacks 2023-12-05 14:57:50 -08:00
Ryan Richard
70f2bbf4f8 Merge pull request #1804 from vmware-tanzu/upgrade_fosite
Upgrade fosite to the latest commit on their main branch
2023-12-05 14:51:34 -08:00
Ryan Richard
7a3efb9981 change update-go-mod.sh to use head of main for fosite via config file 2023-12-05 11:25:02 -08:00
Ryan Richard
e1954b1df9 update session storage version from 5 to 6 due to fosite upgrade
A small part of the session storage changed type in the latest version
of fosite compared to the old version of fosite that we were using.
Just to be safe, update our session storage version to invalidate
any pre-existing sessions upon upgrade of Pinniped.
2023-12-04 14:49:22 -08:00
Ryan Richard
37c2ce53d7 upgrade fosite pkg to latest 2023-12-04 14:49:21 -08:00
Ryan Richard
9d3773e58a Merge pull request #1803 from vmware-tanzu/bump_codegen
Update kube-versions.txt and rerun codegen
2023-12-04 14:48:37 -08:00
Ryan Richard
aa651973fc Update kube-versions.txt and rerun codegen 2023-12-04 12:11:37 -08:00
Ryan Richard
745852ef2e Merge pull request #1801 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-12-04 11:58:04 -08:00
Ryan Richard
ca5ad85bbd Switch from gopkg.in/square/go-jose.v2 to github.com/go-jose/go-jose/v3
Made the switch wherever possible, but since fosite still uses the old
gopkg.in/square/go-jose.v2 there was one test where we still need to use
it as a direct dependency.
2023-12-04 11:05:12 -08:00
Ryan Richard
8296093beb Increase fudge factor in tokenclient_test.go due to CI failures 2023-12-04 10:04:05 -08:00
Pinny
6d79fe5f4c Bump dependencies 2023-12-04 09:40:51 -08:00
Ryan Richard
ef6369d71e Merge pull request #1733 from vmware-tanzu/jtc/issue-1700/impersonation-proxy-token-request-api
The Impersonation Proxy should use a short-lived token from the `TokenRequest` API
2023-12-01 11:48:52 -08:00
Ryan Richard
7616799adb Minor refactors in legacy SA token Secret cleanup controller 2023-11-30 16:40:21 -08:00
Ryan Richard
dea3513125 Add test for when no SA token is cached in impersonator_test.go 2023-11-30 15:55:27 -08:00
Ryan Richard
5f4645d505 Improve unit tests in tokenclient_test.go
Also fix a linter error and rename some new files.
2023-11-30 13:29:52 -08:00
Joshua Casey
c439cc03a2 WIP for a tokenClient.Start() unit test 2023-11-30 09:57:57 -08:00
Joshua Casey
2603bbfcd6 Do not use long-lived service account tokens in secrets
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-11-30 09:57:57 -08:00
Ryan Richard
dc1d563549 Merge pull request #1793 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-11-29 12:58:38 -08:00
Pinny
416a66f68a Bump dependencies 2023-11-29 09:02:04 +00:00
Joshua Casey
8f2da915aa Merge pull request #1791 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-11-17 14:00:05 -06:00
Pinny
aad74158ba Bump dependencies 2023-11-17 09:02:40 +00:00
Joshua Casey
98dde187bb Merge pull request #1788 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-11-16 12:14:21 -06:00
Joshua Casey
ab71450c69 Use correct reference for pinned dependencies 2023-11-16 09:08:42 -08:00
Pinny
a4789e2b2c Bump dependencies 2023-11-16 17:07:36 +00:00
Ryan Richard
1c2829a326 Merge pull request #1779 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2023-11-15 15:54:45 -08:00
Pinny
9be8cd40d2 Bump dependencies 2023-11-15 15:02:54 -08:00
Ryan Richard
90a3538806 Merge pull request #1780 from vmware-tanzu/jtc/lightly-standardize-import-aliases
Lightly standardize import aliases
2023-11-15 15:02:01 -08:00
Joshua Casey
b68e7f3e9e Lightly standardize import aliases 2023-11-15 13:52:17 -06:00
Ben Petersen
4f15fc2123 Merge pull request #1776 from vmware-tanzu/ben/dockerfile-image-args
Make Dockerfile base images configurable
2023-11-15 14:33:50 -05:00
Benjamin A. Petersen
2bc6c15d25 Make Dockerfile base images configurable 2023-11-15 14:32:48 -05:00
Joshua Casey
a740fb34c5 Merge pull request #1775 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-15 08:54:00 -06:00
Pinny
be1416b7b5 Bump go.mod direct dependencies 2023-11-15 09:02:22 +00:00
Ryan Richard
aad8dc50e7 Merge pull request #1774 from vmware-tanzu/whoami_timeout
Infinite default timeout for WhoAmI API call and add `--timeout` CLI flag
2023-11-14 14:02:42 -08:00
Ryan Richard
47f6de58c3 Infinite default timeout for WhoAmI API call & add --timeout CLI flag 2023-11-14 09:40:03 -08:00
Joshua Casey
61c630caf0 Merge pull request #1772 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-13 11:04:37 -06:00
Pinny
2985d55edf Bump go.mod direct dependencies 2023-11-13 09:04:06 +00:00
Joshua Casey
4f794571a2 Merge pull request #1771 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-09 08:45:28 -06:00
Pinny
d5ae3da893 Bump go.mod direct dependencies 2023-11-09 09:02:31 +00:00
Ryan Richard
80d5f42b57 Merge pull request #1701 from vmware-tanzu/ben/carvel-package/local-registry
Carvel Package POC for local development
2023-11-08 14:49:32 -08:00
Ryan Richard
d5aa682cbc Fix a comment
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-11-08 13:56:11 -08:00
Ryan Richard
b61557d3c3 Auto-format build.sh and deploy.sh
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-11-08 13:45:48 -08:00
Ryan Richard
d4e2622ea8 Revert "Rearrange carvel build & deploy scripts"
This reverts commit 9a632134ae.
2023-11-08 13:38:22 -08:00
Ryan Richard
88a97033fb Refined ytt schemas
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-11-08 13:37:31 -08:00
Benjamin A. Petersen
c4f9869e7c Relax image_pull_dockerconfigjson validation, improve endpoints
validation
2023-11-08 13:10:20 -08:00
Benjamin A. Petersen
c455a17abe Adjust validation for run_as_user,run_as_group 2023-11-08 13:10:20 -08:00
Benjamin A. Petersen
9a632134ae Rearrange carvel build & deploy scripts 2023-11-08 13:10:20 -08:00
Benjamin A. Petersen
1b540181a7 Adjust types on some supervisor validations 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
1f8aa6c262 import helpers in kind-down.sh 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
46bea27cb7 no_proxy adjustment for concierge 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
98bd12241d extract helpers to lib file and use in various hack scripts 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
c3410c4b14 improve custom_labels validation func 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
1e9f9181a1 Enhance schemas with validations, etc.
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-11-08 13:10:19 -08:00
Ryan Richard
07e9c5bd93 refactor carvel packaing scripts 2023-11-08 13:10:19 -08:00
Benjamin A. Petersen
e10d21d678 Support Carvel Package as alternate deployment mechanism
- update kind config to include local registry
- configure kind cluster to talk to local registry
- docker build & push pinniped dev code to local registry
- deploy dev code of the following via the local registry:
  - concierge
  - supervisor
  - local-user-authenticator
- Update values.yaml for supervisor,concierge to schema files
- Update values.yaml for local-user-authenticator to schema file
- Add ytt openapi-v3 generation to build carvel package script
- Add supervisor carvel package files
- Add concierge carvel package files
- Add local-user-authenticator carvel package files
- Add hack script to build openapi-v3 files
- add --post-install to hack/prepare-for-integration-tests.sh
- cleanup local registry in kind-down.sh
- webhook_ca_bundle moved in hack script
- adjust were to call post-install script
- deploy/{}/values.yml image_pull_dockerconfigjson type change to base64 string
- Add PINNIPED_USE_LOCAL_KIND_REGISTRY env var
 - ensures regular use of hack/prepare-for-integration-tests.sh
  - PINNIPED_USE_LOCAL_KIND_REGISTRY=1  ./hack/prepare-for-integration-tests.sh --clean --alternate-deploy ./hack/noop.sh --post-install ./hack/build-carvel-packages.sh
  - ./hack/prepare-for-integration-tests.sh --clean
- if PINNIPED_USE_LOCAL_KIND_REGISTRY for kind-down.sh in hack/prepare-for-integration-tests.sh
- Split carvel build & deploy scripts, add --pre-install flag
  - add pre-install flag to hack/prepare-for-integration-tests.sh
  - split /hack/build-carvel-packages.sh and
    /hack/deploy-carvel-packages.sh
- Remove --alternate-deploy-* flags from hack script
- Move scripts to hack/lib/carvel_packages
- Split build.sh deploy.sh
- Separate template files from install artifacts
- Generate all install artifacts in $root/deploy_carvel
  - remove $root/deploy_carvel from git
- Extract ytt values to file in hack/prepare-for-integration-tests.sh
- pass registry/repo to carvel build scripts
2023-11-08 13:10:19 -08:00
Joshua Casey
e3d9eb7d82 Merge pull request #1767 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-08 10:59:48 -06:00
Joshua Casey
97f6e8a07b Bump golang to 1.21.4 in the Dockerfiles 2023-11-08 10:09:42 -06:00
Pinny
865ef8d447 Bump go.mod direct dependencies 2023-11-08 09:02:18 +00:00
Joshua Casey
0a342a803c Merge pull request #1763 from vmware-tanzu/dependabot/go_modules/hack/update-go-mod/golang.org/x/mod-0.14.0
Bump golang.org/x/mod from 0.13.0 to 0.14.0 in /hack/update-go-mod
2023-11-06 08:11:27 -06:00
Joshua Casey
120b35a617 Merge pull request #1755 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-05 21:39:23 -06:00
Joshua Casey
3f92a546df Unit test fixes 2023-11-05 20:53:12 -06:00
dependabot[bot]
132e39c8fd Bump golang.org/x/mod from 0.13.0 to 0.14.0 in /hack/update-go-mod
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.13.0 to 0.14.0.
- [Commits](https://github.com/golang/mod/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 01:50:23 +00:00
Pinny
634654578f Bump go.mod direct dependencies 2023-11-05 08:05:08 +00:00
Joshua Casey
18f95d3d1e Merge pull request #1751 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-11-02 22:10:27 -05:00
Joshua Casey
b38723ece2 Integration test fixes 2023-11-02 15:31:50 -05:00
Joshua Casey
bf1366412a Unit test fixes
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-11-02 14:17:29 -05:00
Pinny
a6f7e05d3d Bump go.mod direct dependencies 2023-11-02 14:17:29 -05:00
Ryan Richard
660b155eaa Merge pull request #1752 from vmware-tanzu/upgrade-linter
Upgrade the linter to golangci-lint@v1.55.1
2023-11-02 10:56:03 -07:00
Ryan Richard
29e939db7f Upgrade the linter to golangci-lint@v1.55.1
The unused-parameter linter became stricter, so we adjust it to
allow unused params that start with underscore. It can be nice to keep
unused param names when implementing an interface sometimes, to help
readers understand why it is unused in that particular implementation.
2023-11-02 09:54:16 -07:00
Joshua Casey
3c2d921300 Merge pull request #1748 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-31 08:45:55 -05:00
Pinny
d1e5a9aff3 Bump go.mod direct dependencies 2023-10-31 08:02:22 +00:00
Ryan Richard
54d4879c69 Merge pull request #1742 from vmware-tanzu/idp_chooser_ui
show interstitial web page to allow user to choose IDP when multiple IDPs are configured and authorize endpoint query param to choose IDP is not used
2023-10-30 15:32:57 -07:00
Joshua Casey
78aa45a970 Merge pull request #1741 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-30 17:10:06 -05:00
Joshua Casey
3c33c59aa9 Update unit tests 2023-10-30 15:40:17 -05:00
Pinny
b9b4d31c6b Bump go.mod direct dependencies 2023-10-30 15:40:17 -05:00
Ryan Richard
0501159ac0 Show an IDP chooser UI when appropriate from authorize endpoint 2023-10-30 11:05:53 -07:00
Ryan Richard
779b084b53 Merge pull request #1738 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-25 08:51:52 -07:00
Pinny
f90f2334ba Bump go.mod direct dependencies 2023-10-25 08:00:49 +00:00
Ryan Richard
a8c35c6f7e Merge pull request #1735 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-23 09:08:51 -07:00
Pinny
ced08aeaf7 Bump go.mod direct dependencies 2023-10-23 08:02:12 +00:00
Joshua Casey
9c5bc763ac Merge pull request #1734 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-20 06:49:44 -05:00
Pinny
dd0039e94c Bump go.mod direct dependencies 2023-10-20 08:01:23 +00:00
Joshua Casey
9d836c789f Merge pull request #1732 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-19 08:46:45 -05:00
Pinny
ef291bb790 Bump go.mod direct dependencies 2023-10-19 08:02:18 +00:00
Ryan Richard
d4e3cf51b7 Merge pull request #1721 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-18 14:45:12 -07:00
Ryan Richard
247123965e run codegen again 2023-10-18 12:47:43 -07:00
Joshua Casey
097a1ac3d3 Run k8s codegen 2023-10-18 09:23:55 -07:00
Joshua Casey
ec532f622f Bump golang to 1.21.3 in Dockerfiles 2023-10-16 08:28:13 -05:00
Pinny
d73acd6896 Bump go.mod direct dependencies 2023-10-16 08:03:25 +00:00
Pinny
0c4e3aa5f1 Updated versions in docs for v0.27.0 release 2023-10-10 20:15:37 +00:00
Joshua Casey
cbd892a4b2 Merge pull request #1716 from vmware-tanzu/pinniped-cli-path-docs
document usage of --pinniped-cli-path option
2023-10-10 12:42:19 -05:00
Ryan Richard
e46acbee43 document usage of --pinniped-cli-path option 2023-10-10 10:38:13 -07:00
Joshua Casey
c1995c1eea Merge pull request #1715 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-10 06:56:24 -05:00
Pinny
423e2932aa Bump go.mod direct dependencies 2023-10-10 08:02:52 +00:00
Ryan Richard
c0ac0fa183 Merge pull request #1702 from vmware-tanzu/arm64_docs
Update website docs for arm64 support
2023-10-09 21:33:22 -07:00
Ryan Richard
521dec2e04 Merge pull request #1691 from vmware-tanzu/jtc/display-idp-name-when-prompting-for-login-181927293
Display IDP name when prompting for username and password
2023-10-09 21:12:49 -07:00
Ryan Richard
0a47aa59fc add a login banner to CLI-based login prompts which shows the IDP name
Skip showing the banner when the CLI does not know the IDP name
from the CLI args (which are typically encoded in the kubeconfig).

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2023-10-09 20:17:55 -07:00
Ryan Richard
3a21c9a35b backfill unit tests for expected stderr output in login_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2023-10-09 20:17:55 -07:00
Ryan Richard
6ee1e35329 Rename username and password prompt variables
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2023-10-09 20:17:55 -07:00
Ryan Richard
a077972ce5 Merge pull request #1690 from vmware-tanzu/jtc/change-path-to-pinniped-binary-184673465
Increase flexibility around the 'pinniped get kubeconfig' client-go credential plugin command
2023-10-09 20:16:23 -07:00
Joshua Casey
9d89a8dea4 Shorten kubeconfigCommand func for lint funlen 2023-10-09 21:25:14 -05:00
Joshua Casey
d965b65b0a Allow 'pinniped get kubeconfig' to override the client-go credential plugin command
[#184673465]
2023-10-09 21:25:14 -05:00
Joshua Casey
bc1593e833 Merge pull request #1703 from vmware-tanzu/tools_tolerations
tolerate arm64 in tools deployments and jobs
2023-10-09 21:21:22 -05:00
Ryan Richard
de5026b90f Merge pull request #1714 from vmware-tanzu/bump-codegen
Update kube versions for codegen
2023-10-09 16:04:10 -07:00
Ryan Richard
13f0b5e782 Update kube versions for codegen 2023-10-09 15:18:15 -07:00
Ryan Richard
6310dde4f5 Merge pull request #1713 from vmware-tanzu/jtc/bump-some-things
Bump some stray dependencies
2023-10-09 10:03:04 -07:00
Ryan Richard
bbf4412ff3 tolerate arm64 in tools deployments and jobs 2023-10-09 10:00:34 -07:00
Joshua Casey
1409f236da Bump dockerfiles to golang:1.21.2 2023-10-09 09:28:27 -05:00
Joshua Casey
0cca3a12e6 Update hack/update-go-mod/go.mod 2023-10-09 09:27:57 -05:00
Joshua Casey
5852a9e0ab Merge pull request #1711 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-10-09 08:31:07 -05:00
Pinny
8c4c99bbaf Bump go.mod direct dependencies 2023-10-09 08:02:48 +00:00
Ryan Richard
69e3627946 Update website docs for arm64 support
Also add the Hugo tmp file to the gitignore.
2023-10-05 14:48:14 -07:00
Ryan Richard
a27a355071 Merge pull request #1699 from vmware-tanzu/arm64
Support building of multi-arch linux amd64 and arm64 container images
2023-10-04 12:17:07 -07:00
Ryan Richard
826d8236d9 Use bitnami/openldap in integration tests instead of our old fork 2023-10-04 10:11:46 -07:00
Ryan Richard
776e436e35 Support building and deploying multi-arch linux amd64 and arm64 images 2023-10-04 08:55:26 -07:00
Ryan Richard
af7d3092a5 Merge pull request #1697 from vmware-tanzu/show_errors_on_formpost
Show errors from the form_post POST request on the page
2023-10-04 08:54:37 -07:00
Ryan Richard
62c597eb3b Show errors from the form_post POST request on the page 2023-10-02 09:53:53 -07:00
Joshua Casey
78cb86215b Merge pull request #1698 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-09-29 09:27:18 -05:00
Pinny
8a7f7b8842 Bump go.mod direct dependencies 2023-09-29 08:03:10 +00:00
Joshua Casey
172db05d8d Merge pull request #1685 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-09-28 10:06:23 -05:00
Pinny
113bebfb4d Bump go.mod direct dependencies 2023-09-28 09:20:13 -05:00
Ryan Richard
af7a1a1f58 Merge pull request #1696 from vmware-tanzu/contour_in_hack_prepare_supervisor
Optionally use Contour in hack/prepare-supervisor-on-kind.sh
2023-09-27 14:47:53 -07:00
Ryan Richard
0ab6311cf5 Optionally use Contour in hack/prepare-supervisor-on-kind.sh
Using Contour for ingress allows us to avoid using the hacky proxy
server approach. This makes it easy to use any web browser to complete
the login process, since there is no need to configure the proxy server
for the browser.
2023-09-27 12:32:49 -07:00
Ryan Richard
24069b56dc Merge pull request #1695 from vmware-tanzu/fix_pod_shutdown_test_flake
fix flake seen in pod_shutdown_test.go
2023-09-27 07:23:45 -07:00
Ryan Richard
87b7ea14d5 fix flake seen in pod_shutdown_test.go 2023-09-26 14:06:04 -07:00
Ryan Richard
7513092432 Merge pull request #1693 from vmware-tanzu/concierge_pods_priorityClassName
Stop using deprecated critical-pod annotation
2023-09-26 14:05:23 -07:00
Ryan Richard
192553aed9 Stop using deprecated critical-pod annotation 2023-09-26 13:16:13 -07:00
Ben Petersen
d44882fddc Merge pull request #1694 from vmware-tanzu/cli_login_page_errors
Same error messages shown in CLI's callback web page and in terminal
2023-09-26 14:54:01 -04:00
Ryan Richard
cede6403e1 Same error messages shown in CLI's callback web page and in terminal 2023-09-26 09:58:23 -07:00
Ryan Richard
e25ecea684 Merge pull request #1692 from vmware-tanzu/jtc/use-latest-controller-gen
Use latest controller-gen, which allows CEL validations
2023-09-26 09:56:42 -07:00
Joshua Casey
ac9887afdc Use latest controller-gen, which allows CEL validations 2023-09-25 15:58:32 -05:00
Ryan Richard
58c5146592 Merge pull request #1688 from vmware-tanzu/fix_shutdown_deadlock
Fix deadlock during shutdown which prevented leader election cleanup
2023-09-25 10:41:10 -07:00
Ryan Richard
5e06c6d5ad add integration test for graceful shutdowns which release leader leases 2023-09-25 09:51:17 -07:00
Ryan Richard
ca6c29e463 Fix deadlock during shutdown which prevented leader election cleanup
Before this fix, the deadlock would prevent the leader pod from giving
up its lease, which would make it take several minutes for new pods to
be allowed to elect a new leader. During that time, no Pinniped
controllers could write to the Kube API, so important resources were not
being updated during that window. It would also make pod shutdown take
about 1 minute.

After this fix, the leader gives up its lease immediately, and pod
shutdown takes about 1 second. This improves restart/upgrade time and
also fixes the problem where there was no leader for several minutes
after a restart/upgrade.

The deadlock was between the post-start hook and the pre-shutdown hook.
The pre-shutdown hook blocked until a certain background goroutine in
the post-start hook finished, but that goroutine could not finish until
the pre-shutdown hook finished. Thus, they were both blocked, waiting
for each other infinitely. Eventually the process would be externally
killed.

This deadlock was most likely introduced by some change in Kube's
generic api server package related to how the many complex channels used
during server shutdown interact with each other, and was not noticed
when we upgraded to the version which introduced the change.
2023-09-20 16:54:24 -07:00
Joshua Casey
1ac8691199 Merge pull request #1687 from vmware-tanzu/ben/site-blog-h1-swap-main-title
Update blog rendering to h1 the title (not h2)
2023-09-20 12:39:51 -05:00
Joshua Casey
4bb596e2cd Merge pull request #1661 from vmware-tanzu/jtc/add-cicd-howto
Add CI/CD How-To
2023-09-20 12:17:43 -05:00
Benjamin A. Petersen
78a7d4deea Update blog rendering to h1 the title (not h2) 2023-09-20 12:55:48 -04:00
Pinny
bed9a74b58 Updated versions in docs for v0.26.0 release 2023-09-19 22:56:05 +00:00
Ryan Richard
5af01bba4e Merge pull request #1683 from vmware-tanzu/0.26_blog
add blog post for v0.26.0 release
2023-09-19 15:43:04 -07:00
Ryan Richard
9fe9753cbc add blog post for v0.26.0 release 2023-09-19 15:42:34 -07:00
Ben Petersen
cef5745d2d Merge pull request #1684 from vmware-tanzu/okta_browser_login_flake
Trying to avoid test flake on Okta login page in browser
2023-09-19 13:27:29 -04:00
Ryan Richard
cd1e4bacf8 trying to avoid flake on Okta login page in browser 2023-09-19 08:58:22 -07:00
Joshua Casey
7de8f82295 Add CI/CD How-To
- https://github.com/vmware-tanzu/pinniped/discussions/1366
- https://www.pivotaltracker.com/story/show/184297690
2023-09-18 16:19:10 -05:00
Joshua Casey
62887a9cc8 Merge pull request #1682 from vmware-tanzu/exec_with_container_name
specify the container name when fetching keys from kube cert agent pod
2023-09-18 13:09:54 -05:00
Joshua Casey
c0e7a6ecbf Merge branch 'main' into exec_with_container_name 2023-09-18 12:18:51 -05:00
Ryan Richard
465a0c3d80 Merge pull request #1674 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-09-18 09:33:08 -07:00
Ryan Richard
4b4cc93ae7 specify the container name when fetching keys from kube cert agent pod
Avoid errors seen when the cluster has been configured to automatically
inject additional sidecar containers into every pod.
2023-09-18 09:19:57 -07:00
Joshua Casey
4a89a9fa16 Update LDAP integration tests for changes in github.com/go-ldap/ldap/v3 2023-09-18 10:45:32 -05:00
Joshua Casey
eb7a9f89e2 Bump k8s.io/kube-openapi and pin github.com/google/cel-go 2023-09-18 09:30:50 -05:00
Pinny
162041c794 Bump go.mod direct dependencies 2023-09-18 08:03:49 +00:00
Ryan Richard
0e7ef1637d Merge pull request #1677 from vmware-tanzu/dependabot/go_modules/go.uber.org/zap-1.26.0
Bump go.uber.org/zap from 1.25.0 to 1.26.0
2023-09-14 21:37:05 -07:00
dependabot[bot]
91d5159743 Bump go.uber.org/zap from 1.25.0 to 1.26.0
Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/uber-go/zap/releases)
- [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: go.uber.org/zap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-15 01:57:59 +00:00
Ryan Richard
efb53d3190 Merge pull request #1660 from vmware-tanzu/multiple_idps_and_transformations_docs
multiple idps and identity transformations docs
2023-09-14 15:17:34 -07:00
Ryan Richard
c97bb58e3c Merge pull request #1675 from vmware-tanzu/update_k8s_libs
Update deps except for cel-go
2023-09-14 15:16:15 -07:00
Ryan Richard
3cecb62705 Keep the deps updated from previous commit but keep cel-go at 0.16.x
because newer cel-go versions will not compile with latest k8s libs
2023-09-14 15:15:35 -07:00
Pinny
52db01d8ef Bump go.mod direct dependencies 2023-09-14 15:15:35 -07:00
Ben Petersen
1d500ded67 Merge pull request #1676 from vmware-tanzu/update_k8s_versions_for_codegen
update kube-versions.txt for codegen
2023-09-14 16:48:41 -04:00
Ryan Richard
edc5f3fc15 update kube-versions.txt for codegen 2023-09-14 13:01:46 -07:00
Ryan Richard
54fb03153a multiple IDPs and identity transformations docs 2023-09-13 14:33:53 -07:00
Ryan Richard
06d456fc87 Merge pull request #1419 from vmware-tanzu/multiple_idps_and_transformations
Support multiple IDPs and identity transformations on Supervisor FederationDomains
2023-09-13 14:26:23 -07:00
Ryan Richard
5573c629b5 remove extra timeoutCtx for exec.CommandContext invocations in e2e test
These extra timeout contexts were only in the new multiple IDPs e2e
test. Remove this possible cause of test cleanup flakes where the test
runs slow enough in CI that this timeout context has already expired
and then the cleanup function fails with context deadline exceeded
errors.
2023-09-13 12:48:10 -07:00
Ryan Richard
2cecc17ef0 add celformer unit test demonstrating string regexp in CEL expressions 2023-09-13 12:31:00 -07:00
Ryan Richard
c52ed93bf8 make prepare-supervisor-on-kind.sh work with older versions of bash 2023-09-12 10:24:55 -07:00
Ryan Richard
84498d5a55 fix imports grouping in manager.go 2023-09-12 09:34:19 -07:00
Ryan Richard
8faf3b0e26 add workaround in update-codegen.sh for problem seen when run on linux 2023-09-11 13:07:05 -07:00
Ryan Richard
a7bd494ec3 update FederationDomain.status.conditions to come from metav1 2023-09-11 13:06:52 -07:00
Ryan Richard
b6f0dc3ba7 Fix conflicts caused from rebasing main into multiple IDPs branch 2023-09-11 11:15:40 -07:00
Ryan Richard
e2bdab9e2d add the IDP display name to the downstream ID token's sub claim
To make the subject of the downstream ID token more unique when
there are multiple IDPs. It is possible to define two IDPs in a
FederationDomain using the same identity provider CR, in which
case the only thing that would make the subject claim different
is adding the IDP display name into the values of the subject claim.
2023-09-11 11:15:40 -07:00
Ryan Richard
28210ab14d add units tests to token_handler_test.go 2023-09-11 11:15:40 -07:00
Ryan Richard
593d55ec09 run codegen again after rebasing main branch into feature branch 2023-09-11 11:15:37 -07:00
Ryan Richard
5ad7e9a8ca started add units tests for identity transforms to token_handler_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
7f70fcf679 add units tests to post_login_handler_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
f653942065 add new unit tests in callback_handler_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
d4611b829d use slices.Contains() instead of custom func in token_handler_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
b2656b9cb1 add new unit tests in auth_handler_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
2eb82cc1d7 Add more tests with identity transformations in supervisor_login_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
0a21cb6d08 Replace more pointer.String() with the new ptr.To() 2023-09-11 11:14:06 -07:00
Ryan Richard
519aece8a5 Start adding identity transformations tests to supervisor_login_test.go 2023-09-11 11:14:06 -07:00
Ryan Richard
e6c78facfc Fix expectations in FederationDomains status test for old Kube versions
Also try to avoid flakes by using RetryOnConflict when calling Update
on the FederationDomain.
2023-09-11 11:14:05 -07:00
Ryan Richard
01ab7758d8 Add e2e test for rejecting auth using identity transformation policy 2023-09-11 11:14:05 -07:00
Ryan Richard
957892b677 handle old versions of k8s in supervisor_federationdomain_status_test.go 2023-09-11 11:14:05 -07:00
Ryan Richard
c701a4a344 remove expectation about TransformsConstantsNamesUnique status condition
Forgot to remove this in the previous commit which removed writing that
condition from the controller code.
2023-09-11 11:14:05 -07:00
Ryan Richard
92bf826ec5 rename a local variable in an integration test 2023-09-11 11:14:05 -07:00
Ryan Richard
446384a7f5 add an e2e test for a FederationDomain with multiple IDPs and transforms 2023-09-11 11:14:05 -07:00
Ryan Richard
6d82a11645 CRD already validates that IDP transform constant names are unique
- Remove that validation from the controller since the CRD already
  validates it during creates and updates.
- Also finish the supervisor_federationdomain_status_test.go by adding
  more tests for both controller validations and CRD validations
2023-09-11 11:14:05 -07:00
Ryan Richard
bd5cabf0ff fix some here.Doc string indents in federation_domain_watcher_test.go
To make things visually line up better.
2023-09-11 11:14:05 -07:00
Ryan Richard
51742366fe wordsmith some FederationDomain status messages 2023-09-11 11:14:05 -07:00
Ryan Richard
5341322071 add integration test for FederationDomain status updates
- Also fix small bug in controller where it used Sprintf wrong
- Rename WaitForTestFederationDomainStatus test helper to
  WaitForFederationDomainStatusPhase
2023-09-11 11:14:05 -07:00
Ryan Richard
23ed2856ce small refactor in supervisor_discovery_test.go 2023-09-11 11:14:05 -07:00
Ryan Richard
84041e0c55 add unit test for ApplyIdentityTransformations helper 2023-09-11 11:14:05 -07:00
Ryan Richard
4b75ced52c add unit tests for getters in federation_domain_issuer_test.go 2023-09-11 11:14:05 -07:00
Ryan Richard
61bb01b31d extract a helper function in federation_domain_watcher.go
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:14:05 -07:00
Ryan Richard
64f41d0d0c use multiple IDPs in manager_test.go 2023-09-11 11:14:05 -07:00
Ryan Richard
e42e3ca421 Status condition messages for IDP transforms show index of invalid IDP 2023-09-11 11:14:05 -07:00
Ryan Richard
b89e6d9d93 Make it possible to compare transformation pipelines in unit tests 2023-09-11 11:14:05 -07:00
Ryan Richard
c771328bb1 Validate transforms examples in federation_domain_watcher.go
Also changes the transformation pipeline code to sort and uniq
the transformed group names at the end of the pipeline. This makes
the results more predicable without changing the semantics.
2023-09-11 11:14:05 -07:00
Ryan Richard
52925a2a46 Validate transforms expressions in federation_domain_watcher.go 2023-09-11 11:14:05 -07:00
Benjamin A. Petersen
013030041a Add helper for happy/sad conditions to federation_domain_watcher_test.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:14:05 -07:00
Ryan Richard
be973bc87e Allow for slower CI workers in celformer_test.go 2023-09-11 11:14:05 -07:00
Ryan Richard
617f57e1c9 Validate transforms const names in federation_domain_watcher.go 2023-09-11 11:14:05 -07:00
Ryan Richard
0aacedf943 Update proposal doc statuses 2023-09-11 11:14:05 -07:00
Ryan Richard
b05e8a5e24 Replace sleep with kubectl wait in prepare-supervisor-on-kind.sh
- Now that the FederationDomain has `status.conditions`, we can use
  `kubectl wait` to wait for it to be ready in this hack script
2023-09-11 11:14:05 -07:00
Ryan Richard
8e169f9702 Validate IDP objectRef kind names in federation_domain_watcher.go
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:14:05 -07:00
Ryan Richard
32063db46e Validate apiGroup names are valid in federation_domain_watcher.go 2023-09-11 11:14:05 -07:00
Ryan Richard
31d67a1af3 Validate display names are unique in federation_domain_watcher.go 2023-09-11 11:14:05 -07:00
Ryan Richard
a9f2f672c7 Handle some unexpected errors in federation_domain_watcher.go 2023-09-11 11:14:05 -07:00
Ryan Richard
76709892bc Refactor: extract helper functions in federation_domain_watcher.go
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:14:05 -07:00
Ryan Richard
a38fb16295 Load FederationDomain endpoints before updating its status
- Avoid a possible race condition where the status says "Ready" but
  the endpoints take another moment to become available, potentially
  casing a fast client to get a 404 after observing that the status
  is "Ready" and then immediately trying to use the endpoints.

Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:14:05 -07:00
Ryan Richard
e334ad6f7e Fix lint errors in federation_domain_watcher.go, and adjust unit test 2023-09-11 11:14:05 -07:00
Ryan Richard
40dcc8a7f1 Update integration tests for new FederationDomain phase behavior
- Refactor testlib.CreateTestFederationDomain helper
- Call testlib.WaitForTestFederationDomainStatus after each integration
  test creates an IDP and expects the FederationDomain to become ready
- Create an IDP for some tests which want the FederationDomain to be
  ready but were previously not creating any IDP
- Expect the new FederationDomain condition type
  "IdentityProvidersFound" in those tests where it is needed

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2023-09-11 11:14:05 -07:00
Ryan Richard
97a374c00b Refactor federation_domain_watcher_test.go and add new test to its table 2023-09-11 11:14:05 -07:00
Benjamin A. Petersen
fe9364c58b Expand IdentityProvidersFound condition in federation_domain_watcher
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:14:05 -07:00
Benjamin A. Petersen
e9fb4242d5 Update federation_domain_watcher with new IdentityProviderFound
- adds the truthy condition
- TODOs for falsy conditions
- addiional notes for other conditions
- tests updated to pass with the new condition

Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:14:04 -07:00
Ryan Richard
48e44e13c6 Change federation_domain_watcher_test.go to use a test table style 2023-09-11 11:14:04 -07:00
Ryan Richard
5e2f98af65 Update informers unit test for FederationDomainWatcherController 2023-09-11 11:14:04 -07:00
Ryan Richard
3521e129cd Change name of FederationDomain printer column back to "Status"
To be consistent with the name of the pinter columns on our other CRDs,
which call the Phase "Status" in the printer column names.
2023-09-11 11:14:04 -07:00
Ryan Richard
0b408f4fc0 Change FederationDomain.Status to use Phase and Conditions 2023-09-11 11:14:02 -07:00
Ryan Richard
022fdb9cfd Update a test assertion to make failure easier to understand 2023-09-11 11:12:27 -07:00
Ryan Richard
e4f43683d4 fix more integration tests for multiple IDPs 2023-09-11 11:12:27 -07:00
Ryan Richard
514f9964c1 update 1.27 codegen for multiple IDPs 2023-09-11 11:12:25 -07:00
Ryan Richard
2c4927debe update unit test that fails on slow CI workers 2023-09-11 11:11:56 -07:00
Ryan Richard
0f23931fe4 Fix some tests in supervisor_login_test.go 2023-09-11 11:11:56 -07:00
Ryan Richard
98ee9f0979 escape semicolons in variable values in integration-test-env-goland.sh
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:11:56 -07:00
Ryan Richard
048f05d39c fix callback_handler_test.go
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:11:56 -07:00
Ryan Richard
b71e5964aa fix token_handler_test.go 2023-09-11 11:11:56 -07:00
Benjamin A. Petersen
9d792352bf test FederationDomainIdentityProvidersListerFinder
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:11:56 -07:00
Ryan Richard
86c791b8a6 reorganize federation domain packages to be more intuitive
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-09-11 11:11:52 -07:00
Benjamin A. Petersen
3160b5bad1 Reorganized FederationDomain packages to avoid circular dependency
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Ryan Richard
610f886fd8 Fix auth_handler_test.go 2023-09-11 11:09:50 -07:00
Benjamin A. Petersen
770f8af62b Update auth_handler.go to return 422 error when upstream IdP not found
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Benjamin A. Petersen
6ef9cf273e Fix post_login_handler_test.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Ryan Richard
793d1c6a5d add a type assertion 2023-09-11 11:09:50 -07:00
Benjamin A. Petersen
8f6a12eae4 fix internal/oidc/provider/manager/manager_test.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Benjamin A. Petersen
5c0425fb71 refactor: rename "provider" to "federationdomain" when appropriate
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Ryan Richard
96098841dd Get tests to compile again and fix lint errors 2023-09-11 11:09:50 -07:00
Benjamin A. Petersen
b7627208ea Add tests for identity_transformation.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-09-11 11:09:50 -07:00
Ryan Richard
32aa015d5b Fixup unit tests for the previous commit 2023-09-11 11:09:50 -07:00
Ryan Richard
7af75dfe3c First draft of implementation of multiple IDPs support 2023-09-11 11:09:49 -07:00
Ryan Richard
1a53b4daea Allow user-defined string & stringList consts for use in CEL expressions 2023-09-11 11:09:49 -07:00
Ryan Richard
5385fb38db Add identity transformation packages idtransform and celformer
Implements Supervisor identity transformations helpers using CEL.
2023-09-11 11:09:49 -07:00
Ryan Richard
be11966a64 Add APIs for multiple IDP and id transformations to FederationDomain CRD 2023-09-11 11:09:46 -07:00
Ryan Richard
fee737b267 Merge pull request #1644 from vmware-tanzu/jtc/use-conditions-from-apimachinery
Use Conditions from apimachinery, specifically k8s.io/apimachinery/pk…
2023-09-11 11:00:32 -07:00
Joshua Casey
64f1bff13f Use Conditions from apimachinery, specifically k8s.io/apimachinery/pkg/apis/meta/v1.Conditions 2023-09-11 10:13:39 -07:00
Joshua Casey
96fcfe4d53 Merge pull request #1662 from vmware-tanzu/supervisor_tls_cert_logging
Improve pod logs related to Supervisor TLS certificate problems
2023-09-11 12:10:52 -05:00
Ryan Richard
ce567c481b Improve pod logs related to Supervisor TLS certificate problems 2023-09-11 09:13:21 -07:00
Joshua Casey
33311714e5 Merge pull request #1664 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-09-10 21:22:01 -05:00
Joshua Casey
1bab4ccdb7 Bump to go1.20.1 2023-09-10 19:35:31 -05:00
Pinny
d91ebc1049 Bump go.mod direct dependencies 2023-09-10 08:04:43 +00:00
Joshua Casey
4e48388693 Merge pull request #1663 from vmware-tanzu/css_fixes
Small css changes for docs web site
2023-09-08 19:05:07 -05:00
Benjamin A. Petersen
8df2d3cc58 site: fix codeblock left padding and spacing tweak 2023-09-08 15:41:31 -04:00
Ryan Richard
f6cbc879ef Make pre code blocks have more consistent font size and line height 2023-09-08 12:12:22 -07:00
Ben Petersen
46c773aba6 Merge pull request #1647 from vmware-tanzu/jtc/bump-to-golang-1-21
Bump to golang 1.21
2023-09-06 16:39:40 -04:00
Joshua Casey
cd91edf26c [LDAP] move attributeUnchangedSinceLogin from upstreamldap to activedirectoryupstreamwatcher 2023-09-06 14:52:01 -05:00
Joshua Casey
8fd55a1d81 Adjust test expectations for compilation differences with 1.21
- Requires some production code changes, to use pointers to function variables instead of pointers to functions
2023-09-06 14:52:01 -05:00
Joshua Casey
3908097c54 Run 'go fix ./...' with go1.21.0 2023-09-06 14:52:01 -05:00
Joshua Casey
12f18cbed8 Inline and remove testutil.TempDir 2023-09-06 14:52:01 -05:00
Joshua Casey
05a1187e2e Simplify build tags associated with unsupported golang versions 2023-09-06 14:52:01 -05:00
Joshua Casey
5effb1a89b Bump to golang 1.21.0, and bump all golang deps 2023-09-06 14:52:01 -05:00
Joshua Casey
b14e86bb91 Merge pull request #1654 from vmware-tanzu/docs/configure-supervisor-with-azuread
Add docs for Supervisor with Azure AD
2023-09-06 12:33:51 -05:00
Joshua Casey
c3445a747d Merge pull request #1650 from vmware-tanzu/ben/prepare-for-integration-tests.sh-improvements
Improve hack/prepare-for-integration-tests.sh flexibility
2023-09-06 12:30:12 -05:00
Benjamin A. Petersen
a5c481cf61 Add docs for Supervisor with Azure AD
- Note that Azure AD is being rebranded to Entra ID
2023-09-06 13:14:37 -04:00
Benjamin A. Petersen
fd1936c45f Improve hack/prepare-for-integration-tests.sh flexibility
- move pushd/popd inside if statements for alternative-deploy methods
- add specific alternative-deploy vars for individual components
  - supervisor
  - concierge
  - local-user-authenticator
  while preserving the current alternative-deploy for all three
- doc that equals for flags does not work
  --foo=bar is invalid
  --foo bar is valid
2023-08-31 15:02:24 -04:00
Ben Petersen
fbeb45a1a0 Merge pull request #1648 from vmware-tanzu/jtc/do-not-fail-hack-script-without-KUBE_GIT_VERSION
Do not fail hack script without kube git version
2023-08-30 10:58:15 -04:00
Joshua Casey
23bd3e7cc9 Do not fail hack/prepare-for-integration-tests.sh without KUBE_GIT_VERSION 2023-08-29 19:58:23 -05:00
Joshua Casey
7cda8f4123 Do not fail when KUBE_GIT_VERSION is not set 2023-08-29 17:31:22 -05:00
Joshua Casey
a42e3edf56 Merge pull request #1646 from vmware-tanzu/jtc/support-k8s-1-21-and-up
Remove generated code prior to K8s 1.21
2023-08-29 16:29:32 -05:00
Joshua Casey
76933f69b9 Update comments to indicate support for newer versions of Kubernetes 2023-08-29 15:40:52 -05:00
Joshua Casey
5c9d26baeb Remove generated code for K8s 1.17, 1.18, 1.19, and 1.20
- Kind 0.20.0 supports 1.21 through 1.28 (inclusive)
- https://github.com/kubernetes-sigs/kind/releases/tag/v0.20.0
2023-08-28 16:56:32 -05:00
Joshua Casey
9248db971a Merge pull request #1634 from vmware-tanzu/jtc/1633/update-pinniped-cli-version-output
#1633 Update `pinniped version` output
2023-08-28 14:19:17 -05:00
Joshua Casey
2dcc149fee Split off helper function 2023-08-28 12:14:14 -05:00
Joshua Casey
38230fc518 Use pversion to retrieve buildtime information 2023-08-28 11:54:27 -05:00
Joshua Casey
8edecffcc0 Merge pull request #1630 from vmware-tanzu/jtc/support-k8s-1-28
Support k8s 1.28
2023-08-28 11:49:18 -05:00
Joshua Casey
ca05969f8d Integration tests should use 'kubectl explain --output plaintext-openapiv2'
- OpenAPIV3 discovery of aggregate APIs seems to need a little more work in K8s 1.28
2023-08-28 10:50:11 -05:00
Joshua Casey
1b504b6fbd Expose OpenAPIv3 explanations 2023-08-28 10:50:11 -05:00
Joshua Casey
dfd3d5075d Ensure that kubegenerator scripts are executable 2023-08-28 10:50:11 -05:00
Joshua Casey
c51722a121 Run K8s codegen, adding 1.28.0 2023-08-28 10:50:11 -05:00
Joshua Casey
23ec91dee0 K8s API Server audit events are no longer pointers 2023-08-28 10:50:10 -05:00
Joshua Casey
ccba159639 Update all golang dependencies, especially k8s.io (for 1.28) 2023-08-28 10:50:10 -05:00
Ryan Richard
20cfa0a207 Merge pull request #1631 from vmware-tanzu/which_service_doc
Update docs to clarify which Supervisor port to expose outside cluster
2023-08-22 10:43:53 -07:00
Ryan Richard
835b8a5333 Update docs to clarify which Supervisor port to expose outside cluster 2023-08-22 10:00:56 -07:00
Ben Petersen
decd40bc26 Merge pull request #1621 from vmware-tanzu/site/blog-post-tags
blog: clean up tags page
2023-08-15 15:07:31 -04:00
Benjamin A. Petersen
2891da25f5 blog: clean up tags page 2023-08-15 14:18:48 -04:00
Ben Petersen
c54933bf33 Merge pull request #1606 from vmware-tanzu/jtc/add-blog-post-for-v0.25.0
Add blog post for v0.25.0
2023-08-15 11:43:50 -04:00
Benjamin A. Petersen
820c565d21 blog: add multiple author support for posts 2023-08-15 11:37:11 -04:00
Benjamin A. Petersen
e5e8c13f23 blog: impersonation-proxy spelling, grammar 2023-08-15 11:37:11 -04:00
Benjamin A. Petersen
b81206c15d blog: impersonation-proxy post updates 2023-08-14 11:42:26 -04:00
Benjamin A. Petersen
31c144261f add author to blog list page 2023-08-14 11:42:26 -04:00
Joshua Casey
4d0da0a5b2 Add blog post for v0.25.0 2023-08-10 09:00:16 -05:00
Pinny
8c96616b51 Updated versions in docs for v0.25.0 release 2023-08-09 21:12:41 +00:00
Ben Petersen
c7b49d9b93 Merge pull request #1615 from vmware-tanzu/jtc/fix-double-decoding-of-ca-crt
Fix #1582 by not double-decoding the ca.crt field in external TLS secrets for the impersonation proxy
2023-08-09 14:25:13 -04:00
Joshua Casey
7f0d04dba6 Address PR feedback 2023-08-09 11:42:42 -05:00
Joshua Casey
1707995378 Fix #1582 by not double-decoding the ca.crt field in external TLS secrets for the impersonation proxy 2023-08-08 20:17:21 -05:00
Ben Petersen
f24f82b25b Merge pull request #1607 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-08-08 09:22:40 -04:00
Pinny
391c38057d Bump go.mod direct dependencies 2023-08-08 08:03:24 +00:00
Joshua Casey
e2e9819c58 Merge pull request #1582 from vmware-tanzu/jtc/1547-poc
Add external certificate management for the Concierge Impersonation Proxy
2023-08-03 15:52:56 -05:00
Joshua Casey
dc61d132cf Address PR feedback, especially to check that the CA bundle is some kind of valid cert 2023-08-03 14:57:21 -05:00
Joshua Casey
959f18b67b Add integration test to verify that the impersonation proxy will use an external TLS serving cert 2023-08-03 14:57:21 -05:00
Joshua Casey
ee75a63057 Test Refactor: use explicit names for mTLS signing cert 2023-08-03 14:57:21 -05:00
Joshua Casey
bd035a180e Impersonation proxy detects when the user has configured an externally provided TLS secret to serve TLS
- https://github.com/vmware-tanzu/pinniped/tree/main/proposals/1547_impersonation-proxy-external-certs
- https://joshuatcasey.medium.com/k8s-mtls-auth-with-tls-passthrough-1bc25e750f52
2023-08-03 14:57:21 -05:00
Joshua Casey
8df9033bfc Add CredentialIssuer.Spec.ImpersonationProxy.TLS to configure an externally provided TLS secret 2023-08-03 14:57:21 -05:00
Joshua Casey
3e57716f0e The impersonation controller should sync when any secret of type kubernetes.io/tls changes in the namespace 2023-08-03 14:57:21 -05:00
Joshua Casey
c78db66665 Merge pull request #1602 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-08-03 14:25:54 -05:00
Joshua Casey
8dec84b3b2 Bump golang to 1.20.7 2023-08-03 13:39:51 -05:00
Pinny
fcf707b1ce Bump go.mod direct dependencies 2023-08-03 08:08:39 +00:00
Ben Petersen
563ac77b2f Merge pull request #1603 from vmware-tanzu/site/sidebar/reorganize
Website docs page sidebar reorganization and restyle
2023-08-02 14:50:43 -04:00
Benjamin A. Petersen
e091cd6180 site: autogenerate new sections on main docs listing page 2023-08-02 13:52:31 -04:00
Benjamin A. Petersen
a71f1f88d9 site: minor text updates 2023-08-02 13:46:51 -04:00
Benjamin A. Petersen
bb670249cf site: reorganize /howto/idp->/howto/supervisor 2023-08-02 13:22:23 -04:00
Benjamin A. Petersen
f632698568 site: add redirects for old doc links 2023-08-02 12:42:08 -04:00
Benjamin A. Petersen
0c81cdf309 site style: code block tweaks and sidebar menu highlight 2023-08-02 12:09:34 -04:00
Benjamin A. Petersen
fbb5296f68 site sidebar: menu renaming & reorganization 2023-08-02 12:09:33 -04:00
Benjamin A. Petersen
14c353993b site sidebar: create new How-to sub-heading for IDP config 2023-08-02 12:09:24 -04:00
Ryan Richard
2cdd7c9577 Merge pull request #1598 from vmware-tanzu/chromedp
Replace agouti and chromedriver with chromedp across the whole project
2023-08-01 12:23:38 -07:00
Ryan Richard
4512eeca9a Replace agouti and chromedriver with chromedp across the whole project 2023-08-01 11:27:09 -07:00
Ryan Richard
2c27db0c85 Merge pull request #1597 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-08-01 09:21:54 -07:00
Pinny
ed3217459d Bump go.mod direct dependencies 2023-08-01 08:05:19 +00:00
Joshua Casey
411bc5cf1c Merge pull request #1592 from vmware-tanzu/jtc/add-auth0-integration-guide
Add How To... Integrate with Auth0
2023-07-28 14:43:15 -05:00
Joshua Casey
82b39190ba Add How To... Integrate with Auth0 2023-07-28 14:41:06 -05:00
Ben Petersen
fd54caeb55 Merge pull request #1595 from vmware-tanzu/site/css/resource-page-images
site css: images on resource page should fit the grid
2023-07-28 14:56:53 -04:00
Benjamin A. Petersen
c4f221d778 site css: images on resource page should fit the grid 2023-07-28 14:08:23 -04:00
Joshua Casey
057304e9aa Merge pull request #1593 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-07-28 12:03:57 -05:00
Joshua Casey
63b5f921e1 Use k8s.io/utils/ptr instead of k8s.io/utils/pointer, which is deprecated 2023-07-28 09:16:02 -05:00
Pinny
eb87739060 Bump go.mod direct dependencies 2023-07-28 08:02:58 +00:00
Joshua Casey
122f819ed9 Merge pull request #1591 from vmware-tanzu/aws_blog
add AWS blog post to resources page of pinniped.dev
2023-07-27 19:52:10 -05:00
Ryan Richard
850b4f8510 add AWS blog post to resources page of pinniped.dev 2023-07-27 17:09:04 -05:00
Joshua Casey
6bb4e89fe2 Merge pull request #1590 from vmware-tanzu/kube_cert_agent_cpu_request
kube cert agent pod requests 0 cpu to avoid scheduling failures
2023-07-25 15:20:53 -05:00
Ryan Richard
743cb2d250 kube cert agent pod requests 0 cpu to avoid scheduling failures 2023-07-25 10:09:30 -07:00
Joshua Casey
01393aff7e Merge pull request #1580 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-07-21 13:24:33 -05:00
Joshua Casey
89b7007694 Bump K8s APIs 1.24 through 1.27 2023-07-21 10:36:18 -05:00
Pinny
947f8e2ed4 Bump go.mod direct dependencies 2023-07-21 08:05:19 +00:00
Joshua Casey
6c329ba56f Merge pull request #1549 from vmware-tanzu/jtc/tiny-fixups-to-support-1548
Tiny fixups to support #1548
2023-07-19 16:40:59 -05:00
Joshua Casey
39912060f7 Remove untested comments 2023-07-19 15:50:12 -05:00
Joshua Casey
c142c52258 Do not name return variables 2023-07-19 15:49:22 -05:00
Joshua Casey
741ccfd2ce Fix lint 2023-07-19 15:47:48 -05:00
Joshua Casey
183c771d4e Mark untested code paths 2023-07-19 15:47:48 -05:00
Joshua Casey
3d7eb55fc2 Pass caBundle instead of an object 2023-07-19 15:47:48 -05:00
Joshua Casey
5004925444 Backfill test cases 2023-07-19 15:47:48 -05:00
Joshua Casey
10c3e482b4 Prefer early return 2023-07-19 15:47:48 -05:00
Joshua Casey
8d8e1f3abd Backfill issuer tests 2023-07-19 15:47:48 -05:00
Joshua Casey
f8ce2af08c Use go:embed for easier to read tests 2023-07-19 15:47:48 -05:00
Joshua Casey
52b0cf43ca Fix godoc 2023-07-19 15:47:47 -05:00
Joshua Casey
f6c2d40141 Merge pull request #1578 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-07-19 12:15:12 -07:00
Joshua Casey
38c281331a Bump base images to go1.20.6 in Dockerfiles 2023-07-19 13:25:57 -05:00
Pinny
26686d6b94 Bump go.mod direct dependencies 2023-07-19 08:04:49 +00:00
Ryan Richard
8648cdf8e4 Merge pull request #1579 from vmware-tanzu/improve_perf_oidcclientsecret_test
Improve performance of supervisor_oidcclientsecret_test.go
2023-07-14 08:26:56 -07:00
Ryan Richard
7e5ce4b4f3 Merge pull request #1548 from vmware-tanzu/jtc/proposal/allow-external-certs-for-impersonation-proxy
Add proposal to implement #1547, Concierge Impersonation Proxy | External Certificate Management
2023-07-13 14:58:35 -07:00
Ryan Richard
6c65fd910e Improve performance of supervisor_oidcclientsecret_test.go
Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
2023-07-13 12:48:46 -07:00
Joshua Casey
95fdfba06d Add proposal to implement #1547, Concierge Impersonation Proxy | External Certificate Management 2023-07-13 10:16:11 -07:00
Joshua Casey
0f613d1823 Merge pull request #1407 from vmware-tanzu/multiple_idps_proposal
Proposal for multiple identity providers in the Supervisor
2023-07-12 19:56:31 -07:00
Ryan Richard
6db9c79fe0 Add proposal for multiple identity providers in the Supervisor 2023-07-12 15:14:21 -07:00
Joshua Casey
ab227a7c71 Merge pull request #1563 from vmware-tanzu/jtc/bump-all
Bump all dependencies and generated files
2023-07-07 09:03:18 -07:00
Joshua Casey
314ec48f46 Bump to golang:1.20.5 2023-07-06 16:48:25 -07:00
Joshua Casey
67cd5e70c2 Func ldap.Conn.Close() now returns an error
- https://github.com/go-ldap/ldap/compare/v3.4.4...v3.4.5
2023-07-06 16:48:25 -07:00
Joshua Casey
dbbaf9b969 Pin to the version of k8s.io/kube-openapi used by client-go@v0.27.3
- https://github.com/kubernetes/client-go/blob/v0.27.3/go.mod#L30
2023-07-05 21:28:23 -07:00
Joshua Casey
1ac36cfcf8 Update generated files 2023-07-05 21:28:23 -07:00
Joshua Casey
95dd5aabc2 Bump hack/update-go-mod/go.mod 2023-07-05 21:28:23 -07:00
Joshua Casey
8a755676fa Bump all go.mod dependencies 2023-07-05 21:28:22 -07:00
Pinny
c3dccbb23d Updated versions in docs for v0.24.0 release 2023-06-01 19:59:23 +00:00
Ryan Richard
914861c5da Increase a test timeout in supervisor_secrets_test.go 2023-06-01 12:54:45 -07:00
Ryan Richard
9a87a7f14f Update codeql-analysis.yml according to the latest template 2023-06-01 11:51:48 -07:00
Ryan Richard
533c41f143 Merge pull request #1538 from smeet07/patch-1
documents when to avoid setting anon auth command line option
2023-06-01 11:01:08 -07:00
Ryan Richard
4f3c081401 Merge branch 'main' into patch-1 2023-06-01 10:56:11 -07:00
Ryan Richard
d4b20b3899 Update codeql-analysis.yml
Also remove scorecards.yml because the version used is no longer
working, and the new version requires write permission to the repo.
2023-06-01 10:53:25 -07:00
Ryan Richard
86e360dc14 Increase a test timeout for when pulling container image is slow 2023-06-01 10:04:59 -07:00
Smeet nagda
c9d54de91a backtick changes
Co-authored-by: Ryan Richard <richardry@vmware.com>
2023-06-01 22:25:24 +05:30
Ryan Richard
d30d76b7ac Increase some test timeouts 2023-05-31 17:41:36 -07:00
Ryan Richard
5fa2992bc5 Merge pull request #1534 from vmware-tanzu/ldap_userAttributeForFilter
Add LDAPIdentityProvider.spec.groupSearch.userAttributeForFilter
2023-05-31 16:42:41 -07:00
Ryan Richard
020e04baf8 Merge branch 'main' into ldap_userAttributeForFilter 2023-05-31 16:42:30 -07:00
Ryan Richard
1bdb491376 Merge pull request #1540 from vmware-tanzu/bump_kube_versions_for_codegen
bump versions in kube-versions.txt and run codegen
2023-05-31 16:41:59 -07:00
Ryan Richard
b6b11a6d0c increase timeout in a test 2023-05-31 15:59:44 -07:00
Ryan Richard
a78c677ca1 bump versions in kube-versions.txt and run codegen 2023-05-31 13:32:41 -07:00
Ryan Richard
d0048595da Add docs for UserAttributeForFilter group search setting 2023-05-31 13:01:17 -07:00
Joshua Casey
46178e91ee Merge branch 'main' into ldap_userAttributeForFilter 2023-05-31 14:41:16 -05:00
Joshua Casey
33cc973b43 Merge pull request #1537 from vmware-tanzu/jtc/bump-deps
Bump dependencies
2023-05-31 14:32:32 -05:00
Ryan Richard
d4710cb16e Add integration test for AD UserAttributeForFilter group search setting 2023-05-31 11:36:49 -07:00
Ryan Richard
600d002a35 Use groupSearch.userAttributeForFilter during ActiveDirectory group searches
- Load the setting in the controller.
- The LDAP auth code is shared between AD and LDAP,
  so no new changes there in this commit.
2023-05-31 11:17:40 -07:00
Ryan Richard
0a1f966886 Add ActiveDirectoryIdentityProvider.spec.groupSearch.userAttributeForFilter
Add the field to the tmpl file and run codegen.
Also update the count of the fields of our APIs in an integration test.
2023-05-31 11:09:08 -07:00
Ryan Richard
552eceabdb Add integration test for UserAttributeForFilter group search setting
Also adds new integration test env var to support the new test:
PINNIPED_TEST_LDAP_EXPECTED_DIRECT_POSIX_GROUPS_CN
2023-05-31 10:29:44 -07:00
Ryan Richard
e3b7ba3677 Add group search tests for UserAttributeForFilter in ldap_client_test.go 2023-05-31 10:29:44 -07:00
Smeet nagda
6cbfde95ec command line option. 2023-05-30 23:24:05 +05:30
Joshua Casey
6bd34fa6ea Bump dependencies 2023-05-30 09:16:53 -05:00
Ryan Richard
c187474499 Use groupSearch.userAttributeForFilter during LDAP group searches
Load the setting in the controller.
Use the setting during authentication and during refreshes.
2023-05-25 14:25:17 -07:00
Ryan Richard
bad5e60a8e Add LDAPIdentityProvider.spec.groupSearch.userAttributeForFilter
Add the field to the tmpl file and run codegen.
Also update the count of the fields of our APIs in an integration test.
2023-05-25 09:52:15 -07:00
Ryan Richard
e4dc810bff Add some posixGroups to the openldap server for use in integration tests 2023-05-23 16:47:39 -07:00
Ryan Richard
749a208773 Merge pull request #1524 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-05-19 07:06:55 -07:00
Pinny
cb7732083d Bump go.mod direct dependencies 2023-05-19 08:03:46 +00:00
Ryan Richard
e9d343d80d Merge pull request #1522 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-05-16 11:30:04 -07:00
Pinny
3871e75140 Bump go.mod direct dependencies 2023-05-16 08:02:49 +00:00
Ryan Richard
b93ac16cee Merge pull request #1520 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-05-12 10:29:20 -07:00
Ryan Richard
bd95f33f5e Update string "zapr@v1.2.4" in unit test expectation 2023-05-12 09:18:47 -07:00
Pinny
e717748a3c Bump go.mod direct dependencies 2023-05-12 08:06:19 +00:00
Ryan Richard
2d2cbef8de Merge pull request #1497 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-05-10 21:12:51 -07:00
Ryan Richard
187ee80ee3 Handle the new output of kubectl explain which indents differently 2023-05-10 19:56:59 -07:00
Ryan Richard
484f134a98 Handle the new output of kubectl explain which shows GROUP separately 2023-05-10 18:03:40 -07:00
Ryan Richard
1e6e9e0c0e Change tests to expect new error format from pkg golang.org/x/oauth2 2023-05-10 16:52:09 -07:00
Ryan Richard
bc9afc4554 Aggregated API endpoints now must implement rest.SingularNameProvider
This was a change in the interface requirements introduced in Kube 1.27.
2023-05-10 16:50:50 -07:00
Ryan Richard
8c3395481b ran update.sh for new kube patch versions and adding 1.27 2023-05-10 12:39:35 -07:00
Ryan Richard
b40366d1f6 update versions in hack/lib/kube-versions.txt 2023-05-10 12:38:32 -07:00
Ryan Richard
a1a99b9eeb Replace usages of deprecated funcs from the wait pkg 2023-05-10 11:41:11 -07:00
Ryan Richard
4756df08cb Bump golang from 1.20.3 to 1.20.4 2023-05-10 10:36:03 -07:00
Ryan Richard
cf11f8ee7e Remove replace directive for k8s.io/kube-openapi 2023-05-10 10:30:48 -07:00
Pinny
6b86d91cd7 Bump go.mod direct dependencies 2023-05-10 08:18:14 +00:00
Ryan Richard
49af96b2b1 Merge pull request #1510 from vmware-tanzu/doc_to_use_supervisor_without_concierge
Add tutorial doc for how to use Supervisor without Concierge
2023-05-09 13:08:28 -07:00
Ryan Richard
c08ebc622c Add tutorial doc for how to use Supervisor without Concierge 2023-05-09 13:06:02 -07:00
Joshua Casey
7bd09ff21d Merge pull request #1485 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-04-10 14:13:16 -05:00
Pinny
6801238e3e Bump go.mod direct dependencies 2023-04-10 08:02:12 +00:00
Ryan Richard
6cac3d583f Merge pull request #1482 from vmware-tanzu/pinny/bump-deps
Bump go.mod direct dependencies
2023-04-07 09:48:06 -07:00
Pinny
e13794cf73 Bump go.mod direct dependencies 2023-04-07 08:08:42 +00:00
Ryan Richard
5690ed7acd Merge pull request #1477 from vmware-tanzu/jtc/bump-deps
Bump Deps
2023-04-05 13:43:27 -07:00
Joshua Casey
6b1dc9f3ce Bump update-go-mod to latest direct go dependencies 2023-04-05 09:17:04 -05:00
Joshua Casey
ff89148a93 Bump all direct go dependencies 2023-04-05 09:15:17 -05:00
Joshua Casey
93f51c1a1d Bump Dockerfiles to go1.20.3 2023-04-05 09:12:10 -05:00
Ryan Richard
e66406ffe2 Merge pull request #1446 from pnbrown/search-update
Update docsearch to v3
2023-04-04 14:56:50 -07:00
Pinny
03a2d603d3 Updated versions in docs for v0.23.0 release 2023-04-04 21:38:59 +00:00
Ryan Richard
a7b4e65521 Merge branch 'main' into search-update 2023-04-04 13:44:22 -07:00
Nigel Brown
241a3a6cfb Update docsearch to v3
Update docsearch to v3

Signed-off-by: Nigel Brown <nigelb@vmware.com>
2023-03-06 14:56:02 -06:00
3937 changed files with 428390 additions and 372816 deletions

View File

@@ -21,3 +21,6 @@
# MacOS Desktop Services Store
.DS_Store
# Hugo temp file
.hugo_build.lock

View File

@@ -0,0 +1,36 @@
---
name: Add new K8s version
about: 'Checklist for maintainers to add new K8s minor version'
title: 'Add new K8s version vX.X'
labels: ''
assignees: ''
---
<!-- Note: Please update the issue title to include the new Kubernetes version number. -->
# Adding a new Kubernetes Version
## `pinniped's ci branch`
- [ ] Update `dockerfile-builders` pipeline
- [ ] Update `pull-requests` pipeline
- [ ] Update `main` pipeline
## `pinniped`
- [ ] Bump all golang dependencies (especially the `k8s.io` dependencies to use the new minor version).
- [ ] Be sure to verify that everything compiles and unit tests pass locally. This is probably a good starting point.
```shell
./hack/update-go-mod/update-go-mod.sh
./hack/module.sh unit
./hack/prepare-for-integration-tests.sh
```
- [ ] Log in to github as pinniped-ci-bot, then go to [this page](https://github.com/pinniped-ci-bot?tab=packages) and change the settings for the new `k8s-code-generator-1.*` image to be publicly visible
- [ ] Add the new K8s version to `hack/lib/kube-versions.txt` and run code generation.
## General Tasks
- [ ] Consider dropping support for any older versions of Kubernetes
- [ ] Create stories or chores to take advantage of features in the new Kubernetes version
- [ ] Close this issue

View File

@@ -0,0 +1,33 @@
---
name: Release checklist
about: Checklist for maintainers to prepare for an upcoming release
title: 'Release checklist for vX.X.X'
labels: ''
assignees: ''
---
<!-- Note: Please update the issue title to include the planned release's version number. -->
# Release checklist
- [ ] Ensure that Pinniped's dependencies have been upgraded, to the extent desired by the team (refer to the diff output from the latest run of the [all-golang-deps-updated](https://ci.pinniped.broadcom.net/teams/main/pipelines/security-scan/jobs/all-golang-deps-updated/) CI job)
- [ ] If you are updating golang in Pinniped, be sure to update golang in CI as well. Do a search-and-replace to update the version number everywhere in the pinniped `ci` branch.
- [ ] If the Fosite library is being updated and the format of the content of the Supervisor's storage Secrets are changed, or if any change to our own code changes the format of the content of the Supervisor's session storage Secrets, then be sure to update the `accessTokenStorageVersion`, `authorizeCodeStorageVersion`, `oidcStorageVersion`, `pkceStorageVersion`, `refreshTokenStorageVersion`, variables in files such as `internal/fositestorage/accesstoken/accesstoken.go`. Failing tests should signal the need to update these values.
- [ ] For go.mod direct dependencies that are v2 or above, such as `github.com/google/go-github/vXX`, check to see if there is a new major version available. Try using `hack/update-go-mod/update-majors.sh`.
- [ ] Evaluate all `replace` directives in the `go.mod` file. Are those versions up-to-date? Can any `replace` directives be removed?
- [ ] Evaluate all overrides in the `hack/update-go-mod/overrides.conf` file. Are those versions up-to-date? Can those overrides be removed?
- [ ] Ensure that Pinniped's codegen is up-to-date with the latest Kubernetes releases by making sure this [file](https://github.com/vmware/pinniped/blob/main/hack/lib/kube-versions.txt) is updated compared to the latest releases listed [here for active branches](https://kubernetes.io/releases/) and [here for non-active branches](https://kubernetes.io/releases/patch-releases/#non-active-branch-history)
- [ ] Ensure that the `k8s-code-generator` CI job definitions are up-to-date with the latest Go, K8s, and `controller-gen` versions
- [ ] All relevant feature and docs PRs are merged
- [ ] The [main pipeline](https://ci.pinniped.broadcom.net/teams/main/pipelines/main) is green, up to and including the `ready-to-release` job. Check that the expected git commit has passed the `ready-to-release` job.
- [ ] Manually trigger the jobs `run-int-misc`, `run-int-cloud-providers`, and `run-int-k8s-versions` in the main pipeline to run other pre-release tests. Depending on the number of Concourse workers, you may need to run these one at a time.
- [ ] Optional: a blog post for the release is written and submitted as a PR but not merged yet
- [ ] All merged user stories are accepted (manually tested)
- [ ] Only after all stories are accepted, manually trigger the `release` job to create a draft GitHub release
- [ ] Manually edit the draft release notes on the [GitHub release](https://github.com/vmware/pinniped/releases) to describe the contents of the release, using the format which was automatically added to the draft release
- [ ] Publish (i.e. make public) the draft release
- [ ] After making the release public, the jobs in the [main pipeline](https://ci.pinniped.broadcom.net/teams/main/pipelines/main) beyond the release job should auto-trigger, so check to make sure that they passed
- [ ] Edit the blog post's date to make it match the actual release date, and merge the blog post PR to make it live on the website
- [ ] Publicize the release via tweets, etc.
- [ ] Close this issue

128
.github/dependabot.yml vendored
View File

@@ -2,11 +2,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
open-pull-requests-limit: 100
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
open-pull-requests-limit: 2
@@ -14,12 +9,131 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "docker"
# Use dependabot to automate major-only dependency bumps
- package-ecosystem: "gomod"
open-pull-requests-limit: 2 # Not sure why there would ever be more than 1, just would not want to hide anything
directory: "/"
schedule:
interval: "daily"
# group all major dependency bumps together so there's only one pull request
groups:
go-modules:
patterns:
- "*"
update-types:
- "major"
ignore:
# For all packages, ignore all minor and patch updates
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
# Our own CI job is responsible for updating this Docker file now.
# - package-ecosystem: "docker"
# directory: "/"
# schedule:
# interval: "daily"
# Our own CI job is responsible for updating this Docker file now.
# - package-ecosystem: "docker"
# directory: "/hack" # this should keep the FIPS dockerfile updated per https://github.com/dependabot/feedback/issues/145#issuecomment-414738498
# schedule:
# interval: "daily"
- package-ecosystem: "docker"
directory: "/hack" # this should keep the FIPS dockerfile updated per https://github.com/dependabot/feedback/issues/145#issuecomment-414738498
directory: "/dockerfiles/code-coverage-uploader/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/crane/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/deployment-yaml-formatter/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/eks-deployer/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/gh-cli/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/integration-test-runner/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/integration-test-runner-beta/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/k8s-app-deployer/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/k8s-code-generator/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/pool-trigger-resource/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/test-bitnami-ldap/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/test-cfssl/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/test-dex/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/test-forward-proxy/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/dockerfiles/test-kubectl/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci
- package-ecosystem: "docker"
directory: "/pipelines/shared-helpers/test-binaries-image/"
open-pull-requests-limit: 100
schedule:
interval: "daily"
target-branch: ci

View File

@@ -1,18 +1,23 @@
# See https://codeql.github.com and https://github.com/github/codeql-action
# This action runs GitHub's industry-leading semantic code analysis engine, CodeQL, against a
# repository's source code to find security vulnerabilities. It then automatically uploads the
# results to GitHub so they can be displayed in the repository's security tab.
name: "CodeQL"
on:
push:
branches: [ main, release*, dynamic_clients ]
branches: [ "main", release* ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, release*, dynamic_clients ]
branches: [ "main" ]
schedule:
- cron: '39 13 * * 2'
- cron: '24 3 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
@@ -24,34 +29,44 @@ jobs:
language: [ 'go', 'javascript' ]
steps:
# Checkout our repository.
# See https://github.com/actions/checkout for documentation.
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Install Go.
# See https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file.
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
#- run: |
# make bootstrap
# make release
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@@ -1,55 +0,0 @@
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '29 11 * * 3'
push:
branches: [ main, release* ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
actions: read
contents: read
steps:
- name: "Checkout code"
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4
with:
results_file: results.sarif
results_format: sarif
# Read-only PAT token. To create it,
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
# Publish the results to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`,
# regardless of the value entered here.
publish_results: true
# Upload the results as artifacts (optional).
- name: "Upload artifact"
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
with:
sarif_file: results.sarif

3
.gitignore vendored
View File

@@ -19,3 +19,6 @@
# MacOS Desktop Services Store
.DS_Store
# Hugo temp file
.hugo_build.lock

View File

@@ -1,70 +1,167 @@
# https://github.com/golangci/golangci-lint#config-file
run:
deadline: 1m
skip-dirs:
- generated
# https://golangci-lint.run/usage/configuration/
version: "2"
linters:
disable-all: true
default: none
enable:
# default linters
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
# additional linters for this project (we should disable these if they get annoying).
- asciicheck
- bodyclose
- depguard
- dogsled
- exhaustive
- exportloopref
- funlen
- gochecknoglobals
- gochecknoinits
- gocritic
- gocyclo
- godot
- goheader
- goimports
- revive
- goprintffuncname
- gosec
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- rowserrcheck
- exportloopref
- sqlclosecheck
- unconvert
- whitespace
issues:
exclude-rules:
# exclude tests from some rules for things that are useful in a testing context.
- path: _test\.go
linters:
- asciicheck
- bodyclose
- copyloopvar
- dogsled
- errcheck
- exhaustive
- funlen
- gochecknoglobals
linters-settings:
funlen:
lines: 150
statements: 50
goheader:
values:
regexp:
# YYYY or YYYY-YYYY
YEARS: \d\d\d\d(-\d\d\d\d)?
template: |-
- gochecknoinits
- gocritic
- gocyclo
- godot
- goheader
- goprintffuncname
- gosec
- govet
- importas
- ineffassign
- intrange
- makezero
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- revive
- rowserrcheck
- spancheck
- sqlclosecheck
- staticcheck
- unconvert
- unused
- whitespace
settings:
funlen:
lines: 150
statements: 50
goheader:
values:
regexp:
# YYYY or YYYY-YYYY
YEARS: \d\d\d\d(-\d\d\d\d)?
template: |-
Copyright {{YEARS}} the Pinniped contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
goimports:
local-prefixes: go.pinniped.dev
importas:
alias:
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: utilerrors
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: github.com/coreos/go-oidc/v3/oidc
alias: coreosoidc
- pkg: github.com/ory/fosite/handler/oauth2
alias: fositeoauth2
- pkg: github.com/ory/fosite/token/jwt
alias: fositejwt
- pkg: github.com/go-jose/go-jose/v4/jwt
alias: josejwt
- pkg: github.com/go-jose/go-jose/v3
alias: oldjosev3
- pkg: go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1
alias: authenticationv1alpha1
- pkg: go.pinniped.dev/generated/latest/apis/supervisor/clientsecret/v1alpha1
alias: clientsecretv1alpha1
- pkg: go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1
alias: supervisorconfigv1alpha1
- pkg: go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1
alias: conciergeconfigv1alpha1
- pkg: go.pinniped.dev/generated/latest/client/concierge/clientset/versioned
alias: conciergeclientset
- pkg: go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/scheme
alias: conciergeclientsetscheme
- pkg: go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/fake
alias: conciergefake
- pkg: go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned
alias: supervisorclientset
- pkg: go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/scheme
alias: supervisorclientsetscheme
- pkg: go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/fake
alias: supervisorfake
- pkg: k8s.io/client-go/kubernetes/fake
alias: kubefake
- pkg: go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1
alias: idpv1alpha1
- pkg: go.pinniped.dev/generated/latest/client/concierge/informers/externalversions
alias: conciergeinformers
- pkg: go.pinniped.dev/generated/latest/client/supervisor/informers/externalversions
alias: supervisorinformers
- pkg: go.pinniped.dev/internal/concierge/scheme
alias: conciergescheme
no-unaliased: true # All packages explicitly listed above must be aliased
no-extra-aliases: false # Allow other aliases than the ones explicitly listed above
revive:
max-open-files: 2048
rules:
# Allow unused params that start with underscore. It can be nice to keep unused param names when implementing
# an interface sometimes, to help readers understand why it is unused in that particular implementation.
- name: unused-parameter
arguments:
- allowRegex: ^_
spancheck:
# https://golangci-lint.run/usage/linters/#spancheck
checks:
- end
- record-error
- set-status
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# exclude tests from some rules for things that are useful in a testing context.
- linters:
- funlen
- gochecknoglobals
- revive
path: _test\.go
- linters:
- revive
path: internal/testutil/
paths:
- generated
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
# Simplify code: gofmt with `-s` option.
# Default: true
simplify: false
# Apply the rewrite rules to the source before reformatting.
# https://pkg.go.dev/cmd/gofmt
# Default: []
rewrite-rules:
- pattern: interface{}
replacement: any
- pattern: a[b:len(a)]
replacement: a[b:]
goimports:
local-prefixes:
- go.pinniped.dev
exclusions:
generated: lax
paths:
- generated
- third_party$
- builtin$
- examples$

View File

@@ -3,7 +3,7 @@
exclude: '^(site|generated)/'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.5.0
hooks:
# TODO: find a version of this to validate ytt templates?
# - id: check-yaml

View File

@@ -30,5 +30,5 @@ TMC uses Pinniped to provide a uniform authentication experience across all atta
## Adding your organization to the list of adopters
If you are using Pinniped and would like to be included in the list of Pinniped Adopters, add an SVG version of your logo that is less than 150 KB to
the [img directory](https://github.com/vmware-tanzu/pinniped/tree/main/site/themes/pinniped/static/img) in this repo and submit a pull request with your change including 1-2 sentences describing how your organization is using Pinniped. Name the image file something that
the [img directory](https://github.com/vmware/pinniped/tree/main/site/themes/pinniped/static/img) in this repo and submit a pull request with your change including 1-2 sentences describing how your organization is using Pinniped. Name the image file something that
reflects your company (e.g., if your company is called Acme, name the image acme.svg). Please feel free to send us a message in [#pinniped](https://kubernetes.slack.com/archives/C01BW364RJA) with any questions you may have.

View File

@@ -20,26 +20,26 @@ The near-term and mid-term roadmap for the work planned for the project [maintai
## Discussion
Got a question, comment, or idea? Please don't hesitate to reach out
via GitHub [Discussions](https://github.com/vmware-tanzu/pinniped/discussions),
GitHub [Issues](https://github.com/vmware-tanzu/pinniped/issues),
via GitHub [Discussions](https://github.com/vmware/pinniped/discussions),
GitHub [Issues](https://github.com/vmware/pinniped/issues),
or in the Kubernetes Slack Workspace within the [#pinniped channel](https://go.pinniped.dev/community/slack).
Join our [Google Group](https://go.pinniped.dev/community/group) to receive updates and meeting invitations.
## Issues
Need an idea for a project to get started contributing? Take a look at the open
[issues](https://github.com/vmware-tanzu/pinniped/issues).
[issues](https://github.com/vmware/pinniped/issues).
Also check to see if any open issues are labeled with
["good first issue"](https://github.com/vmware-tanzu/pinniped/labels/good%20first%20issue)
or ["help wanted"](https://github.com/vmware-tanzu/pinniped/labels/help%20wanted).
["good first issue"](https://github.com/vmware/pinniped/labels/good%20first%20issue)
or ["help wanted"](https://github.com/vmware/pinniped/labels/help%20wanted).
### Bugs
To file a bug report, please first open an
[issue](https://github.com/vmware-tanzu/pinniped/issues/new?template=bug_report.md). The project team
[issue](https://github.com/vmware/pinniped/issues/new?template=bug_report.md). The project team
will work with you on your bug report.
Once the bug has been validated, a [pull request](https://github.com/vmware-tanzu/pinniped/compare)
Once the bug has been validated, a [pull request](https://github.com/vmware/pinniped/compare)
can be opened to fix the bug.
For specifics on what to include in your bug report, please follow the
@@ -48,11 +48,11 @@ guidelines in the issue and pull request templates.
### Features
To suggest a feature, please first open an
[issue](https://github.com/vmware-tanzu/pinniped/issues/new?template=feature-proposal.md)
and tag it with `proposal`, or create a new [Discussion](https://github.com/vmware-tanzu/pinniped/discussions).
[issue](https://github.com/vmware/pinniped/issues/new?template=feature-proposal.md)
and tag it with `proposal`, or create a new [Discussion](https://github.com/vmware/pinniped/discussions).
The project [maintainers](MAINTAINERS.md) will work with you on your feature request.
Once the feature request has been validated, a [pull request](https://github.com/vmware-tanzu/pinniped/compare)
Once the feature request has been validated, a [pull request](https://github.com/vmware/pinniped/compare)
can be opened to implement the feature.
For specifics on what to include in your feature request, please follow the
@@ -114,7 +114,6 @@ go build -o pinniped ./cmd/pinniped
1. Install dependencies:
- [`chromedriver`](https://chromedriver.chromium.org/) (and [Chrome](https://www.google.com/chrome/))
- [`docker`](https://www.docker.com/)
- `htpasswd` (installed by default on MacOS, usually found in `apache2-utils` package for linux)
- [`kapp`](https://carvel.dev/#getting-started)
@@ -122,11 +121,13 @@ go build -o pinniped ./cmd/pinniped
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [`ytt`](https://carvel.dev/#getting-started)
- [`nmap`](https://nmap.org/download.html)
- [`openssl`](https://www.openssl.org) (installed by default on MacOS)
- [Chrome](https://www.google.com/chrome/)
On macOS, these tools can be installed with [Homebrew](https://brew.sh/) (assuming you have Chrome installed already):
```bash
brew install kind vmware-tanzu/carvel/ytt vmware-tanzu/carvel/kapp kubectl chromedriver nmap && brew cask install docker
brew install kind carvel-dev/carvel/ytt carvel-dev/carvel/kapp kubectl nmap && brew cask install docker
```
1. Create a kind cluster, compile, create container images, and install Pinniped and supporting test dependencies using:
@@ -143,7 +144,7 @@ go build -o pinniped ./cmd/pinniped
To run specific integration tests, add the `-run` flag to the above command to specify a regexp for the test names.
Use a leading `/` on the regexp because the Pinniped integration tests are automatically nested under several parent tests
(see [integration/main_test.go](https://github.com/vmware-tanzu/pinniped/blob/main/test/integration/main_test.go)).
(see [integration/main_test.go](https://github.com/vmware/pinniped/blob/main/test/integration/main_test.go)).
For example, to run an integration test called `TestE2E`, add `-run /TestE2E` to the command shown above.
1. After making production code changes, recompile, redeploy, and run tests again by repeating the same
@@ -151,15 +152,46 @@ go build -o pinniped ./cmd/pinniped
To destroy the local Kubernetes cluster, run `./hack/kind-down.sh`.
#### Using GoLand to Run an Integration Test
It can sometimes be convenient to use GoLand to run an integration test. For example, this allows using the
GoLand debugger to debug the test itself (not the server, since that it running in-cluster).
Note that the output of `hack/prepare-for-integration-tests.sh` says:
```bash
# Using GoLand? Paste the result of this command into GoLand's run configuration "Environment".
# hack/integration-test-env-goland.sh | pbcopy
```
After using `hack/prepare-for-integration-tests.sh`, run `hack/integration-test-env-goland.sh | pbcopy` as instructed. Then:
1. Select and run an integration test within GoLand. It will fail complaining about missing env vars.
1. Pull down the menu that shows the name of the test which you just ran in the previous step, and choose "Edit Configurations...".
1. In the "Environment" text box for the run configuration of the integration test that you just ran,
paste the results of `hack/integration-test-env-goland.sh | pbcopy`.
1. Apply, and then run the integration test again. This time the test will use the environment variables provided.
Note that if you run `hack/prepare-for-integration-tests.sh` again, then you may need to repeat these steps.
Each run of `hack/prepare-for-integration-tests.sh` can result in different values for some of the env vars.
### Observing Tests on the Continuous Integration Environment
[CI](https://hush-house.pivotal.io/teams/tanzu-user-auth/pipelines/pinniped-pull-requests)
will not be triggered on a pull request until the pull request is reviewed and
CI will not be triggered on a pull request until the pull request is reviewed and
approved for CI by a project [maintainer](MAINTAINERS.md). Once CI is triggered,
the progress and results will appear on the Github page for that
[pull request](https://github.com/vmware-tanzu/pinniped/pulls) as checks. Links
[pull request](https://github.com/vmware/pinniped/pulls) as checks. Links
will appear to view the details of each check.
Starting in mid-2025, Pinniped's CI system is no longer externally visible due to corporate policies.
Please contact the maintainers for help with your PR if you encounter any CI failures.
They will be happy to share CI logs with you directly for your PR.
## CI
Pinniped's CI configuration and code is in the [`ci`](https://github.com/vmware/pinniped/tree/ci)
branch of this repo.
## Documentation
Any pull request which adds a new feature or changes the behavior of any feature which was previously documented

View File

@@ -1,30 +1,48 @@
# syntax=docker/dockerfile:1
# Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
# Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.20.2 as build-env
ARG BUILD_IMAGE=golang:1.25.5@sha256:6cc2338c038bc20f96ab32848da2b5c0641bb9bb5363f2c33e9b7c8838f9a208
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot@sha256:2b7c93f6d6648c11f0e80a48558c8f77885eb0445213b8e69a6a0d7c89fc6ae4
# Prepare to cross-compile by always running the build stage in the build platform, not the target platform.
FROM --platform=$BUILDPLATFORM $BUILD_IMAGE AS build-env
WORKDIR /work
COPY . .
ARG GOPROXY
# Build the executable binary (CGO_ENABLED=0 means static linking)
# Pass in GOCACHE (build cache) and GOMODCACHE (module cache) so they
# can be re-used between image builds.
ARG KUBE_GIT_VERSION
ENV KUBE_GIT_VERSION=$KUBE_GIT_VERSION
# These will be set by buildkit automatically, e.g. TARGETOS set to "linux" and TARGETARCH set to "amd64" or "arm64".
# Useful for building multi-arch container images.
ARG TARGETOS
ARG TARGETARCH
# If provided, must be a comma-separated list of Go build tags.
ARG ADDITIONAL_BUILD_TAGS
# Build the statically linked (CGO_ENABLED=0) binary.
# Mount source, build cache, and module cache for performance reasons.
# See https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
RUN \
--mount=target=. \
--mount=type=cache,target=/cache/gocache \
--mount=type=cache,target=/cache/gomodcache \
mkdir out && \
export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache CGO_ENABLED=0 GOOS=linux GOARCH=amd64 && \
go build -v -trimpath -ldflags "$(hack/get-ldflags.sh) -w -s" -o /usr/local/bin/pinniped-concierge-kube-cert-agent ./cmd/pinniped-concierge-kube-cert-agent/... && \
go build -v -trimpath -ldflags "$(hack/get-ldflags.sh) -w -s" -o /usr/local/bin/pinniped-server ./cmd/pinniped-server/... && \
export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH && \
go build -tags $ADDITIONAL_BUILD_TAGS -v -trimpath -ldflags "$(hack/get-ldflags.sh) -w -s" -o /usr/local/bin/pinniped-concierge-kube-cert-agent ./cmd/pinniped-concierge-kube-cert-agent/... && \
go build -tags $ADDITIONAL_BUILD_TAGS -v -trimpath -ldflags "$(hack/get-ldflags.sh) -w -s" -o /usr/local/bin/pinniped-server ./cmd/pinniped-server/... && \
ln -s /usr/local/bin/pinniped-server /usr/local/bin/pinniped-concierge && \
ln -s /usr/local/bin/pinniped-server /usr/local/bin/pinniped-supervisor && \
ln -s /usr/local/bin/pinniped-server /usr/local/bin/local-user-authenticator
# Use a distroless runtime image with CA certificates, timezone data, and not much else.
FROM gcr.io/distroless/static:nonroot@sha256:2a9e2b4fa771d31fe3346a873be845bfc2159695b9f90ca08e950497006ccc2e
# Note that we are not using --platform here, so it will choose the base image for the target platform, not the build platform.
# By using "distroless/static" instead of "distroless/static-debianXX" we can float on the latest stable version of debian.
# See https://github.com/GoogleContainerTools/distroless#base-operating-system
FROM $BASE_IMAGE
# Copy the server binary from the build-env stage.
COPY --from=build-env /usr/local/bin /usr/local/bin

View File

@@ -11,7 +11,7 @@ all members should work together to achieve this goal.
# Code of Conduct
The Pinniped community abides by this
[code of conduct](https://github.com/vmware-tanzu/pinniped/blob/main/CODE_OF_CONDUCT.md).
[code of conduct](https://github.com/vmware/pinniped/blob/main/CODE_OF_CONDUCT.md).
# Community Roles
@@ -29,7 +29,7 @@ notifying one of the maintainers.
**Note:** If a maintainer leaves their employer they are still considered a maintainer of Pinniped, unless they
voluntarily resign. Employment is not taken into consideration when determining maintainer eligibility unless the
company itself violates our [Code of Conduct](https://github.com/vmware-tanzu/pinniped/blob/main/CODE_OF_CONDUCT.md).
company itself violates our [Code of Conduct](https://github.com/vmware/pinniped/blob/main/CODE_OF_CONDUCT.md).
# Decision Making

View File

@@ -2,17 +2,17 @@
| Maintainer | GitHub ID | Affiliation |
|-----------------|-----------------------------------------------------------|------------------------------------------|
| Ben Petersen | [benjaminapetersen](https://github.com/benjaminapetersen) | [VMware](https://www.github.com/vmware/) |
| Ryan Richard | [cfryanr](https://github.com/cfryanr) | [VMware](https://www.github.com/vmware/) |
| Joshua T. Casey | [joshuatcasey](https://github.com/joshuatcasey) | [VMware](https://www.github.com/vmware/) |
## Emeritus Maintainers
| Maintainer | GitHub ID |
|-------------------|---------------------------------------------------------|
| Andrew Keesler | [ankeesler](https://github.com/ankeesler) |
| Anjali Telang | [anjaltelang](https://github.com/anjaltelang) |
| Margo Crawford | [margocrawf](https://github.com/margocrawf) |
| Matt Moyer | [mattmoyer](https://github.com/mattmoyer) |
| Mo Khan | [enj](https://github.com/enj) |
| Pablo Schuhmacher | [pabloschuhmacher](https://github.com/pabloschuhmacher) |
| Maintainer | GitHub ID |
|-------------------|-----------------------------------------------------------|
| Andrew Keesler | [ankeesler](https://github.com/ankeesler) |
| Anjali Telang | [anjaltelang](https://github.com/anjaltelang) |
| Ben Petersen | [benjaminapetersen](https://github.com/benjaminapetersen) |
| Margo Crawford | [margocrawf](https://github.com/margocrawf) |
| Matt Moyer | [mattmoyer](https://github.com/mattmoyer) |
| Mo Khan | [enj](https://github.com/enj) |
| Pablo Schuhmacher | [pabloschuhmacher](https://github.com/pabloschuhmacher) |

View File

@@ -19,8 +19,8 @@ Care to kick the tires? It's easy to [install and try Pinniped](https://pinniped
## Discussion
Got a question, comment, or idea? Please don't hesitate to reach out
via GitHub [Discussions](https://github.com/vmware-tanzu/pinniped/discussions),
GitHub [Issues](https://github.com/vmware-tanzu/pinniped/issues),
via GitHub [Discussions](https://github.com/vmware/pinniped/discussions),
GitHub [Issues](https://github.com/vmware/pinniped/issues),
or in the Kubernetes Slack Workspace within the [#pinniped channel](https://go.pinniped.dev/community/slack).
Join our [Google Group](https://go.pinniped.dev/community/group) to receive updates and meeting invitations.
@@ -37,7 +37,7 @@ building and testing the code, submitting PRs, and other contributor topics.
## Adopters
Some organizations and products using Pinniped are featured in [ADOPTERS.md](ADOPTERS.md).
Add your own organization or product [here](https://github.com/vmware-tanzu/pinniped/discussions/152).
Add your own organization or product [here](https://github.com/vmware/pinniped/discussions/152).
## Reporting security vulnerabilities
@@ -47,4 +47,4 @@ Please follow the procedure described in [SECURITY.md](SECURITY.md).
Pinniped is open source and licensed under Apache License Version 2.0. See [LICENSE](LICENSE).
Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.

View File

@@ -5,37 +5,22 @@
This document provides a high-level overview of the next big features the maintainers are planning to work on. This
should serve as a reference point for Pinniped users and contributors to understand where the project is heading, and
help determine if a contribution could be conflicting with a longer term plan.
The [Pinniped project backlog](https://github.com/orgs/vmware-tanzu/projects/43/) is prioritized based on this roadmap,
and it provides a more granular view of what the maintainers are working on a day-to-day basis.
### How to help
Discussion on the roadmap is welcomed. If you want to provide suggestions, use cases, and feedback to an item in the
roadmap, please reach out to the maintainers using one of the methods described in the project's
[README.md](https://github.com/vmware-tanzu/pinniped#discussion).
[Contributions](https://github.com/vmware-tanzu/pinniped/blob/main/CONTRIBUTING.md) to Pinniped are also welcomed.
[README.md](https://github.com/vmware/pinniped#discussion).
[Contributions](https://github.com/vmware/pinniped/blob/main/CONTRIBUTING.md) to Pinniped are also welcomed.
### How to add an item to the roadmap
One of the most important aspects in any open source community is the concept of proposals. Large changes to the
codebase and / or new features should be preceded by
a [proposal](https://github.com/vmware-tanzu/pinniped/tree/main/proposals) in our repo.
a [proposal](https://github.com/vmware/pinniped/tree/main/proposals) in our repo.
For smaller enhancements, you can open an issue to track that initiative or feature request.
We work with and rely on community feedback to focus our efforts to improve Pinniped and maintain a healthy roadmap.
### Current Roadmap
The following table includes the current roadmap for Pinniped. Please take the timelines and dates as proposals and
goals. Priorities and requirements change based on community feedback, roadblocks encountered, community contributions,
Priorities and requirements change based on community feedback, roadblocks encountered, community contributions,
etc. If you depend on a specific item, we encourage you to reach out for updated status information, or help us deliver
that feature by [contributing](https://github.com/vmware-tanzu/pinniped/blob/main/CONTRIBUTING.md) to Pinniped.
Last Updated: Sept 2022
|Theme|Description|Timeline|
|--|--|--|
|Improving Usability|Dynamic Oauth Client Support for integrating with UI/Dashboards |Sept/Oct 2022|
|Improving Usability|Support for custom claim mappings in OIDCIdentityProvider |Q4 2022|
|Improving Usability|Support for Multiple Identity Providers |Q4 2022|
|Improving Security Posture|Support Audit logging of security events related to Authentication |Q4 2022|
|Improving Security Posture|Session Management |2022/2023|
|Improving Security Posture|Secrets Rotation and Management |2022/2023|
that feature by [contributing](https://github.com/vmware/pinniped/blob/main/CONTRIBUTING.md) to Pinniped.

View File

@@ -21,12 +21,3 @@ The following items are out of scope for the Pinniped project.
- Standalone identity provider for general use.
- Machine-to-machine (service) identity.
- Running outside of Kubernetes.
## Roadmap
See our [open milestones][milestones] and the [`priority/backlog` label][backlog] for an idea about what's next on our roadmap.
For more details on proposing features and bugs, check out our [contributing](./CONTRIBUTING.md) doc.
[milestones]: https://github.com/vmware-tanzu/pinniped/milestones
[backlog]: https://github.com/vmware-tanzu/pinniped/labels/priority%2Fbacklog

View File

@@ -10,11 +10,11 @@ As of right now, only the latest version of Pinniped is supported.
Security is of the highest importance and all security vulnerabilities or suspected security vulnerabilities should be reported to Pinniped privately, to minimize attacks against current users of Pinniped before they are fixed. Vulnerabilities will be investigated and patched on the next patch (or minor) release as soon as possible. This information could be kept entirely internal to the project.
If you know of a publicly disclosed security vulnerability for Pinniped, please **IMMEDIATELY** contact the VMware Security Team (security@vmware.com). The use of encrypted email is encouraged. The public PGP key can be found at https://kb.vmware.com/kb/1055.
If you know of a publicly disclosed security vulnerability for Pinniped, please **IMMEDIATELY** contact the VMware Security Team (vmware.psirt@broadcom.com). The use of encrypted email is encouraged. The public PGP key can be found at https://kb.vmware.com/kb/1055.
**IMPORTANT: Do not file public issues on GitHub for security vulnerabilities**
To report a vulnerability or a security-related issue, please contact the VMware email address with the details of the vulnerability. The email will be fielded by the VMware Security Team and then shared with the Pinniped maintainers who have committer and release permissions. Emails will be addressed within 3 business days, including a detailed plan to investigate the issue and any potential workarounds to perform in the meantime. Do not report non-security-impacting bugs through this channel. Use [GitHub issues](https://github.com/vmware-tanzu/pinniped/issues/new/choose) instead.
To report a vulnerability or a security-related issue, please contact the VMware email address with the details of the vulnerability. The email will be fielded by the VMware Security Team and then shared with the Pinniped maintainers who have committer and release permissions. Emails will be addressed within 3 business days, including a detailed plan to investigate the issue and any potential workarounds to perform in the meantime. Do not report non-security-impacting bugs through this channel. Use [GitHub issues](https://github.com/vmware/pinniped/issues/new/choose) instead.
## Proposed Email Content
@@ -48,13 +48,13 @@ The VMware Security Team will respond to vulnerability reports as follows:
## Public Disclosure Process
The Security Team publishes a [public advisory](https://github.com/vmware-tanzu/pinniped/security/advisories) to the Pinniped community via GitHub. In most cases, additional communication via Slack, Twitter, mailing lists, blog and other channels will assist in educating Pinniped users and rolling out the patched release to affected users.
The Security Team publishes a [public advisory](https://github.com/vmware/pinniped/security/advisories) to the Pinniped community via GitHub. In most cases, additional communication via Slack, Twitter, mailing lists, blog and other channels will assist in educating Pinniped users and rolling out the patched release to affected users.
The Security Team will also publish any mitigating steps users can take until the fix can be applied to their Pinniped instances. Pinniped distributors will handle creating and publishing their own security advisories.
## Mailing lists
* Use security@vmware.com to report security concerns to the VMware Security Team, who uses the list to privately discuss security issues and fixes prior to disclosure. The use of encrypted email is encouraged. The public PGP key can be found at https://kb.vmware.com/kb/1055.
* Use vmware.psirt@broadcom.com to report security concerns to the VMware Security Team, who uses the list to privately discuss security issues and fixes prior to disclosure. The use of encrypted email is encouraged. The public PGP key can be found at https://kb.vmware.com/kb/1055.
* Join the [Pinniped Distributors](https://groups.google.com/g/project-pinniped-distributors) mailing list for early private information and vulnerability disclosure. Early disclosure may include mitigating steps and additional information on security patch releases. See below for information on how Pinniped distributors or vendors can apply to join this list.
## Early Disclosure to Pinniped Distributors List
@@ -81,7 +81,7 @@ The information that members receive on the Pinniped Distributors mailing list m
Before you share any information from the list with members of your team who are required to fix the issue, these team members must agree to the same terms, and only be provided with information on a need-to-know basis.
In the unfortunate event that you share information beyond what is permitted by this policy, you must urgently inform the VMware Security Team (security@vmware.com) of exactly what information was leaked and to whom. If you continue to leak information and break the policy outlined here, you will be permanently removed from the list.
In the unfortunate event that you share information beyond what is permitted by this policy, you must urgently inform the VMware Security Team (vmware.psirt@broadcom.com) of exactly what information was leaked and to whom. If you continue to leak information and break the policy outlined here, you will be permanently removed from the list.
## Requesting to Join

View File

@@ -1,9 +1,7 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=authentication.concierge.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped concierge authentication API.

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,54 +1,280 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// Status of a JWT authenticator.
type JWTAuthenticatorPhase string
const (
// JWTAuthenticatorPhasePending is the default phase for newly-created JWTAuthenticator resources.
JWTAuthenticatorPhasePending JWTAuthenticatorPhase = "Pending"
// JWTAuthenticatorPhaseReady is the phase for an JWTAuthenticator resource in a healthy state.
JWTAuthenticatorPhaseReady JWTAuthenticatorPhase = "Ready"
// JWTAuthenticatorPhaseError is the phase for an JWTAuthenticator in an unhealthy state.
JWTAuthenticatorPhaseError JWTAuthenticatorPhase = "Error"
)
// JWTAuthenticatorStatus is the status of a JWT authenticator.
type JWTAuthenticatorStatus struct {
// Represents the observations of the authenticator's current state.
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// Phase summarizes the overall status of the JWTAuthenticator.
// +kubebuilder:default=Pending
// +kubebuilder:validation:Enum=Pending;Ready;Error
Phase JWTAuthenticatorPhase `json:"phase,omitempty"`
}
// Spec for configuring a JWT authenticator.
// JWTAuthenticatorSpec is the spec for configuring a JWT authenticator.
type JWTAuthenticatorSpec struct {
// Issuer is the OIDC issuer URL that will be used to discover public signing keys. Issuer is
// issuer is the OIDC issuer URL that will be used to discover public signing keys. Issuer is
// also used to validate the "iss" JWT claim.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^https://`
Issuer string `json:"issuer"`
// Audience is the required value of the "aud" JWT claim.
// audience is the required value of the "aud" JWT claim.
// +kubebuilder:validation:MinLength=1
Audience string `json:"audience"`
// Claims allows customization of the claims that will be mapped to user identity
// claims allows customization of the claims that will be mapped to user identity
// for Kubernetes access.
// +optional
Claims JWTTokenClaims `json:"claims"`
// TLS configuration for communicating with the OIDC provider.
// claimValidationRules are rules that are applied to validate token claims to authenticate users.
// This is similar to claimValidationRules from Kubernetes AuthenticationConfiguration as documented in
// https://kubernetes.io/docs/reference/access-authn-authz/authentication.
// This is an advanced configuration option. During an end-user login flow, mistakes in this
// configuration will cause the user's login to fail.
// +optional
ClaimValidationRules []ClaimValidationRule `json:"claimValidationRules,omitempty"`
// userValidationRules are rules that are applied to final user before completing authentication.
// These allow invariants to be applied to incoming identities such as preventing the
// use of the system: prefix that is commonly used by Kubernetes components.
// The validation rules are logically ANDed together and must all return true for the validation to pass.
// This is similar to claimValidationRules from Kubernetes AuthenticationConfiguration as documented in
// https://kubernetes.io/docs/reference/access-authn-authz/authentication.
// This is an advanced configuration option. During an end-user login flow, mistakes in this
// configuration will cause the user's login to fail.
// +optional
UserValidationRules []UserValidationRule `json:"userValidationRules,omitempty"`
// tls is the configuration for communicating with the OIDC provider via TLS.
// +optional
TLS *TLSSpec `json:"tls,omitempty"`
}
// ClaimValidationRule provides the configuration for a single claim validation rule.
type ClaimValidationRule struct {
// claim is the name of a required claim.
// Only string claim keys are supported.
// Mutually exclusive with expression and message.
// +optional
Claim string `json:"claim,omitempty"`
// requiredValue is the value of a required claim.
// Only string claim values are supported.
// If claim is set and requiredValue is not set, the claim must be present with a value set to the empty string.
// Mutually exclusive with expression and message.
// +optional
RequiredValue string `json:"requiredValue,omitempty"`
// expression represents the expression which will be evaluated by CEL.
// Must produce a boolean.
//
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
// Must return true for the validation to pass.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Mutually exclusive with claim and requiredValue.
// +optional
Expression string `json:"expression,omitempty"`
// message customizes the returned error message when expression returns false.
// message is a literal string.
// Mutually exclusive with claim and requiredValue.
// +optional
Message string `json:"message,omitempty"`
}
// UserValidationRule provides the configuration for a single user info validation rule.
type UserValidationRule struct {
// expression represents the expression which will be evaluated by CEL.
// Must return true for the validation to pass.
//
// CEL expressions have access to the contents of UserInfo, organized into CEL variable:
// - 'user' - authentication.k8s.io/v1, Kind=UserInfo object
// Refer to https://github.com/kubernetes/api/blob/release-1.28/authentication/v1/types.go#L105-L122 for the definition.
// API documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#userinfo-v1-authentication-k8s-io
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// +required
Expression string `json:"expression"`
// message customizes the returned error message when rule returns false.
// message is a literal string.
// +optional
Message string `json:"message,omitempty"`
}
// JWTTokenClaims allows customization of the claims that will be mapped to user identity
// for Kubernetes access.
type JWTTokenClaims struct {
// Groups is the name of the claim which should be read to extract the user's
// group membership from the JWT token. When not specified, it will default to "groups".
// username is the name of the claim which should be read to extract the
// username from the JWT token. When not specified, it will default to "username",
// unless usernameExpression is specified.
//
// Mutually exclusive with usernameExpression. Use either username or usernameExpression to
// determine the user's username from the JWT token.
// +optional
Username string `json:"username"`
// usernameExpression represents an expression which will be evaluated by CEL.
// The expression's result will become the user's username.
//
// usernameExpression is similar to claimMappings.username.expression from Kubernetes AuthenticationConfiguration
// as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
// This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
// must evaluate to the expected type without errors, or else the user's login will fail.
// Additionally, mistakes in this configuration can cause the users to have unintended usernames.
//
// The expression must produce a non-empty string value.
// If the expression uses 'claims.email', then 'claims.email_verified' must be used in
// the expression or extra[*].valueExpression or claimValidationRules[*].expression.
// An example claim validation rule expression that matches the validation automatically
// applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'.
// By explicitly comparing the value to true, we let type-checking see the result will be a boolean,
// and to make sure a non-boolean email_verified claim will be caught at runtime.
//
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Mutually exclusive with username. Use either username or usernameExpression to
// determine the user's username from the JWT token.
// +optional
UsernameExpression string `json:"usernameExpression,omitempty"`
// groups is the name of the claim which should be read to extract the user's
// group membership from the JWT token. When not specified, it will default to "groups",
// unless groupsExpression is specified.
//
// Mutually exclusive with groupsExpression. Use either groups or groupsExpression to
// determine the user's group membership from the JWT token.
// +optional
Groups string `json:"groups"`
// Username is the name of the claim which should be read to extract the
// username from the JWT token. When not specified, it will default to "username".
// groupsExpression represents an expression which will be evaluated by CEL.
// The expression's result will become the user's group memberships.
//
// groupsExpression is similar to claimMappings.groups.expression from Kubernetes AuthenticationConfiguration
// as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
// This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
// must evaluate to one of the expected types without errors, or else the user's login will fail.
// Additionally, mistakes in this configuration can cause the users to have unintended group memberships.
//
// The expression must produce a string or string array value.
// "", [], and null values are treated as the group mapping not being present.
//
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Mutually exclusive with groups. Use either groups or groupsExpression to
// determine the user's group membership from the JWT token.
// +optional
Username string `json:"username"`
GroupsExpression string `json:"groupsExpression,omitempty"`
// extra is similar to claimMappings.extra from Kubernetes AuthenticationConfiguration
// as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
//
// However, note that the Pinniped Concierge issues client certificates to users for the purpose
// of authenticating, and the Kubernetes API server does not have any mechanism for transmitting
// auth extras via client certificates. When configured, these extras will appear in client
// certificates issued by the Pinniped Supervisor in the x509 Subject field as Organizational
// Units (OU). However, when this client certificate is presented to Kubernetes for authentication,
// Kubernetes will ignore these extras. This is probably only useful if you are using a custom
// authenticating proxy in front of your Kubernetes API server which can translate these OUs into
// auth extras, as described by
// https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authenticating-proxy.
// This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
// must evaluate to either a string or an array of strings, or else the user's login will fail.
//
// These keys must be a domain-prefixed path (such as "acme.io/foo") and must not contain an equals sign ("=").
//
// expression must produce a string or string array value.
// If the value is empty, the extra mapping will not be present.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// hard-coded extra key/value
// - key: "acme.io/foo"
// valueExpression: "'bar'"
// This will result in an extra attribute - acme.io/foo: ["bar"]
//
// hard-coded key, value copying claim value
// - key: "acme.io/foo"
// valueExpression: "claims.some_claim"
// This will result in an extra attribute - acme.io/foo: [value of some_claim]
//
// hard-coded key, value derived from claim value
// - key: "acme.io/admin"
// valueExpression: '(has(claims.is_admin) && claims.is_admin) ? "true":""'
// This will result in:
// - if is_admin claim is present and true, extra attribute - acme.io/admin: ["true"]
// - if is_admin claim is present and false or is_admin claim is not present, no extra attribute will be added
//
// +optional
Extra []ExtraMapping `json:"extra,omitempty"`
}
// ExtraMapping provides the configuration for a single extra mapping.
type ExtraMapping struct {
// key is a string to use as the extra attribute key.
// key must be a domain-prefix path (e.g. example.org/foo). All characters before the first "/" must be a valid
// subdomain as defined by RFC 1123. All characters trailing the first "/" must
// be valid HTTP Path characters as defined by RFC 3986.
// key must be lowercase.
// Required to be unique.
// Additionally, the key must not contain an equals sign ("=").
// +required
Key string `json:"key"`
// valueExpression is a CEL expression to extract extra attribute value.
// valueExpression must produce a string or string array value.
// "", [], and null values are treated as the extra mapping not being present.
// Empty string values contained within a string array are filtered out.
//
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// +required
ValueExpression string `json:"valueExpression"`
}
// JWTAuthenticator describes the configuration of a JWT authenticator.
@@ -62,20 +288,21 @@ type JWTTokenClaims struct {
// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster
// +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer`
// +kubebuilder:printcolumn:name="Audience",type=string,JSONPath=`.spec.audience`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:subresource:status
type JWTAuthenticator struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec for configuring the authenticator.
// spec for configuring the authenticator.
Spec JWTAuthenticatorSpec `json:"spec"`
// Status of the authenticator.
// status of the authenticator.
Status JWTAuthenticatorStatus `json:"status,omitempty"`
}
// List of JWTAuthenticator objects.
// JWTAuthenticatorList is a list of JWTAuthenticator objects.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type JWTAuthenticatorList struct {
metav1.TypeMeta `json:",inline"`

View File

@@ -1,75 +0,0 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// ConditionStatus is effectively an enum type for Condition.Status.
type ConditionStatus string
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
// can't decide if a resource is in the condition or not. In the future, we could add other
// intermediate conditions, e.g. ConditionDegraded.
const (
ConditionTrue ConditionStatus = "True"
ConditionFalse ConditionStatus = "False"
ConditionUnknown ConditionStatus = "Unknown"
)
// Condition status of a resource (mirrored from the metav1.Condition type added in Kubernetes 1.19). In a future API
// version we can switch to using the upstream type.
// See https://github.com/kubernetes/apimachinery/blob/v0.19.0/pkg/apis/meta/v1/types.go#L1353-L1413.
type Condition struct {
// type of condition in CamelCase or in foo.example.com/CamelCase.
// ---
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
// useful (see .node.status.conditions), the ability to deconflict is important.
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
// +kubebuilder:validation:MaxLength=316
Type string `json:"type"`
// status of the condition, one of True, False, Unknown.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=True;False;Unknown
Status ConditionStatus `json:"status"`
// observedGeneration represents the .metadata.generation that the condition was set based upon.
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
// with respect to the current state of the instance.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// lastTransitionTime is the last time the condition transitioned from one status to another.
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
// Producers of specific condition types may define expected values and meanings for this field,
// and whether the values are considered a guaranteed API.
// The value should be a CamelCase string.
// This field may not be empty.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=1024
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
Reason string `json:"reason"`
// message is a human readable message indicating details about the transition.
// This may be an empty string.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=32768
Message string `json:"message"`
}

View File

@@ -1,11 +1,47 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
// Configuration for configuring TLS on various authenticators.
// CertificateAuthorityDataSourceKind enumerates the sources for CA Bundles.
//
// +kubebuilder:validation:Enum=Secret;ConfigMap
type CertificateAuthorityDataSourceKind string
const (
// CertificateAuthorityDataSourceKindConfigMap uses a Kubernetes configmap to source CA Bundles.
CertificateAuthorityDataSourceKindConfigMap = CertificateAuthorityDataSourceKind("ConfigMap")
// CertificateAuthorityDataSourceKindSecret uses a Kubernetes secret to source CA Bundles.
// Secrets used to source CA Bundles must be of type kubernetes.io/tls or Opaque.
CertificateAuthorityDataSourceKindSecret = CertificateAuthorityDataSourceKind("Secret")
)
// CertificateAuthorityDataSourceSpec provides a source for CA bundle used for client-side TLS verification.
type CertificateAuthorityDataSourceSpec struct {
// Kind configures whether the CA bundle is being sourced from a Kubernetes secret or a configmap.
// Allowed values are "Secret" or "ConfigMap".
// "ConfigMap" uses a Kubernetes configmap to source CA Bundles.
// "Secret" uses Kubernetes secrets of type kubernetes.io/tls or Opaque to source CA Bundles.
Kind CertificateAuthorityDataSourceKind `json:"kind"`
// Name is the resource name of the secret or configmap from which to read the CA bundle.
// The referenced secret or configmap must be created in the same namespace where Pinniped Concierge is installed.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Key is the key name within the secret or configmap from which to read the CA bundle.
// The value found at this key in the secret or configmap must not be empty, and must be a valid PEM-encoded
// certificate bundle.
// +kubebuilder:validation:MinLength=1
Key string `json:"key"`
}
// TLSSpec provides TLS configuration on various authenticators.
type TLSSpec struct {
// X.509 Certificate Authority (base64-encoded PEM bundle). If omitted, a default set of system roots will be trusted.
// +optional
CertificateAuthorityData string `json:"certificateAuthorityData,omitempty"`
// Reference to a CA bundle in a secret or a configmap.
// Any changes to the CA bundle in the secret or configmap will be dynamically reloaded.
// +optional
CertificateAuthorityDataSource *CertificateAuthorityDataSourceSpec `json:"certificateAuthorityDataSource,omitempty"`
}

View File

@@ -1,10 +1,23 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type WebhookAuthenticatorPhase string
const (
// WebhookAuthenticatorPhasePending is the default phase for newly-created WebhookAuthenticator resources.
WebhookAuthenticatorPhasePending WebhookAuthenticatorPhase = "Pending"
// WebhookAuthenticatorPhaseReady is the phase for an WebhookAuthenticator resource in a healthy state.
WebhookAuthenticatorPhaseReady WebhookAuthenticatorPhase = "Ready"
// WebhookAuthenticatorPhaseError is the phase for an WebhookAuthenticator in an unhealthy state.
WebhookAuthenticatorPhaseError WebhookAuthenticatorPhase = "Error"
)
// Status of a webhook authenticator.
type WebhookAuthenticatorStatus struct {
// Represents the observations of the authenticator's current state.
@@ -12,7 +25,11 @@ type WebhookAuthenticatorStatus struct {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// Phase summarizes the overall status of the WebhookAuthenticator.
// +kubebuilder:default=Pending
// +kubebuilder:validation:Enum=Pending;Ready;Error
Phase WebhookAuthenticatorPhase `json:"phase,omitempty"`
}
// Spec for configuring a webhook authenticator.
@@ -33,6 +50,7 @@ type WebhookAuthenticatorSpec struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster
// +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:subresource:status
type WebhookAuthenticator struct {

View File

@@ -1,9 +1,7 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=config.concierge.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped concierge configuration API.

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -49,6 +49,7 @@ type CredentialIssuerSpec struct {
}
// ImpersonationProxyMode enumerates the configuration modes for the impersonation proxy.
// Allowed values are "auto", "enabled", or "disabled".
//
// +kubebuilder:validation:Enum=auto;enabled;disabled
type ImpersonationProxyMode string
@@ -65,6 +66,7 @@ const (
)
// ImpersonationProxyServiceType enumerates the types of service that can be provisioned for the impersonation proxy.
// Allowed values are "LoadBalancer", "ClusterIP", or "None".
//
// +kubebuilder:validation:Enum=LoadBalancer;ClusterIP;None
type ImpersonationProxyServiceType string
@@ -80,6 +82,28 @@ const (
ImpersonationProxyServiceTypeNone = ImpersonationProxyServiceType("None")
)
// ImpersonationProxyTLSSpec contains information about how the Concierge impersonation proxy should
// serve TLS.
//
// If CertificateAuthorityData is not provided, the Concierge impersonation proxy will check the secret
// for a field called "ca.crt", which will be used as the CertificateAuthorityData.
//
// If neither CertificateAuthorityData nor ca.crt is provided, no CA bundle will be advertised for
// the impersonation proxy endpoint.
type ImpersonationProxyTLSSpec struct {
// X.509 Certificate Authority (base64-encoded PEM bundle).
// Used to advertise the CA bundle for the impersonation proxy endpoint.
//
// +optional
CertificateAuthorityData string `json:"certificateAuthorityData,omitempty"`
// SecretName is the name of a Secret in the same namespace, of type `kubernetes.io/tls`, which contains
// the TLS serving certificate for the Concierge impersonation proxy endpoint.
//
// +kubebuilder:validation:MinLength=1
SecretName string `json:"secretName,omitempty"`
}
// ImpersonationProxySpec describes the intended configuration of the Concierge impersonation proxy.
type ImpersonationProxySpec struct {
// Mode configures whether the impersonation proxy should be started:
@@ -100,6 +124,13 @@ type ImpersonationProxySpec struct {
//
// +optional
ExternalEndpoint string `json:"externalEndpoint,omitempty"`
// TLS contains information about how the Concierge impersonation proxy should serve TLS.
//
// If this field is empty, the impersonation proxy will generate its own TLS certificate.
//
// +optional
TLS *ImpersonationProxyTLSSpec `json:"tls,omitempty"`
}
// ImpersonationProxyServiceSpec describes how the Concierge should provision a Service to expose the impersonation proxy.
@@ -130,24 +161,6 @@ type ImpersonationProxyServiceSpec struct {
type CredentialIssuerStatus struct {
// List of integration strategies that were attempted by Pinniped.
Strategies []CredentialIssuerStrategy `json:"strategies"`
// Information needed to form a valid Pinniped-based kubeconfig using this credential issuer.
// This field is deprecated and will be removed in a future version.
// +optional
KubeConfigInfo *CredentialIssuerKubeConfigInfo `json:"kubeConfigInfo,omitempty"`
}
// CredentialIssuerKubeConfigInfo provides the information needed to form a valid Pinniped-based kubeconfig using this credential issuer.
// This type is deprecated and will be removed in a future version.
type CredentialIssuerKubeConfigInfo struct {
// The K8s API server URL.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^https://|^http://`
Server string `json:"server"`
// The K8s API server CA bundle.
// +kubebuilder:validation:MinLength=1
CertificateAuthorityData string `json:"certificateAuthorityData"`
}
// CredentialIssuerStrategy describes the status of an integration strategy that was attempted by Pinniped.

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:deepcopy-gen=package

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package identity

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package identity

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package identity

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,10 +1,11 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/concierge/identity
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-model-package=dev.pinniped.apis.concierge.identity.v1alpha1
// +groupName=identity.concierge.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped identity API.

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package validation

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:deepcopy-gen=package

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package login

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package login

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package login

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,10 +1,11 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/concierge/login
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-model-package=dev.pinniped.apis.concierge.login.v1alpha1
// +groupName=login.concierge.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped login API.

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:deepcopy-gen=package

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package clientsecret

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package clientsecret

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,10 +1,11 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/supervisor/clientsecret
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-model-package=dev.pinniped.apis.supervisor.clientsecret.v1alpha1
// +groupName=clientsecret.supervisor.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped client secret API.

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,10 +1,7 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/supervisor/config
// +k8s:defaulter-gen=TypeMeta
// +groupName=config.supervisor.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the Pinniped supervisor configuration API.

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -8,14 +8,17 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +kubebuilder:validation:Enum=Success;Duplicate;Invalid;SameIssuerHostMustUseSameSecret
type FederationDomainStatusCondition string
type FederationDomainPhase string
const (
SuccessFederationDomainStatusCondition = FederationDomainStatusCondition("Success")
DuplicateFederationDomainStatusCondition = FederationDomainStatusCondition("Duplicate")
SameIssuerHostMustUseSameSecretFederationDomainStatusCondition = FederationDomainStatusCondition("SameIssuerHostMustUseSameSecret")
InvalidFederationDomainStatusCondition = FederationDomainStatusCondition("Invalid")
// FederationDomainPhasePending is the default phase for newly-created FederationDomain resources.
FederationDomainPhasePending FederationDomainPhase = "Pending"
// FederationDomainPhaseReady is the phase for an FederationDomain resource in a healthy state.
FederationDomainPhaseReady FederationDomainPhase = "Ready"
// FederationDomainPhaseError is the phase for an FederationDomain in an unhealthy state.
FederationDomainPhaseError FederationDomainPhase = "Error"
)
// FederationDomainTLSSpec is a struct that describes the TLS configuration for an OIDC Provider.
@@ -42,6 +45,159 @@ type FederationDomainTLSSpec struct {
SecretName string `json:"secretName,omitempty"`
}
// FederationDomainTransformsConstant defines a constant variable and its value which will be made available to
// the transform expressions. This is a union type, and Type is the discriminator field.
type FederationDomainTransformsConstant struct {
// Name determines the name of the constant. It must be a valid identifier name.
// +kubebuilder:validation:Pattern=`^[a-zA-Z][_a-zA-Z0-9]*$`
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=64
Name string `json:"name"`
// Type determines the type of the constant, and indicates which other field should be non-empty.
// Allowed values are "string" or "stringList".
// +kubebuilder:validation:Enum=string;stringList
Type string `json:"type"`
// StringValue should hold the value when Type is "string", and is otherwise ignored.
// +optional
StringValue string `json:"stringValue,omitempty"`
// StringListValue should hold the value when Type is "stringList", and is otherwise ignored.
// +optional
StringListValue []string `json:"stringListValue,omitempty"`
}
// FederationDomainTransformsExpression defines a transform expression.
type FederationDomainTransformsExpression struct {
// Type determines the type of the expression. It must be one of the supported types.
// Allowed values are "policy/v1", "username/v1", or "groups/v1".
// +kubebuilder:validation:Enum=policy/v1;username/v1;groups/v1
Type string `json:"type"`
// Expression is a CEL expression that will be evaluated based on the Type during an authentication.
// +kubebuilder:validation:MinLength=1
Expression string `json:"expression"`
// Message is only used when Type is policy/v1. It defines an error message to be used when the policy rejects
// an authentication attempt. When empty, a default message will be used.
// +optional
Message string `json:"message,omitempty"`
}
// FederationDomainTransformsExample defines a transform example.
type FederationDomainTransformsExample struct {
// Username is the input username.
// +kubebuilder:validation:MinLength=1
Username string `json:"username"`
// Groups is the input list of group names.
// +optional
Groups []string `json:"groups,omitempty"`
// Expects is the expected output of the entire sequence of transforms when they are run against the
// input Username and Groups.
Expects FederationDomainTransformsExampleExpects `json:"expects"`
}
// FederationDomainTransformsExampleExpects defines the expected result for a transforms example.
type FederationDomainTransformsExampleExpects struct {
// Username is the expected username after the transformations have been applied.
// +optional
Username string `json:"username,omitempty"`
// Groups is the expected list of group names after the transformations have been applied.
// +optional
Groups []string `json:"groups,omitempty"`
// Rejected is a boolean that indicates whether authentication is expected to be rejected by a policy expression
// after the transformations have been applied. True means that it is expected that the authentication would be
// rejected. The default value of false means that it is expected that the authentication would not be rejected
// by any policy expression.
// +optional
Rejected bool `json:"rejected,omitempty"`
// Message is the expected error message of the transforms. When Rejected is true, then Message is the expected
// message for the policy which rejected the authentication attempt. When Rejected is true and Message is blank,
// then Message will be treated as the default error message for authentication attempts which are rejected by a
// policy. When Rejected is false, then Message is the expected error message for some other non-policy
// transformation error, such as a runtime error. When Rejected is false, there is no default expected Message.
// +optional
Message string `json:"message,omitempty"`
}
// FederationDomainTransforms defines identity transformations for an identity provider's usage on a FederationDomain.
type FederationDomainTransforms struct {
// Constants defines constant variables and their values which will be made available to the transform expressions.
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
// +optional
Constants []FederationDomainTransformsConstant `json:"constants,omitempty"`
// Expressions are an optional list of transforms and policies to be executed in the order given during every
// authentication attempt, including during every session refresh.
// Each is a CEL expression. It may use the basic CEL language as defined in
// https://github.com/google/cel-spec/blob/master/doc/langdef.md plus the CEL string extensions defined in
// https://github.com/google/cel-go/tree/master/ext#strings.
//
// The username and groups extracted from the identity provider, and the constants defined in this CR, are
// available as variables in all expressions. The username is provided via a variable called `username` and
// the list of group names is provided via a variable called `groups` (which may be an empty list).
// Each user-provided constants is provided via a variable named `strConst.varName` for string constants
// and `strListConst.varName` for string list constants.
//
// The only allowed types for expressions are currently policy/v1, username/v1, and groups/v1.
// Each policy/v1 must return a boolean, and when it returns false, no more expressions from the list are evaluated
// and the authentication attempt is rejected.
// Transformations of type policy/v1 do not return usernames or group names, and therefore cannot change the
// username or group names.
// Each username/v1 transform must return the new username (a string), which can be the same as the old username.
// Transformations of type username/v1 do not return group names, and therefore cannot change the group names.
// Each groups/v1 transform must return the new groups list (list of strings), which can be the same as the old
// groups list.
// Transformations of type groups/v1 do not return usernames, and therefore cannot change the usernames.
// After each expression, the new (potentially changed) username or groups get passed to the following expression.
//
// Any compilation or static type-checking failure of any expression will cause an error status on the FederationDomain.
// During an authentication attempt, any unexpected runtime evaluation errors (e.g. division by zero) cause the
// authentication attempt to fail. When all expressions evaluate successfully, then the (potentially changed) username
// and group names have been decided for that authentication attempt.
//
// +optional
Expressions []FederationDomainTransformsExpression `json:"expressions,omitempty"`
// Examples can optionally be used to ensure that the sequence of transformation expressions are working as
// expected. Examples define sample input identities which are then run through the expression list, and the
// results are compared to the expected results. If any example in this list fails, then this
// identity provider will not be available for use within this FederationDomain, and the error(s) will be
// added to the FederationDomain status. This can be used to help guard against programming mistakes in the
// expressions, and also act as living documentation for other administrators to better understand the expressions.
// +optional
Examples []FederationDomainTransformsExample `json:"examples,omitempty"`
}
// FederationDomainIdentityProvider describes how an identity provider is made available in this FederationDomain.
type FederationDomainIdentityProvider struct {
// DisplayName is the name of this identity provider as it will appear to clients. This name ends up in the
// kubeconfig of end users, so changing the name of an identity provider that is in use by end users will be a
// disruptive change for those users.
// +kubebuilder:validation:MinLength=1
DisplayName string `json:"displayName"`
// ObjectRef is a reference to a Pinniped identity provider resource. A valid reference is required.
// If the reference cannot be resolved then the identity provider will not be made available.
// Must refer to a resource of one of the Pinniped identity provider types, e.g. OIDCIdentityProvider,
// LDAPIdentityProvider, ActiveDirectoryIdentityProvider.
ObjectRef corev1.TypedLocalObjectReference `json:"objectRef"`
// Transforms is an optional way to specify transformations to be applied during user authentication and
// session refresh.
// +optional
Transforms FederationDomainTransforms `json:"transforms,omitempty"`
}
// FederationDomainSpec is a struct that describes an OIDC Provider.
type FederationDomainSpec struct {
// Issuer is the OIDC Provider's issuer, per the OIDC Discovery Metadata document, as well as the
@@ -53,11 +209,38 @@ type FederationDomainSpec struct {
// See
// https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3 for more information.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:message="issuer must be an HTTPS URL",rule="isURL(self) && url(self).getScheme() == 'https'"
Issuer string `json:"issuer"`
// TLS configures how this FederationDomain is served over Transport Layer Security (TLS).
// TLS specifies a secret which will contain Transport Layer Security (TLS) configuration for the FederationDomain.
// +optional
TLS *FederationDomainTLSSpec `json:"tls,omitempty"`
// IdentityProviders is the list of identity providers available for use by this FederationDomain.
//
// An identity provider CR (e.g. OIDCIdentityProvider or LDAPIdentityProvider) describes how to connect to a server,
// how to talk in a specific protocol for authentication, and how to use the schema of that server/protocol to
// extract a normalized user identity. Normalized user identities include a username and a list of group names.
// In contrast, IdentityProviders describes how to use that normalized identity in those Kubernetes clusters which
// belong to this FederationDomain. Each entry in IdentityProviders can be configured with arbitrary transformations
// on that normalized identity. For example, a transformation can add a prefix to all usernames to help avoid
// accidental conflicts when multiple identity providers have different users with the same username (e.g.
// "idp1:ryan" versus "idp2:ryan"). Each entry in IdentityProviders can also implement arbitrary authentication
// rejection policies. Even though a user was able to authenticate with the identity provider, a policy can disallow
// the authentication to the Kubernetes clusters that belong to this FederationDomain. For example, a policy could
// disallow the authentication unless the user belongs to a specific group in the identity provider.
//
// For backwards compatibility with versions of Pinniped which predate support for multiple identity providers,
// an empty IdentityProviders list will cause the FederationDomain to use all available identity providers which
// exist in the same namespace, but also to reject all authentication requests when there is more than one identity
// provider currently defined. In this backwards compatibility mode, the name of the identity provider resource
// (e.g. the Name of an OIDCIdentityProvider resource) will be used as the name of the identity provider in this
// FederationDomain. This mode is provided to make upgrading from older versions easier. However, instead of
// relying on this backwards compatibility mode, please consider this mode to be deprecated and please instead
// explicitly list the identity provider using this IdentityProviders field.
//
// +optional
IdentityProviders []FederationDomainIdentityProvider `json:"identityProviders,omitempty"`
}
// FederationDomainSecrets holds information about this OIDC Provider's secrets.
@@ -86,20 +269,17 @@ type FederationDomainSecrets struct {
// FederationDomainStatus is a struct that describes the actual state of an OIDC Provider.
type FederationDomainStatus struct {
// Status holds an enum that describes the state of this OIDC Provider. Note that this Status can
// represent success or failure.
// +optional
Status FederationDomainStatusCondition `json:"status,omitempty"`
// Phase summarizes the overall status of the FederationDomain.
// +kubebuilder:default=Pending
// +kubebuilder:validation:Enum=Pending;Ready;Error
Phase FederationDomainPhase `json:"phase,omitempty"`
// Message provides human-readable details about the Status.
// +optional
Message string `json:"message,omitempty"`
// LastUpdateTime holds the time at which the Status was last updated. It is a pointer to get
// around some undesirable behavior with respect to the empty metav1.Time value (see
// https://github.com/kubernetes/kubernetes/issues/86811).
// +optional
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
// Conditions represent the observations of an FederationDomain's current state.
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// Secrets contains information about this OIDC Provider's secrets.
// +optional
@@ -111,7 +291,7 @@ type FederationDomainStatus struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:categories=pinniped
// +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:subresource:status
type FederationDomain struct {

View File

@@ -1,75 +0,0 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// ConditionStatus is effectively an enum type for Condition.Status.
type ConditionStatus string
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
// can't decide if a resource is in the condition or not. In the future, we could add other
// intermediate conditions, e.g. ConditionDegraded.
const (
ConditionTrue ConditionStatus = "True"
ConditionFalse ConditionStatus = "False"
ConditionUnknown ConditionStatus = "Unknown"
)
// Condition status of a resource (mirrored from the metav1.Condition type added in Kubernetes 1.19). In a future API
// version we can switch to using the upstream type.
// See https://github.com/kubernetes/apimachinery/blob/v0.19.0/pkg/apis/meta/v1/types.go#L1353-L1413.
type Condition struct {
// type of condition in CamelCase or in foo.example.com/CamelCase.
// ---
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
// useful (see .node.status.conditions), the ability to deconflict is important.
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
// +kubebuilder:validation:MaxLength=316
Type string `json:"type"`
// status of the condition, one of True, False, Unknown.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=True;False;Unknown
Status ConditionStatus `json:"status"`
// observedGeneration represents the .metadata.generation that the condition was set based upon.
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
// with respect to the current state of the instance.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// lastTransitionTime is the last time the condition transitioned from one status to another.
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
// Producers of specific condition types may define expected values and meanings for this field,
// and whether the values are considered a guaranteed API.
// The value should be a CamelCase string.
// This field may not be empty.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=1024
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
Reason string `json:"reason"`
// message is a human readable message indicating details about the transition.
// This may be an empty string.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=32768
Message string `json:"message"`
}

View File

@@ -1,4 +1,4 @@
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -8,14 +8,14 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type OIDCClientPhase string
const (
// PhasePending is the default phase for newly-created OIDCClient resources.
PhasePending OIDCClientPhase = "Pending"
// OIDCClientPhasePending is the default phase for newly-created OIDCClient resources.
OIDCClientPhasePending OIDCClientPhase = "Pending"
// PhaseReady is the phase for an OIDCClient resource in a healthy state.
PhaseReady OIDCClientPhase = "Ready"
// OIDCClientPhaseReady is the phase for an OIDCClient resource in a healthy state.
OIDCClientPhaseReady OIDCClientPhase = "Ready"
// PhaseError is the phase for an OIDCClient in an unhealthy state.
PhaseError OIDCClientPhase = "Error"
// OIDCClientPhaseError is the phase for an OIDCClient in an unhealthy state.
OIDCClientPhaseError OIDCClientPhase = "Error"
)
// +kubebuilder:validation:Pattern=`^https://.+|^http://(127\.0\.0\.1|\[::1\])(:\d+)?/`
@@ -71,6 +71,28 @@ type OIDCClientSpec struct {
// +listType=set
// +kubebuilder:validation:MinItems=1
AllowedScopes []Scope `json:"allowedScopes"`
// tokenLifetimes are the optional overrides of token lifetimes for an OIDCClient.
// +optional
TokenLifetimes OIDCClientTokenLifetimes `json:"tokenLifetimes,omitempty"`
}
// OIDCClientTokenLifetimes describes the optional overrides of token lifetimes for an OIDCClient.
type OIDCClientTokenLifetimes struct {
// idTokenSeconds is the lifetime of ID tokens issued to this client, in seconds. This will choose the lifetime of
// ID tokens returned by the authorization flow and the refresh grant. It will not influence the lifetime of the ID
// tokens returned by RFC8693 token exchange. When null, a short-lived default value will be used.
// This value must be between 120 and 1,800 seconds (30 minutes), inclusive. It is recommended to make these tokens
// short-lived to force the client to perform the refresh grant often, because the refresh grant will check with the
// external identity provider to decide if it is acceptable for the end user to continue their session, and will
// update the end user's group memberships from the external identity provider. Giving these tokens a long life is
// will allow the end user to continue to use a token while avoiding these updates from the external identity
// provider. However, some web applications may have reasons specific to the design of that application to prefer
// longer lifetimes.
// +kubebuilder:validation:Minimum=120
// +kubebuilder:validation:Maximum=1800
// +optional
IDTokenSeconds *int32 `json:"idTokenSeconds,omitempty"`
}
// OIDCClientStatus is a struct that describes the actual state of an OIDCClient.
@@ -85,7 +107,7 @@ type OIDCClientStatus struct {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// totalClientSecrets is the current number of client secrets that are detected for this OIDCClient.
// +optional

View File

@@ -1,9 +1,7 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=idp.supervisor.pinniped.dev
// +groupGoName=IDP

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -36,6 +36,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&LDAPIdentityProviderList{},
&ActiveDirectoryIdentityProvider{},
&ActiveDirectoryIdentityProviderList{},
&GitHubIdentityProvider{},
&GitHubIdentityProviderList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -32,7 +32,7 @@ type ActiveDirectoryIdentityProviderStatus struct {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
type ActiveDirectoryIdentityProviderBind struct {
@@ -114,9 +114,10 @@ type ActiveDirectoryIdentityProviderGroupSearch struct {
// Filter is the ActiveDirectory search filter which should be applied when searching for groups for a user.
// The pattern "{}" must occur in the filter at least once and will be dynamically replaced by the
// dn (distinguished name) of the user entry found as a result of the user search. E.g. "member={}" or
// "&(objectClass=groupOfNames)(member={})". For more information about ActiveDirectory filters, see
// https://ldap.com/ldap-filters.
// value of an attribute of the user entry found as a result of the user search. Which attribute's
// value is used to replace the placeholder(s) depends on the value of UserAttributeForFilter.
// E.g. "member={}" or "&(objectClass=groupOfNames)(member={})".
// For more information about ActiveDirectory filters, see https://ldap.com/ldap-filters.
// Note that the dn (distinguished name) is not an attribute of an entry, so "dn={}" cannot be used.
// Optional. When not specified, the default will act as if the filter were specified as
// "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={})".
@@ -127,6 +128,17 @@ type ActiveDirectoryIdentityProviderGroupSearch struct {
// +optional
Filter string `json:"filter,omitempty"`
// UserAttributeForFilter specifies which attribute's value from the user entry found as a result of
// the user search will be used to replace the "{}" placeholder(s) in the group search Filter.
// For example, specifying "uid" as the UserAttributeForFilter while specifying
// "&(objectClass=posixGroup)(memberUid={})" as the Filter would search for groups by replacing
// the "{}" placeholder in the Filter with the value of the user's "uid" attribute.
// Optional. When not specified, the default will act as if "dn" were specified. For example, leaving
// UserAttributeForFilter unspecified while specifying "&(objectClass=groupOfNames)(member={})" as the Filter
// would search for groups by replacing the "{}" placeholder(s) with the dn (distinguished name) of the user.
// +optional
UserAttributeForFilter string `json:"userAttributeForFilter,omitempty"`
// Attributes specifies how the group's information should be read from each ActiveDirectory entry which was found as
// the result of the group search.
// +optional

View File

@@ -0,0 +1,263 @@
// Copyright 2024-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type GitHubIdentityProviderPhase string
const (
// GitHubPhasePending is the default phase for newly-created GitHubIdentityProvider resources.
GitHubPhasePending GitHubIdentityProviderPhase = "Pending"
// GitHubPhaseReady is the phase for an GitHubIdentityProvider resource in a healthy state.
GitHubPhaseReady GitHubIdentityProviderPhase = "Ready"
// GitHubPhaseError is the phase for an GitHubIdentityProvider in an unhealthy state.
GitHubPhaseError GitHubIdentityProviderPhase = "Error"
)
type GitHubAllowedAuthOrganizationsPolicy string
const (
// GitHubAllowedAuthOrganizationsPolicyAllGitHubUsers means any GitHub user is allowed to log in using this identity
// provider, regardless of their organization membership or lack thereof.
GitHubAllowedAuthOrganizationsPolicyAllGitHubUsers GitHubAllowedAuthOrganizationsPolicy = "AllGitHubUsers"
// GitHubAllowedAuthOrganizationsPolicyOnlyUsersFromAllowedOrganizations means only those users with membership in
// the listed GitHub organizations are allowed to log in.
GitHubAllowedAuthOrganizationsPolicyOnlyUsersFromAllowedOrganizations GitHubAllowedAuthOrganizationsPolicy = "OnlyUsersFromAllowedOrganizations"
)
// GitHubIdentityProviderStatus is the status of an GitHub identity provider.
type GitHubIdentityProviderStatus struct {
// Phase summarizes the overall status of the GitHubIdentityProvider.
//
// +kubebuilder:default=Pending
// +kubebuilder:validation:Enum=Pending;Ready;Error
Phase GitHubIdentityProviderPhase `json:"phase,omitempty"`
// Conditions represents the observations of an identity provider's current state.
//
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// GitHubAPIConfig allows configuration for GitHub Enterprise Server
type GitHubAPIConfig struct {
// Host is required only for GitHub Enterprise Server.
// Defaults to using GitHub's public API ("github.com").
// For convenience, specifying "github.com" is equivalent to specifying "api.github.com".
// Do not specify a protocol or scheme since "https://" will always be used.
// Port is optional. Do not specify a path, query, fragment, or userinfo.
// Only specify domain name or IP address, subdomains (optional), and port (optional).
// IPv4 and IPv6 are supported. If using an IPv6 address with a port, you must enclose the IPv6 address
// in square brackets. Example: "[::1]:443".
//
// +kubebuilder:default="github.com"
// +kubebuilder:validation:MinLength=1
// +optional
Host *string `json:"host"`
// TLS configuration for GitHub Enterprise Server.
// Note that this field should not be needed when using GitHub's public API ("github.com").
// However, if you choose to specify this field when using GitHub's public API, you must
// specify a CA bundle that will verify connections to "api.github.com".
//
// +optional
TLS *TLSSpec `json:"tls,omitempty"`
}
// GitHubUsernameAttribute allows the user to specify which attribute(s) from GitHub to use for the username to present
// to Kubernetes. See the response schema for
// [Get the authenticated user](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).
type GitHubUsernameAttribute string
const (
// GitHubUsernameID specifies using the `id` attribute from the GitHub user for the username to present to Kubernetes.
GitHubUsernameID GitHubUsernameAttribute = "id"
// GitHubUsernameLogin specifies using the `login` attribute from the GitHub user as the username to present to Kubernetes.
GitHubUsernameLogin GitHubUsernameAttribute = "login"
// GitHubUsernameLoginAndID specifies combining the `login` and `id` attributes from the GitHub user as the
// username to present to Kubernetes, separated by a colon. Example: "my-login:1234"
GitHubUsernameLoginAndID GitHubUsernameAttribute = "login:id"
)
// GitHubGroupNameAttribute allows the user to specify which attribute from GitHub to use for the group
// names to present to Kubernetes. See the response schema for
// [List teams for the authenticated user](https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user).
type GitHubGroupNameAttribute string
const (
// GitHubUseTeamNameForGroupName specifies using the GitHub team's `name` attribute as the group name to present to Kubernetes.
GitHubUseTeamNameForGroupName GitHubGroupNameAttribute = "name"
// GitHubUseTeamSlugForGroupName specifies using the GitHub team's `slug` attribute as the group name to present to Kubernetes.
GitHubUseTeamSlugForGroupName GitHubGroupNameAttribute = "slug"
)
// GitHubClaims allows customization of the username and groups claims.
type GitHubClaims struct {
// Username configures which property of the GitHub user record shall determine the username in Kubernetes.
//
// Can be either "id", "login", or "login:id". Defaults to "login:id".
//
// GitHub's user login attributes can only contain alphanumeric characters and non-repeating hyphens,
// and may not start or end with hyphens. GitHub users are allowed to change their login name,
// although it is inconvenient. If a GitHub user changed their login name from "foo" to "bar",
// then a second user might change their name from "baz" to "foo" in order to take the old
// username of the first user. For this reason, it is not as safe to make authorization decisions
// based only on the user's login attribute.
//
// If desired, an admin could configure identity transformation expressions on the Pinniped Supervisor's
// FederationDomain to further customize how these usernames are presented to Kubernetes.
//
// Defaults to "login:id", which is the user login attribute, followed by a colon, followed by the unique and
// unchanging integer ID number attribute. This blends human-readable login names with the unchanging ID value
// from GitHub. Colons are not allowed in GitHub login attributes or ID numbers, so this is a reasonable
// choice to concatenate the two values.
//
// See the response schema for
// [Get the authenticated user](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).
//
// +kubebuilder:default="login:id"
// +kubebuilder:validation:Enum={"id","login","login:id"}
// +optional
Username *GitHubUsernameAttribute `json:"username"`
// Groups configures which property of the GitHub team record shall determine the group names in Kubernetes.
//
// Can be either "name" or "slug". Defaults to "slug".
//
// GitHub team names can contain upper and lower case characters, whitespace, and punctuation (e.g. "Kube admins!").
//
// GitHub team slugs are lower case alphanumeric characters and may contain dashes and underscores (e.g. "kube-admins").
//
// Group names as presented to Kubernetes will always be prefixed by the GitHub organization name followed by a
// forward slash (e.g. "my-org/my-team"). GitHub organization login names can only contain alphanumeric characters
// or single hyphens, so the first forward slash `/` will be the separator between the organization login name and
// the team name or slug.
//
// If desired, an admin could configure identity transformation expressions on the Pinniped Supervisor's
// FederationDomain to further customize how these group names are presented to Kubernetes.
//
// See the response schema for
// [List teams for the authenticated user](https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user).
//
// +kubebuilder:default=slug
// +kubebuilder:validation:Enum=name;slug
// +optional
Groups *GitHubGroupNameAttribute `json:"groups"`
}
// GitHubClientSpec contains information about the GitHub client that this identity provider will use
// for web-based login flows.
type GitHubClientSpec struct {
// SecretName contains the name of a namespace-local Secret object that provides the clientID and
// clientSecret for an GitHub App or GitHub OAuth2 client.
//
// This secret must be of type "secrets.pinniped.dev/github-client" with keys "clientID" and "clientSecret".
//
// +kubebuilder:validation:MinLength=1
SecretName string `json:"secretName"`
}
type GitHubOrganizationsSpec struct {
// Allowed values are "OnlyUsersFromAllowedOrganizations" or "AllGitHubUsers".
// Defaults to "OnlyUsersFromAllowedOrganizations".
//
// Must be set to "AllGitHubUsers" if the allowed field is empty.
//
// This field only exists to ensure that Pinniped administrators are aware that an empty list of
// allowedOrganizations means all GitHub users are allowed to log in.
//
// +kubebuilder:default=OnlyUsersFromAllowedOrganizations
// +kubebuilder:validation:Enum=OnlyUsersFromAllowedOrganizations;AllGitHubUsers
// +optional
Policy *GitHubAllowedAuthOrganizationsPolicy `json:"policy"`
// Allowed, when specified, indicates that only users with membership in at least one of the listed
// GitHub organizations may log in. In addition, the group membership presented to Kubernetes will only include
// teams within the listed GitHub organizations. Additional login rules or group filtering can optionally be
// provided as policy expression on any Pinniped Supervisor FederationDomain that includes this IDP.
//
// The configured GitHub App or GitHub OAuth App must be allowed to see membership in the listed organizations,
// otherwise Pinniped will not be aware that the user belongs to the listed organization or any teams
// within that organization.
//
// If no organizations are listed, you must set organizations: AllGitHubUsers.
//
// +kubebuilder:validation:MaxItems=64
// +listType=set
// +optional
Allowed []string `json:"allowed,omitempty"`
}
// GitHubAllowAuthenticationSpec allows customization of who can authenticate using this IDP and how.
type GitHubAllowAuthenticationSpec struct {
// Organizations allows customization of which organizations can authenticate using this IDP.
// +kubebuilder:validation:XValidation:message="spec.allowAuthentication.organizations.policy must be 'OnlyUsersFromAllowedOrganizations' when spec.allowAuthentication.organizations.allowed has organizations listed",rule="!(has(self.allowed) && size(self.allowed) > 0 && self.policy == 'AllGitHubUsers')"
// +kubebuilder:validation:XValidation:message="spec.allowAuthentication.organizations.policy must be 'AllGitHubUsers' when spec.allowAuthentication.organizations.allowed is empty",rule="!((!has(self.allowed) || size(self.allowed) == 0) && self.policy == 'OnlyUsersFromAllowedOrganizations')"
Organizations GitHubOrganizationsSpec `json:"organizations"`
}
// GitHubIdentityProviderSpec is the spec for configuring an GitHub identity provider.
type GitHubIdentityProviderSpec struct {
// GitHubAPI allows configuration for GitHub Enterprise Server
//
// +kubebuilder:default={}
GitHubAPI GitHubAPIConfig `json:"githubAPI,omitempty"`
// Claims allows customization of the username and groups claims.
//
// +kubebuilder:default={}
Claims GitHubClaims `json:"claims,omitempty"`
// AllowAuthentication allows customization of who can authenticate using this IDP and how.
AllowAuthentication GitHubAllowAuthenticationSpec `json:"allowAuthentication"`
// Client identifies the secret with credentials for a GitHub App or GitHub OAuth2 App (a GitHub client).
Client GitHubClientSpec `json:"client"`
}
// GitHubIdentityProvider describes the configuration of an upstream GitHub identity provider.
// This upstream provider can be configured with either a GitHub App or a GitHub OAuth2 App.
//
// Right now, only web-based logins are supported, for both the pinniped-cli client and clients configured
// as OIDCClients.
//
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:categories=pinniped;pinniped-idp;pinniped-idps
// +kubebuilder:printcolumn:name="Host",type=string,JSONPath=`.spec.githubAPI.host`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:subresource:status
type GitHubIdentityProvider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec for configuring the identity provider.
Spec GitHubIdentityProviderSpec `json:"spec"`
// Status of the identity provider.
Status GitHubIdentityProviderStatus `json:"status,omitempty"`
}
// GitHubIdentityProviderList lists GitHubIdentityProvider objects.
//
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type GitHubIdentityProviderList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GitHubIdentityProvider `json:"items"`
}

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -32,7 +32,7 @@ type LDAPIdentityProviderStatus struct {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
type LDAPIdentityProviderBind struct {
@@ -101,20 +101,31 @@ type LDAPIdentityProviderGroupSearch struct {
// Base is the dn (distinguished name) that should be used as the search base when searching for groups. E.g.
// "ou=groups,dc=example,dc=com". When not specified, no group search will be performed and
// authenticated users will not belong to any groups from the LDAP provider. Also, when not specified,
// the values of Filter and Attributes are ignored.
// the values of Filter, UserAttributeForFilter, Attributes, and SkipGroupRefresh are ignored.
// +optional
Base string `json:"base,omitempty"`
// Filter is the LDAP search filter which should be applied when searching for groups for a user.
// The pattern "{}" must occur in the filter at least once and will be dynamically replaced by the
// dn (distinguished name) of the user entry found as a result of the user search. E.g. "member={}" or
// "&(objectClass=groupOfNames)(member={})". For more information about LDAP filters, see
// https://ldap.com/ldap-filters.
// value of an attribute of the user entry found as a result of the user search. Which attribute's
// value is used to replace the placeholder(s) depends on the value of UserAttributeForFilter.
// For more information about LDAP filters, see https://ldap.com/ldap-filters.
// Note that the dn (distinguished name) is not an attribute of an entry, so "dn={}" cannot be used.
// Optional. When not specified, the default will act as if the Filter were specified as "member={}".
// +optional
Filter string `json:"filter,omitempty"`
// UserAttributeForFilter specifies which attribute's value from the user entry found as a result of
// the user search will be used to replace the "{}" placeholder(s) in the group search Filter.
// For example, specifying "uid" as the UserAttributeForFilter while specifying
// "&(objectClass=posixGroup)(memberUid={})" as the Filter would search for groups by replacing
// the "{}" placeholder in the Filter with the value of the user's "uid" attribute.
// Optional. When not specified, the default will act as if "dn" were specified. For example, leaving
// UserAttributeForFilter unspecified while specifying "&(objectClass=groupOfNames)(member={})" as the Filter
// would search for groups by replacing the "{}" placeholder(s) with the dn (distinguished name) of the user.
// +optional
UserAttributeForFilter string `json:"userAttributeForFilter,omitempty"`
// Attributes specifies how the group's information should be read from each LDAP entry which was found as
// the result of the group search.
// +optional

View File

@@ -1,75 +0,0 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// ConditionStatus is effectively an enum type for Condition.Status.
type ConditionStatus string
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
// can't decide if a resource is in the condition or not. In the future, we could add other
// intermediate conditions, e.g. ConditionDegraded.
const (
ConditionTrue ConditionStatus = "True"
ConditionFalse ConditionStatus = "False"
ConditionUnknown ConditionStatus = "Unknown"
)
// Condition status of a resource (mirrored from the metav1.Condition type added in Kubernetes 1.19). In a future API
// version we can switch to using the upstream type.
// See https://github.com/kubernetes/apimachinery/blob/v0.19.0/pkg/apis/meta/v1/types.go#L1353-L1413.
type Condition struct {
// type of condition in CamelCase or in foo.example.com/CamelCase.
// ---
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
// useful (see .node.status.conditions), the ability to deconflict is important.
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
// +kubebuilder:validation:MaxLength=316
Type string `json:"type"`
// status of the condition, one of True, False, Unknown.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=True;False;Unknown
Status ConditionStatus `json:"status"`
// observedGeneration represents the .metadata.generation that the condition was set based upon.
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
// with respect to the current state of the instance.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// lastTransitionTime is the last time the condition transitioned from one status to another.
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
// Producers of specific condition types may define expected values and meanings for this field,
// and whether the values are considered a guaranteed API.
// The value should be a CamelCase string.
// This field may not be empty.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=1024
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
Reason string `json:"reason"`
// message is a human readable message indicating details about the transition.
// This may be an empty string.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=32768
Message string `json:"message"`
}

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -32,7 +32,7 @@ type OIDCIdentityProviderStatus struct {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// OIDCAuthorizationConfig provides information about how to form the OAuth2 authorization

View File

@@ -1,11 +1,47 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
// Configuration for TLS parameters related to identity provider integration.
// CertificateAuthorityDataSourceKind enumerates the sources for CA Bundles.
//
// +kubebuilder:validation:Enum=Secret;ConfigMap
type CertificateAuthorityDataSourceKind string
const (
// CertificateAuthorityDataSourceKindConfigMap uses a Kubernetes configmap to source CA Bundles.
CertificateAuthorityDataSourceKindConfigMap = CertificateAuthorityDataSourceKind("ConfigMap")
// CertificateAuthorityDataSourceKindSecret uses a Kubernetes secret to source CA Bundles.
// Secrets used to source CA Bundles must be of type kubernetes.io/tls or Opaque.
CertificateAuthorityDataSourceKindSecret = CertificateAuthorityDataSourceKind("Secret")
)
// CertificateAuthorityDataSourceSpec provides a source for CA bundle used for client-side TLS verification.
type CertificateAuthorityDataSourceSpec struct {
// Kind configures whether the CA bundle is being sourced from a Kubernetes secret or a configmap.
// Allowed values are "Secret" or "ConfigMap".
// "ConfigMap" uses a Kubernetes configmap to source CA Bundles.
// "Secret" uses Kubernetes secrets of type kubernetes.io/tls or Opaque to source CA Bundles.
Kind CertificateAuthorityDataSourceKind `json:"kind"`
// Name is the resource name of the secret or configmap from which to read the CA bundle.
// The referenced secret or configmap must be created in the same namespace where Pinniped Supervisor is installed.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Key is the key name within the secret or configmap from which to read the CA bundle.
// The value found at this key in the secret or configmap must not be empty, and must be a valid PEM-encoded
// certificate bundle.
// +kubebuilder:validation:MinLength=1
Key string `json:"key"`
}
// TLSSpec provides TLS configuration for identity provider integration.
type TLSSpec struct {
// X.509 Certificate Authority (base64-encoded PEM bundle). If omitted, a default set of system roots will be trusted.
// +optional
CertificateAuthorityData string `json:"certificateAuthorityData,omitempty"`
// Reference to a CA bundle in a secret or a configmap.
// Any changes to the CA bundle in the secret or configmap will be dynamically reloaded.
// +optional
CertificateAuthorityDataSource *CertificateAuthorityDataSourceSpec `json:"certificateAuthorityDataSource,omitempty"`
}

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@@ -15,6 +15,7 @@ const (
IDPTypeOIDC IDPType = "oidc"
IDPTypeLDAP IDPType = "ldap"
IDPTypeActiveDirectory IDPType = "activedirectory"
IDPTypeGitHub IDPType = "github"
IDPFlowCLIPassword IDPFlow = "cli_password"
IDPFlowBrowserAuthcode IDPFlow = "browser_authcode"
@@ -54,7 +55,8 @@ type OIDCDiscoveryResponseIDPEndpoint struct {
// IDPDiscoveryResponse is the response of a FederationDomain's identity provider discovery endpoint.
type IDPDiscoveryResponse struct {
PinnipedIDPs []PinnipedIDP `json:"pinniped_identity_providers"`
PinnipedIDPs []PinnipedIDP `json:"pinniped_identity_providers"`
PinnipedSupportedIDPTypes []PinnipedSupportedIDPType `json:"pinniped_supported_identity_provider_types"`
}
// PinnipedIDP describes a single identity provider as included in the response of a FederationDomain's
@@ -64,3 +66,8 @@ type PinnipedIDP struct {
Type IDPType `json:"type"`
Flows []IDPFlow `json:"flows,omitempty"`
}
// PinnipedSupportedIDPType describes a single identity provider type.
type PinnipedSupportedIDPType struct {
Type IDPType `json:"type"`
}

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package oidc
@@ -29,6 +29,10 @@ const (
// IDTokenClaimSubject is name of the subject claim defined by the OIDC spec.
IDTokenClaimSubject = "sub"
// IDTokenSubClaimIDPNameQueryParam is the name of the query param used in the values of the "sub" claim
// in Supervisor-issued ID tokens to identify with which external identity provider the user authenticated.
IDTokenSubClaimIDPNameQueryParam = "idpName"
// IDTokenClaimAuthorizedParty is name of the authorized party claim defined by the OIDC spec.
IDTokenClaimAuthorizedParty = "azp"

View File

@@ -1,4 +1,4 @@
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package main
@@ -90,12 +90,11 @@ func TestEntrypoint(t *testing.T) {
}`,
},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
var logBuf bytes.Buffer
testLog := log.New(&logBuf, "", 0)
exited := "exiting via fatal"
fail = func(format string, v ...interface{}) {
fail = func(format string, v ...any) {
testLog.Printf(format, v...)
panic(exited)
}

View File

@@ -1,4 +1,4 @@
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package main
@@ -38,12 +38,11 @@ func TestEntrypoint(t *testing.T) {
wantArgs: []string{"/path/to/valid-test-binary", "foo", "bar"},
},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
var logBuf bytes.Buffer
testLog := log.New(&logBuf, "", 0)
exited := "exiting via fatal"
fail = func(err error, keysAndValues ...interface{}) {
fail = func(err error, keysAndValues ...any) {
testLog.Print(err)
if len(keysAndValues) > 0 {
testLog.Print(keysAndValues...)

View File

@@ -0,0 +1,46 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"net/http"
"go.pinniped.dev/internal/httputil/roundtripper"
"go.pinniped.dev/internal/plog"
)
type auditIDLoggerFunc func(path string, statusCode int, auditID string)
func logAuditID(path string, statusCode int, auditID string) {
plog.Info("Received auditID for failed request",
"path", path,
"statusCode", statusCode,
"auditID", auditID)
}
func LogAuditIDTransportWrapper(rt http.RoundTripper) http.RoundTripper {
return logAuditIDTransportWrapper(rt, logAuditID)
}
func logAuditIDTransportWrapper(rt http.RoundTripper, auditIDLoggerFunc auditIDLoggerFunc) http.RoundTripper {
return roundtripper.WrapFunc(rt, func(r *http.Request) (*http.Response, error) {
response, responseErr := rt.RoundTrip(r)
if responseErr != nil ||
response == nil ||
response.Header.Get("audit-ID") == "" ||
response.Request == nil ||
response.Request.URL == nil {
return response, responseErr
}
// Use the request path from the response's request, in case the
// original request was modified by any other roudtrippers in the chain.
auditIDLoggerFunc(response.Request.URL.Path,
response.StatusCode,
response.Header.Get("audit-ID"))
return response, responseErr
})
}

View File

@@ -0,0 +1,116 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"errors"
"net/http"
"net/url"
"testing"
"github.com/stretchr/testify/require"
"go.pinniped.dev/internal/httputil/roundtripper"
)
func TestLogAuditIDTransportWrapper(t *testing.T) {
canonicalAuditIdHeaderName := "Audit-Id"
tests := []struct {
name string
response *http.Response
responseErr error
want func(t *testing.T, called func()) auditIDLoggerFunc
wantCalled bool
}{
{
name: "happy HTTP response - no error and no log",
response: &http.Response{ // no headers
StatusCode: http.StatusOK,
Request: &http.Request{
URL: &url.URL{
Path: "some-path-from-response-request",
},
},
},
responseErr: nil,
want: func(t *testing.T, called func()) auditIDLoggerFunc {
return func(_ string, _ int, _ string) {
called()
}
},
wantCalled: false, // make it obvious
},
{
name: "nil HTTP response - no error and no log",
response: nil,
responseErr: nil,
want: func(t *testing.T, called func()) auditIDLoggerFunc {
return func(_ string, _ int, _ string) {
called()
}
},
wantCalled: false, // make it obvious
},
{
name: "err HTTP response - no error and no log",
response: nil,
responseErr: errors.New("some error"),
want: func(t *testing.T, called func()) auditIDLoggerFunc {
return func(_ string, _ int, _ string) {
called()
}
},
wantCalled: false, // make it obvious
},
{
name: "happy HTTP response with audit-ID - logs",
response: &http.Response{
Header: http.Header{
canonicalAuditIdHeaderName: []string{"some-audit-id", "some-other-audit-id-that-will-never-be-seen"},
},
StatusCode: http.StatusBadGateway, // statusCode does not matter
Request: &http.Request{
URL: &url.URL{
Path: "some-path-from-response-request",
},
},
},
want: func(t *testing.T, called func()) auditIDLoggerFunc {
return func(path string, statusCode int, auditID string) {
called()
require.Equal(t, "some-path-from-response-request", path)
require.Equal(t, http.StatusBadGateway, statusCode)
require.Equal(t, "some-audit-id", auditID)
}
},
wantCalled: true, // make it obvious
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
require.NotNil(t, test.want)
mockRequest := &http.Request{
URL: &url.URL{
Path: "should-never-use-this-path",
},
}
var mockRt roundtripper.Func = func(r *http.Request) (*http.Response, error) {
require.Equal(t, mockRequest, r)
return test.response, test.responseErr
}
called := false
subjectRt := logAuditIDTransportWrapper(mockRt, test.want(t, func() {
called = true
}))
actualResponse, err := subjectRt.RoundTrip(mockRequest) //nolint:bodyclose // there is no Body.
require.Equal(t, test.responseErr, err) // This roundtripper only returns mocked errors.
require.Equal(t, test.response, actualResponse)
require.Equal(t, test.wantCalled, called,
"want logFunc to be called: %t, actually was called: %t", test.wantCalled, called)
})
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -13,7 +13,7 @@ import (
"github.com/spf13/pflag"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
conciergeconfigv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
)
// conciergeModeFlag represents the method by which we should connect to the Concierge on a cluster during login.
@@ -62,12 +62,12 @@ func (f *conciergeModeFlag) Type() string {
}
// MatchesFrontend returns true iff the flag matches the type of the provided frontend.
func (f *conciergeModeFlag) MatchesFrontend(frontend *configv1alpha1.CredentialIssuerFrontend) bool {
func (f *conciergeModeFlag) MatchesFrontend(frontend *conciergeconfigv1alpha1.CredentialIssuerFrontend) bool {
switch *f {
case modeImpersonationProxy:
return frontend.Type == configv1alpha1.ImpersonationProxyFrontendType
return frontend.Type == conciergeconfigv1alpha1.ImpersonationProxyFrontendType
case modeTokenCredentialRequestAPI:
return frontend.Type == configv1alpha1.TokenCredentialRequestAPIFrontendType
return frontend.Type == conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType
case modeUnknown:
fallthrough
default:

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -13,9 +13,8 @@ import (
"github.com/stretchr/testify/require"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
conciergeconfigv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
"go.pinniped.dev/internal/certauthority"
"go.pinniped.dev/internal/testutil"
)
func TestConciergeModeFlag(t *testing.T) {
@@ -25,14 +24,14 @@ func TestConciergeModeFlag(t *testing.T) {
require.NoError(t, f.Set(""))
require.Equal(t, modeUnknown, f)
require.EqualError(t, f.Set("foo"), `invalid mode "foo", valid modes are TokenCredentialRequestAPI and ImpersonationProxy`)
require.True(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.True(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.ImpersonationProxyFrontendType}))
require.True(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.True(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.ImpersonationProxyFrontendType}))
require.NoError(t, f.Set("TokenCredentialRequestAPI"))
require.Equal(t, modeTokenCredentialRequestAPI, f)
require.Equal(t, "TokenCredentialRequestAPI", f.String())
require.True(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.False(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.ImpersonationProxyFrontendType}))
require.True(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.False(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.ImpersonationProxyFrontendType}))
require.NoError(t, f.Set("tokencredentialrequestapi"))
require.Equal(t, modeTokenCredentialRequestAPI, f)
@@ -41,8 +40,8 @@ func TestConciergeModeFlag(t *testing.T) {
require.NoError(t, f.Set("ImpersonationProxy"))
require.Equal(t, modeImpersonationProxy, f)
require.Equal(t, "ImpersonationProxy", f.String())
require.False(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.True(t, f.MatchesFrontend(&configv1alpha1.CredentialIssuerFrontend{Type: configv1alpha1.ImpersonationProxyFrontendType}))
require.False(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType}))
require.True(t, f.MatchesFrontend(&conciergeconfigv1alpha1.CredentialIssuerFrontend{Type: conciergeconfigv1alpha1.ImpersonationProxyFrontendType}))
require.NoError(t, f.Set("impersonationproxy"))
require.Equal(t, modeImpersonationProxy, f)
@@ -52,7 +51,7 @@ func TestConciergeModeFlag(t *testing.T) {
func TestCABundleFlag(t *testing.T) {
testCA, err := certauthority.New("Test CA", 1*time.Hour)
require.NoError(t, err)
tmpdir := testutil.TempDir(t)
tmpdir := t.TempDir()
emptyFilePath := filepath.Join(tmpdir, "empty")
require.NoError(t, os.WriteFile(emptyFilePath, []byte{}, 0600))

View File

@@ -1,34 +1,36 @@
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
conciergeclientset "go.pinniped.dev/generated/latest/client/concierge/clientset/versioned"
"go.pinniped.dev/internal/groupsuffix"
"go.pinniped.dev/internal/kubeclient"
)
// getConciergeClientsetFunc is a function that can return a clientset for the Concierge API given a
// getClientsetsFunc is a function that can return clients for the Concierge and Kubernetes APIs given a
// clientConfig and the apiGroupSuffix with which the API is running.
type getConciergeClientsetFunc func(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, error)
type getClientsetsFunc func(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, kubernetes.Interface, aggregatorclient.Interface, error)
// getRealConciergeClientset returns a real implementation of a conciergeclientset.Interface.
func getRealConciergeClientset(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, error) {
// getRealClientsets returns real implementations of the Concierge and Kubernetes client interfaces.
func getRealClientsets(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, kubernetes.Interface, aggregatorclient.Interface, error) {
restConfig, err := clientConfig.ClientConfig()
if err != nil {
return nil, err
return nil, nil, nil, err
}
client, err := kubeclient.New(
kubeclient.WithConfig(restConfig),
kubeclient.WithMiddleware(groupsuffix.New(apiGroupSuffix)),
)
if err != nil {
return nil, err
return nil, nil, nil, err
}
return client.PinnipedConcierge, nil
return client.PinnipedConcierge, client.Kubernetes, client.Aggregation, nil
}
// newClientConfig returns a clientcmd.ClientConfig given an optional kubeconfig path override and

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -12,6 +12,7 @@ import (
"io"
"net/http"
"os"
"slices"
"strconv"
"strings"
"time"
@@ -19,14 +20,15 @@ import (
coreosoidc "github.com/coreos/go-oidc/v3/oidc"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
_ "k8s.io/client-go/plugin/pkg/client/auth" // Adds handlers for various dynamic auth plugins in client-go
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"k8s.io/utils/strings/slices"
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
conciergev1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
authenticationv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1"
conciergeconfigv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1"
idpdiscoveryv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idpdiscovery/v1alpha1"
oidcapi "go.pinniped.dev/generated/latest/apis/supervisor/oidc"
conciergeclientset "go.pinniped.dev/generated/latest/client/concierge/clientset/versioned"
@@ -36,15 +38,17 @@ import (
)
type kubeconfigDeps struct {
getenv func(key string) string
getPathToSelf func() (string, error)
getClientset getConciergeClientsetFunc
getClientsets getClientsetsFunc
log plog.MinLogger
}
func kubeconfigRealDeps() kubeconfigDeps {
return kubeconfigDeps{
getenv: os.Getenv,
getPathToSelf: os.Executable,
getClientset: getRealConciergeClientset,
getClientsets: getRealClientsets,
log: plog.New(),
}
}
@@ -96,6 +100,7 @@ type getKubeconfigParams struct {
credentialCachePath string
credentialCachePathSet bool
installHint string
pinnipedCliPath string
}
type discoveryResponseScopesSupported struct {
@@ -142,25 +147,38 @@ func kubeconfigCommand(deps kubeconfigDeps) *cobra.Command {
f.BoolVar(&flags.oidc.debugSessionCache, "oidc-debug-session-cache", false, "Print debug logs related to the OpenID Connect session cache")
f.StringVar(&flags.oidc.requestAudience, "oidc-request-audience", "", "Request a token with an alternate audience using RFC8693 token exchange")
f.StringVar(&flags.oidc.upstreamIDPName, "upstream-identity-provider-name", "", "The name of the upstream identity provider used during login with a Supervisor")
f.StringVar(&flags.oidc.upstreamIDPType, "upstream-identity-provider-type", "", fmt.Sprintf("The type of the upstream identity provider used during login with a Supervisor (e.g. '%s', '%s', '%s')", idpdiscoveryv1alpha1.IDPTypeOIDC, idpdiscoveryv1alpha1.IDPTypeLDAP, idpdiscoveryv1alpha1.IDPTypeActiveDirectory))
f.StringVar(
&flags.oidc.upstreamIDPType,
"upstream-identity-provider-type",
"",
fmt.Sprintf(
"The type of the upstream identity provider used during login with a Supervisor (e.g. '%s', '%s', '%s', '%s')",
idpdiscoveryv1alpha1.IDPTypeOIDC,
idpdiscoveryv1alpha1.IDPTypeLDAP,
idpdiscoveryv1alpha1.IDPTypeActiveDirectory,
idpdiscoveryv1alpha1.IDPTypeGitHub,
),
)
f.StringVar(&flags.oidc.upstreamIDPFlow, "upstream-identity-provider-flow", "", fmt.Sprintf("The type of client flow to use with the upstream identity provider during login with a Supervisor (e.g. '%s', '%s')", idpdiscoveryv1alpha1.IDPFlowCLIPassword, idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode))
f.StringVar(&flags.kubeconfigPath, "kubeconfig", os.Getenv("KUBECONFIG"), "Path to kubeconfig file")
f.StringVar(&flags.kubeconfigPath, "kubeconfig", deps.getenv("KUBECONFIG"), "Path to kubeconfig file")
f.StringVar(&flags.kubeconfigContextOverride, "kubeconfig-context", "", "Kubeconfig context name (default: current active context)")
f.BoolVar(&flags.skipValidate, "skip-validation", false, "Skip final validation of the kubeconfig (default: false)")
f.DurationVar(&flags.timeout, "timeout", 10*time.Minute, "Timeout for autodiscovery and validation")
f.StringVarP(&flags.outputPath, "output", "o", "", "Output file path (default: stdout)")
f.StringVar(&flags.generatedNameSuffix, "generated-name-suffix", "-pinniped", "Suffix to append to generated cluster, context, user kubeconfig entries")
f.StringVar(&flags.credentialCachePath, "credential-cache", "", "Path to cluster-specific credentials cache")
f.StringVar(&flags.pinnipedCliPath, "pinniped-cli-path", "", "Full path or executable name for the Pinniped CLI binary to be embedded in the resulting kubeconfig output (e.g. 'pinniped') (default: full path of the binary used to execute this command)")
f.StringVar(&flags.installHint, "install-hint", "The pinniped CLI does not appear to be installed. See https://get.pinniped.dev/cli for more details", "This text is shown to the user when the pinniped CLI is not installed.")
mustMarkHidden(cmd, "oidc-debug-session-cache")
// --oidc-skip-listen is mainly needed for testing. We'll leave it hidden until we have a non-testing use case.
mustMarkHidden(cmd, "oidc-skip-listen")
mustMarkHidden(cmd,
"oidc-debug-session-cache",
"oidc-skip-listen", // --oidc-skip-listen is mainly needed for testing. We'll leave it hidden until we have a non-testing use case.
"concierge-namespace",
)
mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore")
mustMarkHidden(cmd, "concierge-namespace")
cmd.RunE = func(cmd *cobra.Command, args []string) error {
cmd.RunE = func(cmd *cobra.Command, _args []string) error {
if flags.outputPath != "" {
out, err := os.Create(flags.outputPath)
if err != nil {
@@ -179,7 +197,7 @@ func runGetKubeconfig(ctx context.Context, out io.Writer, deps kubeconfigDeps, f
ctx, cancel := context.WithTimeout(ctx, flags.timeout)
defer cancel()
// the log statements in this file assume that Info logs are unconditionally printed so we set the global level to info
// the log statements in this file assume that Info logs are unconditionally printed, so we set the global level to info
if err := plog.ValidateAndSetLogLevelAndFormatGlobally(ctx, plog.LogSpec{Level: plog.LevelInfo, Format: plog.FormatCLI}); err != nil {
return err
}
@@ -199,7 +217,7 @@ func runGetKubeconfig(ctx context.Context, out io.Writer, deps kubeconfigDeps, f
return fmt.Errorf("could not load --kubeconfig/--kubeconfig-context: %w", err)
}
cluster := currentKubeConfig.Clusters[currentKubeconfigNames.ClusterName]
clientset, err := deps.getClientset(clientConfig, flags.concierge.apiGroupSuffix)
conciergeClient, kubeClient, aggregatorClient, err := deps.getClientsets(clientConfig, flags.concierge.apiGroupSuffix)
if err != nil {
return fmt.Errorf("could not configure Kubernetes client: %w", err)
}
@@ -212,13 +230,15 @@ func runGetKubeconfig(ctx context.Context, out io.Writer, deps kubeconfigDeps, f
}
if !flags.concierge.disabled {
credentialIssuer, err := waitForCredentialIssuer(ctx, clientset, flags, deps)
// Look up the Concierge's CredentialIssuer, and optionally wait for it to have no pending strategies showing in its status.
credentialIssuer, err := waitForCredentialIssuer(ctx, conciergeClient, flags, deps)
if err != nil {
return err
}
// Decide which Concierge authenticator should be used in the resulting kubeconfig.
authenticator, err := lookupAuthenticator(
clientset,
conciergeClient,
flags.concierge.authenticatorType,
flags.concierge.authenticatorName,
deps.log,
@@ -226,10 +246,15 @@ func runGetKubeconfig(ctx context.Context, out io.Writer, deps kubeconfigDeps, f
if err != nil {
return err
}
// Discover from the CredentialIssuer how the resulting kubeconfig should be configured to talk to this Concierge.
if err := discoverConciergeParams(credentialIssuer, &flags, cluster, deps.log); err != nil {
return err
}
if err := discoverAuthenticatorParams(authenticator, &flags, deps.log); err != nil {
// Discover how the resulting kubeconfig should interact with the selected authenticator.
// For a JWTAuthenticator, this includes discovering how to talk to the OIDC issuer configured in its spec fields.
if err := discoverAuthenticatorParams(ctx, authenticator, &flags, kubeClient, aggregatorClient, deps.log); err != nil {
return err
}
@@ -239,6 +264,7 @@ func runGetKubeconfig(ctx context.Context, out io.Writer, deps kubeconfigDeps, f
}
if len(flags.oidc.issuer) > 0 {
// The OIDC provider may or may not be a Pinniped Supervisor. Find out.
err = pinnipedSupervisorDiscovery(ctx, &flags, deps.log)
if err != nil {
return err
@@ -268,7 +294,12 @@ func newExecConfig(deps kubeconfigDeps, flags getKubeconfigParams) (*clientcmdap
execConfig.InstallHint = flags.installHint
var err error
execConfig.Command, err = deps.getPathToSelf()
execConfig.Command, err = func() (string, error) {
if flags.pinnipedCliPath != "" {
return flags.pinnipedCliPath, nil
}
return deps.getPathToSelf()
}()
if err != nil {
return nil, fmt.Errorf("could not determine the Pinniped executable path: %w", err)
}
@@ -295,7 +326,7 @@ func newExecConfig(deps kubeconfigDeps, flags getKubeconfigParams) (*clientcmdap
if flags.staticToken != "" && flags.staticTokenEnvName != "" {
return nil, fmt.Errorf("only one of --static-token and --static-token-env can be specified")
}
execConfig.Args = append([]string{"login", "static"}, execConfig.Args...)
execConfig.Args = slices.Concat([]string{"login", "static"}, execConfig.Args)
if flags.staticToken != "" {
execConfig.Args = append(execConfig.Args, "--token="+flags.staticToken)
}
@@ -306,7 +337,7 @@ func newExecConfig(deps kubeconfigDeps, flags getKubeconfigParams) (*clientcmdap
}
// Otherwise continue to parse the OIDC-related flags and output a config that runs `pinniped login oidc`.
execConfig.Args = append([]string{"login", "oidc"}, execConfig.Args...)
execConfig.Args = slices.Concat([]string{"login", "oidc"}, execConfig.Args)
if flags.oidc.issuer == "" {
return nil, fmt.Errorf("could not autodiscover --oidc-issuer and none was provided")
}
@@ -372,7 +403,7 @@ func getCurrentContext(currentKubeConfig clientcmdapi.Config, flags getKubeconfi
return &kubeconfigNames{ContextName: contextName, UserName: ctx.AuthInfo, ClusterName: ctx.Cluster}, nil
}
func waitForCredentialIssuer(ctx context.Context, clientset conciergeclientset.Interface, flags getKubeconfigParams, deps kubeconfigDeps) (*configv1alpha1.CredentialIssuer, error) {
func waitForCredentialIssuer(ctx context.Context, clientset conciergeclientset.Interface, flags getKubeconfigParams, deps kubeconfigDeps) (*conciergeconfigv1alpha1.CredentialIssuer, error) {
credentialIssuer, err := lookupCredentialIssuer(clientset, flags.concierge.credentialIssuer, deps.log)
if err != nil {
return nil, err
@@ -385,10 +416,7 @@ func waitForCredentialIssuer(ctx context.Context, clientset conciergeclientset.I
deadline, _ := ctx.Deadline()
attempts := 1
for {
if !hasPendingStrategy(credentialIssuer) {
break
}
for hasPendingStrategy(credentialIssuer) {
logStrategies(credentialIssuer, deps.log)
deps.log.Info("waiting for CredentialIssuer pending strategies to finish",
"attempts", attempts,
@@ -408,7 +436,7 @@ func waitForCredentialIssuer(ctx context.Context, clientset conciergeclientset.I
return credentialIssuer, nil
}
func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer, flags *getKubeconfigParams, v1Cluster *clientcmdapi.Cluster, log plog.MinLogger) error {
func discoverConciergeParams(credentialIssuer *conciergeconfigv1alpha1.CredentialIssuer, flags *getKubeconfigParams, v1Cluster *clientcmdapi.Cluster, log plog.MinLogger) error {
// Autodiscover the --concierge-mode.
frontend, err := getConciergeFrontend(credentialIssuer, flags.concierge.mode)
if err != nil {
@@ -419,10 +447,10 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer,
// Auto-set --concierge-mode if it wasn't explicitly set.
if flags.concierge.mode == modeUnknown {
switch frontend.Type {
case configv1alpha1.TokenCredentialRequestAPIFrontendType:
case conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType:
log.Info("discovered Concierge operating in TokenCredentialRequest API mode")
flags.concierge.mode = modeTokenCredentialRequestAPI
case configv1alpha1.ImpersonationProxyFrontendType:
case conciergeconfigv1alpha1.ImpersonationProxyFrontendType:
log.Info("discovered Concierge operating in impersonation proxy mode")
flags.concierge.mode = modeImpersonationProxy
}
@@ -431,9 +459,9 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer,
// Auto-set --concierge-endpoint if it wasn't explicitly set.
if flags.concierge.endpoint == "" {
switch frontend.Type {
case configv1alpha1.TokenCredentialRequestAPIFrontendType:
case conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType:
flags.concierge.endpoint = v1Cluster.Server
case configv1alpha1.ImpersonationProxyFrontendType:
case conciergeconfigv1alpha1.ImpersonationProxyFrontendType:
flags.concierge.endpoint = frontend.ImpersonationProxyInfo.Endpoint
}
log.Info("discovered Concierge endpoint", "endpoint", flags.concierge.endpoint)
@@ -442,9 +470,9 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer,
// Auto-set --concierge-ca-bundle if it wasn't explicitly set..
if len(flags.concierge.caBundle) == 0 {
switch frontend.Type {
case configv1alpha1.TokenCredentialRequestAPIFrontendType:
case conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType:
flags.concierge.caBundle = v1Cluster.CertificateAuthorityData
case configv1alpha1.ImpersonationProxyFrontendType:
case conciergeconfigv1alpha1.ImpersonationProxyFrontendType:
data, err := base64.StdEncoding.DecodeString(frontend.ImpersonationProxyInfo.CertificateAuthorityData)
if err != nil {
return fmt.Errorf("autodiscovered Concierge CA bundle is invalid: %w", err)
@@ -456,7 +484,7 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer,
return nil
}
func logStrategies(credentialIssuer *configv1alpha1.CredentialIssuer, log plog.MinLogger) {
func logStrategies(credentialIssuer *conciergeconfigv1alpha1.CredentialIssuer, log plog.MinLogger) {
for _, strategy := range credentialIssuer.Status.Strategies {
log.Info("found CredentialIssuer strategy",
"type", strategy.Type,
@@ -467,9 +495,16 @@ func logStrategies(credentialIssuer *configv1alpha1.CredentialIssuer, log plog.M
}
}
func discoverAuthenticatorParams(authenticator metav1.Object, flags *getKubeconfigParams, log plog.MinLogger) error {
func discoverAuthenticatorParams(
ctx context.Context,
authenticator metav1.Object,
flags *getKubeconfigParams,
kubeClient kubernetes.Interface,
aggregatorClient aggregatorclient.Interface,
log plog.MinLogger,
) error {
switch auth := authenticator.(type) {
case *conciergev1alpha1.WebhookAuthenticator:
case *authenticationv1alpha1.WebhookAuthenticator:
// If the --concierge-authenticator-type/--concierge-authenticator-name flags were not set explicitly, set
// them to point at the discovered WebhookAuthenticator.
if flags.concierge.authenticatorType == "" && flags.concierge.authenticatorName == "" {
@@ -477,7 +512,7 @@ func discoverAuthenticatorParams(authenticator metav1.Object, flags *getKubeconf
flags.concierge.authenticatorType = "webhook"
flags.concierge.authenticatorName = auth.Name
}
case *conciergev1alpha1.JWTAuthenticator:
case *authenticationv1alpha1.JWTAuthenticator:
// If the --concierge-authenticator-type/--concierge-authenticator-name flags were not set explicitly, set
// them to point at the discovered JWTAuthenticator.
if flags.concierge.authenticatorType == "" && flags.concierge.authenticatorName == "" {
@@ -499,46 +534,146 @@ func discoverAuthenticatorParams(authenticator metav1.Object, flags *getKubeconf
}
// If the --oidc-ca-bundle flags was not set explicitly, default it to the
// spec.tls.certificateAuthorityData field of the JWTAuthenticator.
if len(flags.oidc.caBundle) == 0 && auth.Spec.TLS != nil && auth.Spec.TLS.CertificateAuthorityData != "" {
decoded, err := base64.StdEncoding.DecodeString(auth.Spec.TLS.CertificateAuthorityData)
// spec.tls.certificateAuthorityData field of the JWTAuthenticator, if that field is set, or else
// try to discover it from the spec.tls.certificateAuthorityDataSource, if that field is set.
if len(flags.oidc.caBundle) == 0 && auth.Spec.TLS != nil {
err := discoverOIDCCABundle(ctx, auth, flags, kubeClient, aggregatorClient, log)
if err != nil {
return fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator %s has invalid spec.tls.certificateAuthorityData: %w", auth.Name, err)
return err
}
log.Info("discovered OIDC CA bundle", "roots", countCACerts(decoded))
flags.oidc.caBundle = decoded
}
}
return nil
}
func getConciergeFrontend(credentialIssuer *configv1alpha1.CredentialIssuer, mode conciergeModeFlag) (*configv1alpha1.CredentialIssuerFrontend, error) {
func discoverOIDCCABundle(
ctx context.Context,
jwtAuthenticator *authenticationv1alpha1.JWTAuthenticator,
flags *getKubeconfigParams,
kubeClient kubernetes.Interface,
aggregatorClient aggregatorclient.Interface,
log plog.MinLogger,
) error {
if jwtAuthenticator.Spec.TLS.CertificateAuthorityData != "" {
decodedCABundleData, err := base64.StdEncoding.DecodeString(jwtAuthenticator.Spec.TLS.CertificateAuthorityData)
if err != nil {
return fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator %s has invalid spec.tls.certificateAuthorityData: %w", jwtAuthenticator.Name, err)
}
log.Info("discovered OIDC CA bundle", "roots", countCACerts(decodedCABundleData))
flags.oidc.caBundle = decodedCABundleData
} else if jwtAuthenticator.Spec.TLS.CertificateAuthorityDataSource != nil {
caBundleData, err := discoverOIDCCABundleFromCertificateAuthorityDataSource(
ctx, jwtAuthenticator, flags.concierge.apiGroupSuffix, kubeClient, aggregatorClient, log)
if err != nil {
return err
}
flags.oidc.caBundle = caBundleData
}
return nil
}
func discoverOIDCCABundleFromCertificateAuthorityDataSource(
ctx context.Context,
jwtAuthenticator *authenticationv1alpha1.JWTAuthenticator,
apiGroupSuffix string,
kubeClient kubernetes.Interface,
aggregatorClient aggregatorclient.Interface,
log plog.MinLogger,
) ([]byte, error) {
conciergeNamespace, err := discoverConciergeNamespace(ctx, apiGroupSuffix, aggregatorClient)
if err != nil {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but encountered error discovering namespace of Concierge for JWTAuthenticator %s: %w", jwtAuthenticator.Name, err)
}
log.Info("discovered Concierge namespace for API group suffix", "apiGroupSuffix", apiGroupSuffix)
var caBundleData []byte
var keyExisted bool
caSource := jwtAuthenticator.Spec.TLS.CertificateAuthorityDataSource
// Note that the Kind, Name, and Key fields must all be non-empty, and Kind must be Secret or ConfigMap, due to CRD validations.
switch caSource.Kind {
case authenticationv1alpha1.CertificateAuthorityDataSourceKindConfigMap:
caBundleConfigMap, err := kubeClient.CoreV1().ConfigMaps(conciergeNamespace).Get(ctx, caSource.Name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but encountered error getting %s %s/%s specified by JWTAuthenticator %s spec.tls.certificateAuthorityDataSource: %w",
caSource.Kind, conciergeNamespace, caSource.Name, jwtAuthenticator.Name, err)
}
var caBundleDataStr string
caBundleDataStr, keyExisted = caBundleConfigMap.Data[caSource.Key]
caBundleData = []byte(caBundleDataStr)
case authenticationv1alpha1.CertificateAuthorityDataSourceKindSecret:
caBundleSecret, err := kubeClient.CoreV1().Secrets(conciergeNamespace).Get(ctx, caSource.Name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but encountered error getting %s %s/%s specified by JWTAuthenticator %s spec.tls.certificateAuthorityDataSource: %w",
caSource.Kind, conciergeNamespace, caSource.Name, jwtAuthenticator.Name, err)
}
caBundleData, keyExisted = caBundleSecret.Data[caSource.Key]
default:
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator %s spec.tls.certificateAuthorityDataSource.Kind value %q is not supported by this CLI version",
jwtAuthenticator.Name, caSource.Kind)
}
if !keyExisted {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but key %q specified by JWTAuthenticator %s spec.tls.certificateAuthorityDataSource.key does not exist in %s %s/%s",
caSource.Key, jwtAuthenticator.Name, caSource.Kind, conciergeNamespace, caSource.Name)
}
if len(caBundleData) == 0 {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but key %q specified by JWTAuthenticator %s spec.tls.certificateAuthorityDataSource.key exists but has empty value in %s %s/%s",
caSource.Key, jwtAuthenticator.Name, caSource.Kind, conciergeNamespace, caSource.Name)
}
numCACerts := countCACerts(caBundleData)
if numCACerts == 0 {
return nil, fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but value at key %q specified by JWTAuthenticator %s spec.tls.certificateAuthorityDataSource.key does not contain any CA certificates in %s %s/%s",
caSource.Key, jwtAuthenticator.Name, caSource.Kind, conciergeNamespace, caSource.Name)
}
log.Info("discovered OIDC CA bundle from JWTAuthenticator spec.tls.certificateAuthorityDataSource", "roots", numCACerts)
return caBundleData, nil
}
func discoverConciergeNamespace(ctx context.Context, apiGroupSuffix string, aggregatorClient aggregatorclient.Interface) (string, error) {
// Let's look for the APIService for the API group of the Concierge's TokenCredentialRequest aggregated API.
apiGroup := "login.concierge." + apiGroupSuffix
// List all APIServices.
apiServiceList, err := aggregatorClient.ApiregistrationV1().APIServices().List(ctx, metav1.ListOptions{})
if err != nil {
return "", fmt.Errorf("error listing APIServices: %w", err)
}
// Find one with the expected API group name.
for _, apiService := range apiServiceList.Items {
if apiService.Spec.Group == apiGroup {
if apiService.Spec.Service.Namespace != "" {
// We are assuming that all API versions (e.g. v1alpha1) of this API group are backed by service(s)
// in the same namespace, which is the namespace of the Concierge hosting this API suffix.
return apiService.Spec.Service.Namespace, nil
}
}
}
// Couldn't find any APIService for the expected API group name which contained a namespace reference in its spec.
return "", fmt.Errorf("could not find APIService with non-empty spec.service.namespace for API group %s", apiGroup)
}
func getConciergeFrontend(credentialIssuer *conciergeconfigv1alpha1.CredentialIssuer, mode conciergeModeFlag) (*conciergeconfigv1alpha1.CredentialIssuerFrontend, error) {
for _, strategy := range credentialIssuer.Status.Strategies {
// Skip unhealthy strategies.
if strategy.Status != configv1alpha1.SuccessStrategyStatus {
if strategy.Status != conciergeconfigv1alpha1.SuccessStrategyStatus {
continue
}
// Backfill the .status.strategies[].frontend field from .status.kubeConfigInfo for backwards compatibility.
if strategy.Type == configv1alpha1.KubeClusterSigningCertificateStrategyType && strategy.Frontend == nil && credentialIssuer.Status.KubeConfigInfo != nil {
strategy = *strategy.DeepCopy()
strategy.Frontend = &configv1alpha1.CredentialIssuerFrontend{
Type: configv1alpha1.TokenCredentialRequestAPIFrontendType,
TokenCredentialRequestAPIInfo: &configv1alpha1.TokenCredentialRequestAPIInfo{
Server: credentialIssuer.Status.KubeConfigInfo.Server,
CertificateAuthorityData: credentialIssuer.Status.KubeConfigInfo.CertificateAuthorityData,
},
}
}
// If the strategy frontend is still nil, skip.
// If the strategy frontend is nil, skip.
if strategy.Frontend == nil {
continue
}
// Skip any unknown frontend types.
switch strategy.Frontend.Type {
case configv1alpha1.TokenCredentialRequestAPIFrontendType, configv1alpha1.ImpersonationProxyFrontendType:
case conciergeconfigv1alpha1.TokenCredentialRequestAPIFrontendType,
conciergeconfigv1alpha1.ImpersonationProxyFrontendType:
default:
continue
}
@@ -566,7 +701,7 @@ func newExecKubeconfig(cluster *clientcmdapi.Cluster, execConfig *clientcmdapi.E
}
}
func lookupCredentialIssuer(clientset conciergeclientset.Interface, name string, log plog.MinLogger) (*configv1alpha1.CredentialIssuer, error) {
func lookupCredentialIssuer(clientset conciergeclientset.Interface, name string, log plog.MinLogger) (*conciergeconfigv1alpha1.CredentialIssuer, error) {
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*20)
defer cancelFunc()
@@ -724,13 +859,12 @@ func validateKubeconfig(ctx context.Context, flags getKubeconfigParams, kubeconf
func countCACerts(pemData []byte) int {
pool := x509.NewCertPool()
pool.AppendCertsFromPEM(pemData)
//nolint:staticcheck // since we're not using .Subjects() to access the system pool
return len(pool.Subjects())
return len(pool.Subjects()) //nolint:staticcheck // there's no other clear way to mimic this legacy behavior
}
func hasPendingStrategy(credentialIssuer *configv1alpha1.CredentialIssuer) bool {
func hasPendingStrategy(credentialIssuer *conciergeconfigv1alpha1.CredentialIssuer) bool {
for _, strategy := range credentialIssuer.Status.Strategies {
if strategy.Reason == configv1alpha1.PendingStrategyReason {
if strategy.Reason == conciergeconfigv1alpha1.PendingStrategyReason {
return true
}
}
@@ -775,12 +909,12 @@ func pinnipedSupervisorDiscovery(ctx context.Context, flags *getKubeconfigParams
return err
}
if !supervisorSupportsBothUsernameAndGroupsScopes {
flags.oidc.scopes = slices.Filter(nil, flags.oidc.scopes, func(scope string) bool {
flags.oidc.scopes = slices.DeleteFunc(flags.oidc.scopes, func(scope string) bool {
if scope == oidcapi.ScopeUsername || scope == oidcapi.ScopeGroups {
log.Info("removed scope from --oidc-scopes list because it is not supported by this Supervisor", "scope", scope)
return false // Remove username and groups scopes if there were present in the flags.
return true // Remove username and groups scopes if there were present in the flags.
}
return true // Keep any other scopes in the flag list.
return false // Keep any other scopes in the flag list.
})
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -12,7 +12,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/cobra"
@@ -39,6 +38,18 @@ const (
// which specifies "cli_password" when using an IDE plugin where there is no interactive CLI available. This allows
// the user to use one kubeconfig file for both flows.
upstreamIdentityProviderFlowEnvVarName = "PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW"
// When using a browser-based login flow, the user may skip printing the login URL to the screen in the case
// where the browser was launched with the login URL. This can be useful, for example, when using a console-based
// UI like k9s, to avoid having any output to stderr which may confuse the UI. Set this env var to "true" to
// skip printing the URL.
skipPrintLoginURLEnvVarName = "PINNIPED_SKIP_PRINT_LOGIN_URL"
// Set this env var to "true" to cause debug logs to be printed to stderr.
debugEnvVarName = "PINNIPED_DEBUG"
// The value to use for true/false env vars to enable the behavior caused by the env var.
envVarTruthyValue = "true"
)
//nolint:gochecknoinits
@@ -47,9 +58,10 @@ func init() {
}
type oidcLoginCommandDeps struct {
lookupEnv func(string) (string, bool)
login func(string, string, ...oidcclient.Option) (*oidctypes.Token, error)
exchangeToken func(context.Context, *conciergeclient.Client, string) (*clientauthv1beta1.ExecCredential, error)
lookupEnv func(string) (string, bool)
login func(string, string, ...oidcclient.Option) (*oidctypes.Token, error)
exchangeToken func(context.Context, *conciergeclient.Client, string) (*clientauthv1beta1.ExecCredential, error)
optionsFactory OIDCClientOptions
}
func oidcLoginCommandRealDeps() oidcLoginCommandDeps {
@@ -59,6 +71,7 @@ func oidcLoginCommandRealDeps() oidcLoginCommandDeps {
exchangeToken: func(ctx context.Context, client *conciergeclient.Client, token string) (*clientauthv1beta1.ExecCredential, error) {
return client.ExchangeToken(ctx, token)
},
optionsFactory: &clientOptions{},
}
}
@@ -128,14 +141,23 @@ func oidcLoginCommand(deps oidcLoginCommandDeps) *cobra.Command {
cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", groupsuffix.PinnipedDefaultSuffix, "Concierge API group suffix")
cmd.Flags().StringVar(&flags.credentialCachePath, "credential-cache", filepath.Join(mustGetConfigDir(), "credentials.yaml"), "Path to cluster-specific credentials cache (\"\" disables the cache)")
cmd.Flags().StringVar(&flags.upstreamIdentityProviderName, "upstream-identity-provider-name", "", "The name of the upstream identity provider used during login with a Supervisor")
cmd.Flags().StringVar(&flags.upstreamIdentityProviderType, "upstream-identity-provider-type", idpdiscoveryv1alpha1.IDPTypeOIDC.String(), fmt.Sprintf("The type of the upstream identity provider used during login with a Supervisor (e.g. '%s', '%s', '%s')", idpdiscoveryv1alpha1.IDPTypeOIDC, idpdiscoveryv1alpha1.IDPTypeLDAP, idpdiscoveryv1alpha1.IDPTypeActiveDirectory))
cmd.Flags().StringVar(&flags.upstreamIdentityProviderType,
"upstream-identity-provider-type",
idpdiscoveryv1alpha1.IDPTypeOIDC.String(),
fmt.Sprintf(
"The type of the upstream identity provider used during login with a Supervisor (e.g. '%s', '%s', '%s', '%s')",
idpdiscoveryv1alpha1.IDPTypeOIDC,
idpdiscoveryv1alpha1.IDPTypeLDAP,
idpdiscoveryv1alpha1.IDPTypeActiveDirectory,
idpdiscoveryv1alpha1.IDPTypeGitHub,
))
cmd.Flags().StringVar(&flags.upstreamIdentityProviderFlow, "upstream-identity-provider-flow", "", fmt.Sprintf("The type of client flow to use with the upstream identity provider during login with a Supervisor (e.g. '%s', '%s')", idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode, idpdiscoveryv1alpha1.IDPFlowCLIPassword))
// --skip-listen is mainly needed for testing. We'll leave it hidden until we have a non-testing use case.
mustMarkHidden(cmd, "skip-listen")
mustMarkHidden(cmd, "debug-session-cache")
mustMarkRequired(cmd, "issuer")
cmd.RunE = func(cmd *cobra.Command, args []string) error { return runOIDCLogin(cmd, deps, flags) }
cmd.RunE = func(cmd *cobra.Command, _args []string) error { return runOIDCLogin(cmd, deps, flags) }
mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore")
mustMarkHidden(cmd, "concierge-namespace")
@@ -154,43 +176,45 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
// If the hidden --debug-session-cache option is passed, log all the errors from the session cache.
if flags.debugSessionCache {
logger := plog.WithName("session")
sessionOptions = append(sessionOptions, filesession.WithErrorReporter(func(err error) {
logger.Error("error during session cache operation", err)
pLogger.Error("error during session cache operation", err)
}))
}
sessionCache := filesession.New(flags.sessionCachePath, sessionOptions...)
// Initialize the login handler.
opts := []oidcclient.Option{
oidcclient.WithContext(cmd.Context()),
oidcclient.WithLogger(plog.Logr()), //nolint:staticcheck // old code with lots of log statements
oidcclient.WithScopes(flags.scopes),
oidcclient.WithSessionCache(sessionCache),
deps.optionsFactory.WithContext(cmd.Context()),
deps.optionsFactory.WithLoginLogger(pLogger),
deps.optionsFactory.WithScopes(flags.scopes),
deps.optionsFactory.WithSessionCache(sessionCache),
}
skipPrintLoginURL, _ := deps.lookupEnv(skipPrintLoginURLEnvVarName)
if skipPrintLoginURL == envVarTruthyValue {
opts = append(opts, deps.optionsFactory.WithSkipPrintLoginURL())
}
if flags.listenPort != 0 {
opts = append(opts, oidcclient.WithListenPort(flags.listenPort))
opts = append(opts, deps.optionsFactory.WithListenPort(flags.listenPort))
}
if flags.requestAudience != "" {
opts = append(opts, oidcclient.WithRequestAudience(flags.requestAudience))
opts = append(opts, deps.optionsFactory.WithRequestAudience(flags.requestAudience))
}
if flags.upstreamIdentityProviderName != "" {
opts = append(opts, oidcclient.WithUpstreamIdentityProvider(
opts = append(opts, deps.optionsFactory.WithUpstreamIdentityProvider(
flags.upstreamIdentityProviderName, flags.upstreamIdentityProviderType))
}
flowOpts, err := flowOptions(
idpdiscoveryv1alpha1.IDPType(flags.upstreamIdentityProviderType),
idpdiscoveryv1alpha1.IDPFlow(flags.upstreamIdentityProviderFlow),
deps,
)
if err != nil {
return err
requestedFlow, flowSource := idpdiscoveryv1alpha1.IDPFlow(flags.upstreamIdentityProviderFlow), "--upstream-identity-provider-flow"
if flowOverride, hasFlowOverride := deps.lookupEnv(upstreamIdentityProviderFlowEnvVarName); hasFlowOverride {
requestedFlow, flowSource = idpdiscoveryv1alpha1.IDPFlow(flowOverride), upstreamIdentityProviderFlowEnvVarName
}
if requestedFlow != "" {
opts = append(opts, deps.optionsFactory.WithLoginFlow(requestedFlow, flowSource))
}
opts = append(opts, flowOpts...)
var concierge *conciergeclient.Client
if flags.conciergeEnabled {
@@ -200,6 +224,7 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
conciergeclient.WithBase64CABundle(flags.conciergeCABundle),
conciergeclient.WithAuthenticator(flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName),
conciergeclient.WithAPIGroupSuffix(flags.conciergeAPIGroupSuffix),
conciergeclient.WithTransportWrapper(LogAuditIDTransportWrapper),
)
if err != nil {
return fmt.Errorf("invalid Concierge parameters: %w", err)
@@ -208,12 +233,12 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
// --skip-browser skips opening the browser.
if flags.skipBrowser {
opts = append(opts, oidcclient.WithSkipBrowserOpen())
opts = append(opts, deps.optionsFactory.WithSkipBrowserOpen())
}
// --skip-listen skips starting the localhost callback listener.
if flags.skipListen {
opts = append(opts, oidcclient.WithSkipListen())
opts = append(opts, deps.optionsFactory.WithSkipListen())
}
if len(flags.caBundlePaths) > 0 || len(flags.caBundleData) > 0 {
@@ -221,7 +246,7 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
if err != nil {
return err
}
opts = append(opts, oidcclient.WithClient(client))
opts = append(opts, deps.optionsFactory.WithClient(client))
}
// Look up cached credentials based on a hash of all the CLI arguments and the cluster info.
cacheKey := struct {
@@ -241,12 +266,12 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
}
pLogger.Debug("Performing OIDC login", "issuer", flags.issuer, "client id", flags.clientID)
// Do the basic login to get an OIDC token.
// Do the basic login to get an OIDC token. Although this can return several tokens, we only need the ID token here.
token, err := deps.login(flags.issuer, flags.clientID, opts...)
if err != nil {
return fmt.Errorf("could not complete Pinniped login: %w", err)
}
cred := tokenCredential(token)
cred := tokenCredential(token.IDToken)
// If the concierge was configured, exchange the credential for a separate short-lived, cluster-specific credential.
if concierge != nil {
@@ -271,60 +296,6 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin
return json.NewEncoder(cmd.OutOrStdout()).Encode(cred)
}
func flowOptions(
requestedIDPType idpdiscoveryv1alpha1.IDPType,
requestedFlow idpdiscoveryv1alpha1.IDPFlow,
deps oidcLoginCommandDeps,
) ([]oidcclient.Option, error) {
useCLIFlow := []oidcclient.Option{oidcclient.WithCLISendingCredentials()}
// If the env var is set to override the --upstream-identity-provider-type flag, then override it.
flowOverride, hasFlowOverride := deps.lookupEnv(upstreamIdentityProviderFlowEnvVarName)
flowSource := "--upstream-identity-provider-flow"
if hasFlowOverride {
requestedFlow = idpdiscoveryv1alpha1.IDPFlow(flowOverride)
flowSource = upstreamIdentityProviderFlowEnvVarName
}
switch requestedIDPType {
case idpdiscoveryv1alpha1.IDPTypeOIDC:
switch requestedFlow {
case idpdiscoveryv1alpha1.IDPFlowCLIPassword:
return useCLIFlow, nil
case idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode, "":
return nil, nil // browser authcode flow is the default Option, so don't need to return an Option here
default:
return nil, fmt.Errorf(
"%s value not recognized for identity provider type %q: %s (supported values: %s)",
flowSource, requestedIDPType, requestedFlow,
strings.Join([]string{idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode.String(), idpdiscoveryv1alpha1.IDPFlowCLIPassword.String()}, ", "))
}
case idpdiscoveryv1alpha1.IDPTypeLDAP, idpdiscoveryv1alpha1.IDPTypeActiveDirectory:
switch requestedFlow {
case idpdiscoveryv1alpha1.IDPFlowCLIPassword, "":
return useCLIFlow, nil
case idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode:
return nil, nil // browser authcode flow is the default Option, so don't need to return an Option here
default:
return nil, fmt.Errorf(
"%s value not recognized for identity provider type %q: %s (supported values: %s)",
flowSource, requestedIDPType, requestedFlow,
strings.Join([]string{idpdiscoveryv1alpha1.IDPFlowCLIPassword.String(), idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode.String()}, ", "))
}
default:
// Surprisingly cobra does not support this kind of flag validation. See https://github.com/spf13/pflag/issues/236
return nil, fmt.Errorf(
"--upstream-identity-provider-type value not recognized: %s (supported values: %s)",
requestedIDPType,
strings.Join([]string{
idpdiscoveryv1alpha1.IDPTypeOIDC.String(),
idpdiscoveryv1alpha1.IDPTypeLDAP.String(),
idpdiscoveryv1alpha1.IDPTypeActiveDirectory.String(),
}, ", "),
)
}
}
func makeClient(caBundlePaths []string, caBundleData []string) (*http.Client, error) {
pool := x509.NewCertPool()
for _, p := range caBundlePaths {
@@ -344,32 +315,31 @@ func makeClient(caBundlePaths []string, caBundleData []string) (*http.Client, er
return phttp.Default(pool), nil
}
func tokenCredential(token *oidctypes.Token) *clientauthv1beta1.ExecCredential {
func tokenCredential(idToken *oidctypes.IDToken) *clientauthv1beta1.ExecCredential {
cred := clientauthv1beta1.ExecCredential{
TypeMeta: metav1.TypeMeta{
Kind: "ExecCredential",
APIVersion: "client.authentication.k8s.io/v1beta1",
},
Status: &clientauthv1beta1.ExecCredentialStatus{
Token: token.IDToken.Token,
Token: idToken.Token,
},
}
if !token.IDToken.Expiry.IsZero() {
cred.Status.ExpirationTimestamp = &token.IDToken.Expiry
if !idToken.Expiry.IsZero() {
cred.Status.ExpirationTimestamp = &idToken.Expiry
}
return &cred
}
func SetLogLevel(ctx context.Context, lookupEnv func(string) (string, bool)) (plog.Logger, error) {
debug, _ := lookupEnv("PINNIPED_DEBUG")
if debug == "true" {
debug, _ := lookupEnv(debugEnvVarName)
if debug == envVarTruthyValue {
err := plog.ValidateAndSetLogLevelAndFormatGlobally(ctx, plog.LogSpec{Level: plog.LevelDebug, Format: plog.FormatCLI})
if err != nil {
return nil, err
}
}
logger := plog.New().WithName("pinniped-login")
return logger, nil
return plog.New(), nil
}
/*

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -10,18 +10,20 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/mock/gomock"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientauthv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
clocktesting "k8s.io/utils/clock/testing"
idpdiscoveryv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idpdiscovery/v1alpha1"
oidcapi "go.pinniped.dev/generated/latest/apis/supervisor/oidc"
"go.pinniped.dev/internal/certauthority"
"go.pinniped.dev/internal/here"
"go.pinniped.dev/internal/mocks/mockoidcclientoptions"
"go.pinniped.dev/internal/plog"
"go.pinniped.dev/internal/testutil"
"go.pinniped.dev/pkg/conciergeclient"
@@ -34,7 +36,7 @@ func TestLoginOIDCCommand(t *testing.T) {
testCA, err := certauthority.New("Test CA", 1*time.Hour)
require.NoError(t, err)
tmpdir := testutil.TempDir(t)
tmpdir := t.TempDir()
testCABundlePath := filepath.Join(tmpdir, "testca.pem")
require.NoError(t, os.WriteFile(testCABundlePath, testCA.Bundle(), 0600))
@@ -44,6 +46,13 @@ func TestLoginOIDCCommand(t *testing.T) {
require.NoError(t, err)
nowStr := now.Local().Format(time.RFC1123)
defaultWantedOptions := func(f *mockoidcclientoptions.MockOIDCClientOptions) {
f.EXPECT().WithContext(gomock.Any())
f.EXPECT().WithLoginLogger(gomock.Any())
f.EXPECT().WithScopes([]string{oidcapi.ScopeOfflineAccess, oidcapi.ScopeOpenID, oidcapi.ScopeRequestAudience, oidcapi.ScopeUsername, oidcapi.ScopeGroups})
f.EXPECT().WithSessionCache(gomock.Any())
}
tests := []struct {
name string
args []string
@@ -53,6 +62,7 @@ func TestLoginOIDCCommand(t *testing.T) {
wantError bool
wantStdout string
wantStderr string
wantOptions func(f *mockoidcclientoptions.MockOIDCClientOptions)
wantOptionsCount int
wantLogs []string
}{
@@ -93,7 +103,7 @@ func TestLoginOIDCCommand(t *testing.T) {
--skip-browser Skip opening the browser (just print the URL)
--upstream-identity-provider-flow string The type of client flow to use with the upstream identity provider during login with a Supervisor (e.g. 'browser_authcode', 'cli_password')
--upstream-identity-provider-name string The name of the upstream identity provider used during login with a Supervisor
--upstream-identity-provider-type string The type of the upstream identity provider used during login with a Supervisor (e.g. 'oidc', 'ldap', 'activedirectory') (default "oidc")
--upstream-identity-provider-type string The type of the upstream identity provider used during login with a Supervisor (e.g. 'oidc', 'ldap', 'activedirectory', 'github') (default "oidc")
`),
},
{
@@ -111,7 +121,8 @@ func TestLoginOIDCCommand(t *testing.T) {
"--issuer", "test-issuer",
"--enable-concierge",
},
wantError: true,
wantOptions: defaultWantedOptions,
wantError: true,
wantStderr: here.Doc(`
Error: invalid Concierge parameters: endpoint must not be empty
`),
@@ -123,7 +134,8 @@ func TestLoginOIDCCommand(t *testing.T) {
"--issuer", "test-issuer",
"--ca-bundle", "./does/not/exist",
},
wantError: true,
wantOptions: defaultWantedOptions,
wantError: true,
wantStderr: here.Doc(`
Error: could not read --ca-bundle: open ./does/not/exist: no such file or directory
`),
@@ -135,7 +147,8 @@ func TestLoginOIDCCommand(t *testing.T) {
"--issuer", "test-issuer",
"--ca-bundle-data", "invalid-base64",
},
wantError: true,
wantOptions: defaultWantedOptions,
wantError: true,
wantStderr: here.Doc(`
Error: could not read --ca-bundle-data: illegal base64 data at input byte 7
`),
@@ -150,34 +163,12 @@ func TestLoginOIDCCommand(t *testing.T) {
"--concierge-authenticator-name", "test-authenticator",
"--concierge-endpoint", "https://127.0.0.1:1234/",
},
wantError: true,
wantOptions: defaultWantedOptions,
wantError: true,
wantStderr: here.Doc(`
Error: invalid Concierge parameters: invalid API group suffix: a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
`),
},
{
name: "invalid upstream type is an error",
args: []string{
"--issuer", "test-issuer",
"--upstream-identity-provider-type", "invalid",
},
wantError: true,
wantStderr: here.Doc(`
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory)
`),
},
{
name: "invalid upstream type when flow override env var is used is still an error",
args: []string{
"--issuer", "test-issuer",
"--upstream-identity-provider-type", "invalid",
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "browser_authcode"},
wantError: true,
wantStderr: here.Doc(`
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory)
`),
},
{
name: "oidc upstream type with default flow is allowed",
args: []string{
@@ -186,268 +177,57 @@ func TestLoginOIDCCommand(t *testing.T) {
"--upstream-identity-provider-type", "oidc",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptions: defaultWantedOptions,
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "oidc upstream type with CLI flow is allowed",
name: "PINNIPED_SKIP_PRINT_LOGIN_URL adds an option",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_SKIP_PRINT_LOGIN_URL": "true"},
wantOptions: func(f *mockoidcclientoptions.MockOIDCClientOptions) {
defaultWantedOptions(f)
f.EXPECT().WithSkipPrintLoginURL()
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "--upstream-identity-provider-flow adds an option",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "oidc upstream type with browser flow is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "oidc upstream type with CLI flow in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "cli_password"},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "oidc upstream type with with browser flow in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "browser_authcode"},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "oidc upstream type with unsupported flow is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--upstream-identity-provider-flow", "foobar",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantError: true,
wantStderr: here.Doc(`
Error: --upstream-identity-provider-flow value not recognized for identity provider type "oidc": foobar (supported values: browser_authcode, cli_password)
`),
},
{
name: "oidc upstream type with unsupported flow in flow override env var is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "oidc",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "foo"},
wantError: true,
wantStderr: here.Doc(`
Error: PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW value not recognized for identity provider type "oidc": foo (supported values: browser_authcode, cli_password)
`),
},
{
name: "ldap upstream type with default flow is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
wantOptions: func(f *mockoidcclientoptions.MockOIDCClientOptions) {
defaultWantedOptions(f)
f.EXPECT().WithLoginFlow(idpdiscoveryv1alpha1.IDPFlowCLIPassword, "--upstream-identity-provider-flow")
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "activedirectory upstream type with default flow is allowed",
name: "PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW adds an option that overrides --upstream-identity-provider-flow",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "ignored-value-from-param",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "actual-value-from-env"},
wantOptions: func(f *mockoidcclientoptions.MockOIDCClientOptions) {
defaultWantedOptions(f)
f.EXPECT().WithLoginFlow(idpdiscoveryv1alpha1.IDPFlow("actual-value-from-env"), "PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW")
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "ldap upstream type with CLI flow is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "ldap upstream type with browser_authcode flow is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "ldap upstream type with CLI flow in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "cli_password"},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "ldap upstream type with browser_authcode flow in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "browser_authcode"},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "ldap upstream type with unsupported flow is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "foo",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantError: true,
wantStderr: here.Doc(`
Error: --upstream-identity-provider-flow value not recognized for identity provider type "ldap": foo (supported values: cli_password, browser_authcode)
`),
},
{
name: "ldap upstream type with unsupported flow in flow override env var is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "foo"},
wantError: true,
wantStderr: here.Doc(`
Error: PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW value not recognized for identity provider type "ldap": foo (supported values: cli_password, browser_authcode)
`),
},
{
name: "active directory upstream type with CLI flow is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "active directory upstream type with browser_authcode is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "active directory upstream type with CLI flow in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "cli_password"},
wantOptionsCount: 5,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "active directory upstream type with browser_authcode in flow override env var is allowed",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "cli_password",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "browser_authcode"},
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
},
{
name: "active directory upstream type with unsupported flow is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "foo",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
wantError: true,
wantStderr: here.Doc(`
Error: --upstream-identity-provider-flow value not recognized for identity provider type "activedirectory": foo (supported values: cli_password, browser_authcode)
`),
},
{
name: "active directory upstream type with unsupported flow in flow override env var is an error",
args: []string{
"--issuer", "test-issuer",
"--client-id", "test-client-id",
"--upstream-identity-provider-type", "activedirectory",
"--upstream-identity-provider-flow", "browser_authcode",
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "foo"},
wantError: true,
wantStderr: here.Doc(`
Error: PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW value not recognized for identity provider type "activedirectory": foo (supported values: cli_password, browser_authcode)
`),
},
{
name: "login error",
args: []string{
@@ -456,6 +236,7 @@ func TestLoginOIDCCommand(t *testing.T) {
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
loginErr: fmt.Errorf("some login error"),
wantOptions: defaultWantedOptions,
wantOptionsCount: 4,
wantError: true,
wantStderr: here.Doc(`
@@ -474,6 +255,7 @@ func TestLoginOIDCCommand(t *testing.T) {
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
conciergeErr: fmt.Errorf("some concierge error"),
wantOptions: defaultWantedOptions,
wantOptionsCount: 4,
wantError: true,
wantStderr: here.Doc(`
@@ -488,11 +270,12 @@ func TestLoginOIDCCommand(t *testing.T) {
"--credential-cache", "", // must specify --credential-cache or else the cache file on disk causes test pollution
},
env: map[string]string{"PINNIPED_DEBUG": "true"},
wantOptions: defaultWantedOptions,
wantOptionsCount: 4,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"expirationTimestamp":"3020-10-12T13:14:15Z","token":"test-id-token"}}` + "\n",
wantLogs: []string{
nowStr + ` pinniped-login cmd/login_oidc.go:243 Performing OIDC login {"issuer": "test-issuer", "client id": "test-client-id"}`,
nowStr + ` pinniped-login cmd/login_oidc.go:263 No concierge configured, skipping token credential exchange`,
nowStr + ` cmd/login_oidc.go:268 Performing OIDC login {"issuer": "test-issuer", "client id": "test-client-id"}`,
nowStr + ` cmd/login_oidc.go:288 No concierge configured, skipping token credential exchange`,
},
},
{
@@ -513,31 +296,49 @@ func TestLoginOIDCCommand(t *testing.T) {
"--concierge-endpoint", "https://127.0.0.1:1234/",
"--concierge-ca-bundle-data", base64.StdEncoding.EncodeToString(testCA.Bundle()),
"--concierge-api-group-suffix", "some.suffix.com",
"--credential-cache", testutil.TempDir(t) + "/credentials.yaml", // must specify --credential-cache or else the cache file on disk causes test pollution
"--credential-cache", t.TempDir() + "/credentials.yaml", // must specify --credential-cache or else the cache file on disk causes test pollution
"--upstream-identity-provider-name", "some-upstream-name",
"--upstream-identity-provider-type", "ldap",
"--upstream-identity-provider-flow", "some-flow-type",
},
env: map[string]string{"PINNIPED_DEBUG": "true"},
wantOptionsCount: 11,
env: map[string]string{"PINNIPED_DEBUG": "true", "PINNIPED_SKIP_PRINT_LOGIN_URL": "true"},
wantOptions: func(f *mockoidcclientoptions.MockOIDCClientOptions) {
f.EXPECT().WithContext(gomock.Any())
f.EXPECT().WithLoginLogger(gomock.Any())
f.EXPECT().WithScopes([]string{oidcapi.ScopeOfflineAccess, oidcapi.ScopeOpenID, oidcapi.ScopeRequestAudience, oidcapi.ScopeUsername, oidcapi.ScopeGroups})
f.EXPECT().WithSessionCache(gomock.Any())
f.EXPECT().WithListenPort(uint16(1234))
f.EXPECT().WithSkipBrowserOpen()
f.EXPECT().WithSkipListen()
f.EXPECT().WithSkipPrintLoginURL()
f.EXPECT().WithClient(gomock.Any())
f.EXPECT().WithRequestAudience("cluster-1234")
f.EXPECT().WithLoginFlow(idpdiscoveryv1alpha1.IDPFlow("some-flow-type"), "--upstream-identity-provider-flow")
f.EXPECT().WithUpstreamIdentityProvider("some-upstream-name", "ldap")
},
wantOptionsCount: 12,
wantStdout: `{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1beta1","spec":{"interactive":false},"status":{"token":"exchanged-token"}}` + "\n",
wantLogs: []string{
nowStr + ` pinniped-login cmd/login_oidc.go:243 Performing OIDC login {"issuer": "test-issuer", "client id": "test-client-id"}`,
nowStr + ` pinniped-login cmd/login_oidc.go:253 Exchanging token for cluster credential {"endpoint": "https://127.0.0.1:1234/", "authenticator type": "webhook", "authenticator name": "test-authenticator"}`,
nowStr + ` pinniped-login cmd/login_oidc.go:261 Successfully exchanged token for cluster credential.`,
nowStr + ` pinniped-login cmd/login_oidc.go:268 caching cluster credential for future use.`,
nowStr + ` cmd/login_oidc.go:268 Performing OIDC login {"issuer": "test-issuer", "client id": "test-client-id"}`,
nowStr + ` cmd/login_oidc.go:278 Exchanging token for cluster credential {"endpoint": "https://127.0.0.1:1234/", "authenticator type": "webhook", "authenticator name": "test-authenticator"}`,
nowStr + ` cmd/login_oidc.go:286 Successfully exchanged token for cluster credential.`,
nowStr + ` cmd/login_oidc.go:293 caching cluster credential for future use.`,
},
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
var buf bytes.Buffer
fakeClock := clocktesting.NewFakeClock(now)
ctx := plog.TestZapOverrides(context.Background(), t, &buf, nil, zap.WithClock(plog.ZapClock(fakeClock)))
ctx := plog.AddZapOverridesToContext(context.Background(), t, &buf, nil, clocktesting.NewFakeClock(now))
var (
gotOptions []oidcclient.Option
)
ctrl := gomock.NewController(t)
t.Cleanup(ctrl.Finish)
optionsFactory := mockoidcclientoptions.NewMockOIDCClientOptions(ctrl)
if tt.wantOptions != nil {
tt.wantOptions(optionsFactory)
}
var gotOptions []oidcclient.Option
cmd := oidcLoginCommand(oidcLoginCommandDeps{
lookupEnv: func(s string) (string, bool) {
v, ok := tt.env[s]
@@ -572,6 +373,7 @@ func TestLoginOIDCCommand(t *testing.T) {
},
}, nil
},
optionsFactory: optionsFactory,
})
require.NotNil(t, cmd)
@@ -589,15 +391,7 @@ func TestLoginOIDCCommand(t *testing.T) {
require.Equal(t, tt.wantStderr, stderr.String(), "unexpected stderr")
require.Len(t, gotOptions, tt.wantOptionsCount)
require.Equal(t, tt.wantLogs, logLines(buf.String()))
require.Equal(t, tt.wantLogs, testutil.SplitByNewline(buf.String()))
})
}
}
func logLines(logs string) []string {
if len(logs) == 0 {
return nil
}
return strings.Split(strings.TrimSpace(logs), "\n")
}

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -86,7 +86,7 @@ func staticLoginCommand(deps staticLoginDeps) *cobra.Command {
cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", groupsuffix.PinnipedDefaultSuffix, "Concierge API group suffix")
cmd.Flags().StringVar(&flags.credentialCachePath, "credential-cache", filepath.Join(mustGetConfigDir(), "credentials.yaml"), "Path to cluster-specific credentials cache (\"\" disables the cache)")
cmd.RunE = func(cmd *cobra.Command, args []string) error { return runStaticLogin(cmd, deps, flags) }
cmd.RunE = func(cmd *cobra.Command, _args []string) error { return runStaticLogin(cmd, deps, flags) }
mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore")
mustMarkHidden(cmd, "concierge-namespace")
@@ -113,6 +113,7 @@ func runStaticLogin(cmd *cobra.Command, deps staticLoginDeps, flags staticLoginP
conciergeclient.WithBase64CABundle(flags.conciergeCABundle),
conciergeclient.WithAuthenticator(flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName),
conciergeclient.WithAPIGroupSuffix(flags.conciergeAPIGroupSuffix),
conciergeclient.WithTransportWrapper(LogAuditIDTransportWrapper),
)
if err != nil {
return fmt.Errorf("invalid Concierge parameters: %w", err)
@@ -133,7 +134,7 @@ func runStaticLogin(cmd *cobra.Command, deps staticLoginDeps, flags staticLoginP
return fmt.Errorf("--token-env variable %q is empty", flags.staticTokenEnvName)
}
}
cred := tokenCredential(&oidctypes.Token{IDToken: &oidctypes.IDToken{Token: token}})
cred := tokenCredential(&oidctypes.IDToken{Token: token})
// Look up cached credentials based on a hash of all the CLI arguments, the current token value, and the cluster info.
cacheKey := struct {

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -13,7 +13,6 @@ import (
"time"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientauthv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
clocktesting "k8s.io/utils/clock/testing"
@@ -30,7 +29,7 @@ func TestLoginStaticCommand(t *testing.T) {
testCA, err := certauthority.New("Test CA", 1*time.Hour)
require.NoError(t, err)
tmpdir := testutil.TempDir(t)
tmpdir := t.TempDir()
testCABundlePath := filepath.Join(tmpdir, "testca.pem")
require.NoError(t, os.WriteFile(testCABundlePath, testCA.Bundle(), 0600))
@@ -148,7 +147,7 @@ func TestLoginStaticCommand(t *testing.T) {
Error: could not complete Concierge credential exchange: some concierge error
`),
wantLogs: []string{
nowStr + ` pinniped-login cmd/login_static.go:159 exchanging static token for cluster credential {"endpoint": "https://127.0.0.1/", "authenticator type": "webhook", "authenticator name": "test-authenticator"}`,
nowStr + ` cmd/login_static.go:160 exchanging static token for cluster credential {"endpoint": "https://127.0.0.1/", "authenticator type": "webhook", "authenticator name": "test-authenticator"}`,
},
},
{
@@ -176,11 +175,9 @@ func TestLoginStaticCommand(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
var buf bytes.Buffer
fakeClock := clocktesting.NewFakeClock(now)
ctx := plog.TestZapOverrides(context.Background(), t, &buf, nil, zap.WithClock(plog.ZapClock(fakeClock)))
ctx := plog.AddZapOverridesToContext(context.Background(), t, &buf, nil, clocktesting.NewFakeClock(now))
cmd := staticLoginCommand(staticLoginDeps{
lookupEnv: func(s string) (string, bool) {
@@ -218,7 +215,7 @@ func TestLoginStaticCommand(t *testing.T) {
require.Equal(t, tt.wantStdout, stdout.String(), "unexpected stdout")
require.Equal(t, tt.wantStderr, stderr.String(), "unexpected stderr")
require.Equal(t, tt.wantLogs, logLines(buf.String()))
require.Equal(t, tt.wantLogs, testutil.SplitByNewline(buf.String()))
})
}
}

View File

@@ -0,0 +1,84 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"context"
"net/http"
"go.pinniped.dev/generated/latest/apis/supervisor/idpdiscovery/v1alpha1"
"go.pinniped.dev/pkg/oidcclient"
)
// OIDCClientOptions is an interface that wraps the creation of Options for the purpose of making them
// more friendly to unit tests. Because the Option type refers to a private struct type, it is hard
// to create mocks for them in tests of other packages. This provides a seam that can be mocked.
// No need for this interface to include deprecated options (such as WithLogger), since those should never be invoked.
type OIDCClientOptions interface {
WithContext(ctx context.Context) oidcclient.Option
WithLoginLogger(logger oidcclient.Logger) oidcclient.Option
WithListenPort(port uint16) oidcclient.Option
WithSkipBrowserOpen() oidcclient.Option
WithSkipListen() oidcclient.Option
WithSkipPrintLoginURL() oidcclient.Option
WithSessionCache(cache oidcclient.SessionCache) oidcclient.Option
WithClient(httpClient *http.Client) oidcclient.Option
WithScopes(scopes []string) oidcclient.Option
WithRequestAudience(audience string) oidcclient.Option
WithLoginFlow(loginFlow v1alpha1.IDPFlow, flowSource string) oidcclient.Option
WithUpstreamIdentityProvider(upstreamName, upstreamType string) oidcclient.Option
}
// clientOptions implements OIDCClientOptions for production use.
type clientOptions struct{}
var _ OIDCClientOptions = (*clientOptions)(nil)
func (o *clientOptions) WithContext(ctx context.Context) oidcclient.Option {
return oidcclient.WithContext(ctx)
}
func (o *clientOptions) WithLoginLogger(logger oidcclient.Logger) oidcclient.Option {
return oidcclient.WithLoginLogger(logger)
}
func (o *clientOptions) WithListenPort(port uint16) oidcclient.Option {
return oidcclient.WithListenPort(port)
}
func (o *clientOptions) WithSkipBrowserOpen() oidcclient.Option {
return oidcclient.WithSkipBrowserOpen()
}
func (o *clientOptions) WithSkipListen() oidcclient.Option {
return oidcclient.WithSkipListen()
}
func (o *clientOptions) WithSkipPrintLoginURL() oidcclient.Option {
return oidcclient.WithSkipPrintLoginURL()
}
func (o *clientOptions) WithSessionCache(cache oidcclient.SessionCache) oidcclient.Option {
return oidcclient.WithSessionCache(cache)
}
func (o *clientOptions) WithClient(httpClient *http.Client) oidcclient.Option {
return oidcclient.WithClient(httpClient)
}
func (o *clientOptions) WithScopes(scopes []string) oidcclient.Option {
return oidcclient.WithScopes(scopes)
}
func (o *clientOptions) WithRequestAudience(audience string) oidcclient.Option {
return oidcclient.WithRequestAudience(audience)
}
func (o *clientOptions) WithLoginFlow(loginFlow v1alpha1.IDPFlow, flowSource string) oidcclient.Option {
return oidcclient.WithLoginFlow(loginFlow, flowSource)
}
func (o *clientOptions) WithUpstreamIdentityProvider(upstreamName, upstreamType string) oidcclient.Option {
return oidcclient.WithUpstreamIdentityProvider(upstreamName, upstreamType)
}

View File

@@ -1,13 +1,16 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"encoding/json"
"fmt"
"github.com/spf13/cobra"
"k8s.io/component-base/version"
"sigs.k8s.io/yaml"
"go.pinniped.dev/internal/pversion"
)
//nolint:gochecknoinits
@@ -15,14 +18,44 @@ func init() {
rootCmd.AddCommand(newVersionCommand())
}
//nolint:gochecknoglobals
var (
output = new(string)
// getBuildInfo can be overwritten by tests.
getBuildInfo = pversion.Get
)
func newVersionCommand() *cobra.Command {
return &cobra.Command{
RunE: func(cmd *cobra.Command, _ []string) error {
fmt.Fprintf(cmd.OutOrStdout(), "%#v\n", version.Get())
return nil
},
c := &cobra.Command{
RunE: runner,
Args: cobra.NoArgs, // do not accept positional arguments for this command
Use: "version",
Short: "Print the version of this Pinniped CLI",
}
c.Flags().StringVarP(output, "output", "o", "", "one of 'yaml' or 'json'")
return c
}
func runner(cmd *cobra.Command, _ []string) error {
buildVersion := getBuildInfo()
switch {
case output == nil || *output == "":
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n", buildVersion.GitVersion)
case *output == "json":
bytes, err := json.MarshalIndent(buildVersion, "", " ")
if err != nil {
return err
}
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n", bytes)
case *output == "yaml":
bytes, err := yaml.Marshal(buildVersion)
if err != nil {
return err
}
_, _ = fmt.Fprint(cmd.OutOrStdout(), string(bytes))
default:
return fmt.Errorf("'%s' is not a valid option for output", *output)
}
return nil
}

View File

@@ -1,4 +1,4 @@
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -9,8 +9,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
apimachineryversion "k8s.io/apimachinery/pkg/version"
"go.pinniped.dev/internal/here"
"go.pinniped.dev/internal/pversion"
)
var (
@@ -19,8 +21,8 @@ var (
version \[flags\]
Flags:
-h, --help help for version
-h, --help help for version
-o, --output string one of 'yaml' or 'json'
`)
knownGoodHelpRegexpForVersion = here.Doc(`
@@ -30,24 +32,55 @@ var (
version \[flags\]
Flags:
-h, --help help for version
-h, --help help for version
-o, --output string one of 'yaml' or 'json'
`)
emptyVersionRegexp = `version.Info{Major:"", Minor:"", GitVersion:".*", GitCommit:".*", GitTreeState:"", BuildDate:".*", GoVersion:".*", Compiler:".*", Platform:".*/.*"}`
jsonRegexp = here.Doc(`{
"major": "\d*",
"minor": "\d*",
"gitVersion": "i am a version for json output",
"gitCommit": ".*",
"gitTreeState": ".*",
"buildDate": ".*",
"goVersion": ".*",
"compiler": ".*",
"platform": ".*/.*"
}`)
yamlRegexp = here.Doc(`buildDate: ".*"
compiler: .*
gitCommit: .*
gitTreeState: .*
gitVersion: i am a version for yaml output
goVersion: .*
major: "\d*"
minor: "\d*"
platform: .*/.*
`)
)
func TestNewVersionCmd(t *testing.T) {
t.Cleanup(func() {
getBuildInfo = pversion.Get
})
tests := []struct {
name string
args []string
vars string
getBuildInfo func() apimachineryversion.Info
wantError bool
wantStdoutRegexp string
wantStderrRegexp string
}{
{
name: "no flags",
args: []string{},
wantStdoutRegexp: emptyVersionRegexp + "\n",
name: "no flags",
args: []string{},
getBuildInfo: func() apimachineryversion.Info {
return apimachineryversion.Info{GitVersion: "v55.66.44"}
},
wantStdoutRegexp: "v55.66.44\n",
},
{
name: "help flag passed",
@@ -61,10 +94,43 @@ func TestNewVersionCmd(t *testing.T) {
wantStderrRegexp: `Error: unknown command "tuna" for "version"`,
wantStdoutRegexp: knownGoodUsageRegexpForVersion,
},
{
name: "json output",
args: []string{"--output", "json"},
getBuildInfo: func() apimachineryversion.Info {
return apimachineryversion.Info{
GitVersion: "i am a version for json output",
Platform: "a/b",
}
},
wantStdoutRegexp: jsonRegexp,
},
{
name: "yaml output",
args: []string{"--output", "yaml"},
getBuildInfo: func() apimachineryversion.Info {
return apimachineryversion.Info{
GitVersion: "i am a version for yaml output",
Platform: "c/d",
}
},
wantStdoutRegexp: yamlRegexp,
},
{
name: "incorrect output",
args: []string{"--output", "foo"},
wantError: true,
wantStderrRegexp: `Error: 'foo' is not a valid option for output`,
wantStdoutRegexp: knownGoodUsageRegexpForVersion,
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
if tt.getBuildInfo != nil {
getBuildInfo = tt.getBuildInfo
}
cmd := newVersionCommand()
require.NotNil(t, cmd)

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2023 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
@@ -12,7 +12,7 @@ import (
"time"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
@@ -24,13 +24,26 @@ import (
"go.pinniped.dev/internal/here"
)
type whoamiDeps struct {
getenv func(key string) string
getClientsets getClientsetsFunc
}
func whoamiRealDeps() whoamiDeps {
return whoamiDeps{
getenv: os.Getenv,
getClientsets: getRealClientsets,
}
}
//nolint:gochecknoinits
func init() {
rootCmd.AddCommand(newWhoamiCommand(getRealConciergeClientset))
rootCmd.AddCommand(newWhoamiCommand(whoamiRealDeps()))
}
type whoamiFlags struct {
outputFormat string // e.g., yaml, json, text
timeout time.Duration
kubeconfigPath string
kubeconfigContextOverride string
@@ -43,7 +56,7 @@ type clusterInfo struct {
url string
}
func newWhoamiCommand(getClientset getConciergeClientsetFunc) *cobra.Command {
func newWhoamiCommand(deps whoamiDeps) *cobra.Command {
cmd := &cobra.Command{
Args: cobra.NoArgs, // do not accept positional arguments for this command
Use: "whoami",
@@ -55,20 +68,21 @@ func newWhoamiCommand(getClientset getConciergeClientsetFunc) *cobra.Command {
// flags
f := cmd.Flags()
f.StringVarP(&flags.outputFormat, "output", "o", "text", "Output format (e.g., 'yaml', 'json', 'text')")
f.StringVar(&flags.kubeconfigPath, "kubeconfig", os.Getenv("KUBECONFIG"), "Path to kubeconfig file")
f.StringVar(&flags.kubeconfigPath, "kubeconfig", deps.getenv("KUBECONFIG"), "Path to kubeconfig file")
f.StringVar(&flags.kubeconfigContextOverride, "kubeconfig-context", "", "Kubeconfig context name (default: current active context)")
f.StringVar(&flags.apiGroupSuffix, "api-group-suffix", groupsuffix.PinnipedDefaultSuffix, "Concierge API group suffix")
f.DurationVar(&flags.timeout, "timeout", 0, "Timeout for the WhoAmI API request (default: 0, meaning no timeout)")
cmd.RunE = func(cmd *cobra.Command, _ []string) error {
return runWhoami(cmd.OutOrStdout(), getClientset, flags)
return runWhoami(cmd.OutOrStdout(), deps, flags)
}
return cmd
}
func runWhoami(output io.Writer, getClientset getConciergeClientsetFunc, flags *whoamiFlags) error {
func runWhoami(output io.Writer, deps whoamiDeps, flags *whoamiFlags) error {
clientConfig := newClientConfig(flags.kubeconfigPath, flags.kubeconfigContextOverride)
clientset, err := getClientset(clientConfig, flags.apiGroupSuffix)
conciergeClient, _, _, err := deps.getClientsets(clientConfig, flags.apiGroupSuffix)
if err != nil {
return fmt.Errorf("could not configure Kubernetes client: %w", err)
}
@@ -78,12 +92,26 @@ func runWhoami(output io.Writer, getClientset getConciergeClientsetFunc, flags *
return fmt.Errorf("could not get current cluster info: %w", err)
}
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*20)
defer cancelFunc()
whoAmI, err := clientset.IdentityV1alpha1().WhoAmIRequests().Create(ctx, &identityv1alpha1.WhoAmIRequest{}, metav1.CreateOptions{})
// Making the WhoAmI request may cause client-go to invoke the credential plugin, which may
// ask the user to interactively authenticate. The time that the user takes to authenticate
// is included in the timeout time, but their authentication is not cancelled by exceeding
// this timeout. Only the subsequent whoami API request is cancelled. Using a short timeout
// causes the odd behavior of a successful login immediately followed by a whoami request failure
// due to timeout. For comparison, kubectl uses an infinite timeout by default on API requests
// but also allows the user to adjust this timeout with the `--request-timeout` CLI option,
// so we will take a similar approach. Note that kubectl has the same behavior when a client-go
// credential plugin is invoked and the user takes longer then the timeout to authenticate.
ctx := context.Background()
if flags.timeout > 0 {
var cancelFunc context.CancelFunc
ctx, cancelFunc = context.WithTimeout(ctx, flags.timeout)
defer cancelFunc()
}
whoAmI, err := conciergeClient.IdentityV1alpha1().WhoAmIRequests().Create(ctx, &identityv1alpha1.WhoAmIRequest{}, metav1.CreateOptions{})
if err != nil {
hint := ""
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
hint = " (is the Pinniped WhoAmI API running and healthy?)"
}
return fmt.Errorf("could not complete WhoAmIRequest%s: %w", hint, err)

View File

@@ -1,29 +1,48 @@
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
// Copyright 2023-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"bytes"
"fmt"
"testing"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
kubetesting "k8s.io/client-go/testing"
"k8s.io/client-go/tools/clientcmd"
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
identityv1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/identity/v1alpha1"
conciergeclientset "go.pinniped.dev/generated/latest/client/concierge/clientset/versioned"
fakeconciergeclientset "go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/fake"
conciergefake "go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/fake"
"go.pinniped.dev/internal/constable"
"go.pinniped.dev/internal/here"
)
func TestWhoami(t *testing.T) {
helpOutputFormatString := here.Doc(`
Print information about the current user
Usage:
whoami [flags]
Flags:
--api-group-suffix string Concierge API group suffix (default "pinniped.dev")
-h, --help help for whoami
--kubeconfig string Path to kubeconfig file%s
--kubeconfig-context string Kubeconfig context name (default: current active context)
-o, --output string Output format (e.g., 'yaml', 'json', 'text') (default "text")
--timeout duration Timeout for the WhoAmI API request (default: 0, meaning no timeout)
`)
tests := []struct {
name string
args []string
env map[string]string
groupsOverride []string
gettingClientsetErr error
callingAPIErr error
@@ -31,21 +50,17 @@ func TestWhoami(t *testing.T) {
wantStdout, wantStderr string
}{
{
name: "help flag",
args: []string{"--help"},
wantStdout: here.Doc(`
Print information about the current user
Usage:
whoami [flags]
Flags:
--api-group-suffix string Concierge API group suffix (default "pinniped.dev")
-h, --help help for whoami
--kubeconfig string Path to kubeconfig file
--kubeconfig-context string Kubeconfig context name (default: current active context)
-o, --output string Output format (e.g., 'yaml', 'json', 'text') (default "text")
`),
name: "help flag passed",
args: []string{"--help"},
wantStdout: fmt.Sprintf(helpOutputFormatString, ""),
},
{
name: "help flag passed with KUBECONFIG env var set",
env: map[string]string{
"KUBECONFIG": "/path/to/kubeconfig",
},
args: []string{"--help"},
wantStdout: fmt.Sprintf(helpOutputFormatString, ` (default "/path/to/kubeconfig")`),
},
{
name: "text output",
@@ -106,8 +121,7 @@ func TestWhoami(t *testing.T) {
Current user info:
Username: some-username
Groups:
`),
Groups:` + " \n"), // Linters and codeformatters don't like the extra space after "Groups:" and before the newline
},
{
name: "json output",
@@ -116,9 +130,7 @@ func TestWhoami(t *testing.T) {
{
"kind": "WhoAmIRequest",
"apiVersion": "identity.concierge.pinniped.dev/v1alpha1",
"metadata": {
"creationTimestamp": null
},
"metadata": {},
"spec": {},
"status": {
"kubernetesUserInfo": {
@@ -140,9 +152,7 @@ func TestWhoami(t *testing.T) {
{
"kind": "WhoAmIRequest",
"apiVersion": "identity.concierge.tuna.io/v1alpha1",
"metadata": {
"creationTimestamp": null
},
"metadata": {},
"spec": {},
"status": {
"kubernetesUserInfo": {
@@ -163,8 +173,7 @@ func TestWhoami(t *testing.T) {
wantStdout: here.Doc(`
apiVersion: identity.concierge.pinniped.dev/v1alpha1
kind: WhoAmIRequest
metadata:
creationTimestamp: null
metadata: {}
spec: {}
status:
kubernetesUserInfo:
@@ -181,8 +190,7 @@ func TestWhoami(t *testing.T) {
wantStdout: here.Doc(`
apiVersion: identity.concierge.tuna.io/v1alpha1
kind: WhoAmIRequest
metadata:
creationTimestamp: null
metadata: {}
spec: {}
status:
kubernetesUserInfo:
@@ -273,20 +281,21 @@ func TestWhoami(t *testing.T) {
},
{
name: "calling API fails because WhoAmI API is not installed",
callingAPIErr: errors.NewNotFound(identityv1alpha1.SchemeGroupVersion.WithResource("whoamirequests").GroupResource(), "whatever"),
callingAPIErr: apierrors.NewNotFound(identityv1alpha1.SchemeGroupVersion.WithResource("whoamirequests").GroupResource(), "whatever"),
wantError: true,
wantStderr: "Error: could not complete WhoAmIRequest (is the Pinniped WhoAmI API running and healthy?): whoamirequests.identity.concierge.pinniped.dev \"whatever\" not found\n",
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
getClientset := func(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, error) {
getClientsetFunc := func(clientConfig clientcmd.ClientConfig, apiGroupSuffix string) (conciergeclientset.Interface, kubernetes.Interface, aggregatorclient.Interface, error) {
if test.gettingClientsetErr != nil {
return nil, test.gettingClientsetErr
return nil, nil, nil, test.gettingClientsetErr
}
clientset := fakeconciergeclientset.NewSimpleClientset()
clientset.PrependReactor("create", "whoamirequests", func(_ kubetesting.Action) (bool, runtime.Object, error) {
//nolint:staticcheck // our codegen does not yet generate a NewClientset() function
conciergeClient := conciergefake.NewSimpleClientset()
conciergeClient.PrependReactor("create", "whoamirequests", func(_ kubetesting.Action) (bool, runtime.Object, error) {
if test.callingAPIErr != nil {
return true, nil, test.callingAPIErr
}
@@ -305,14 +314,25 @@ func TestWhoami(t *testing.T) {
},
}, nil
})
return clientset, nil
return conciergeClient, nil, nil, nil
}
cmd := newWhoamiCommand(getClientset)
cmd := newWhoamiCommand(whoamiDeps{
getenv: func(key string) string {
return test.env[key]
},
getClientsets: getClientsetFunc,
})
stdout, stderr := bytes.NewBuffer([]byte{}), bytes.NewBuffer([]byte{})
cmd.SetOut(stdout)
cmd.SetErr(stderr)
cmd.SetArgs(test.args)
if test.args == nil {
// cobra uses os.Args[1:] when SetArgs is called with nil, so avoid using nil for tests.
cmd.SetArgs([]string{})
} else {
cmd.SetArgs(test.args)
}
err := cmd.Execute()
if test.wantError {

View File

@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.20.0
name: jwtauthenticators.authentication.concierge.pinniped.dev
spec:
group: authentication.concierge.pinniped.dev
@@ -26,108 +25,366 @@ spec:
- jsonPath: .spec.audience
name: Audience
type: string
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: "JWTAuthenticator describes the configuration of a JWT authenticator.
\n Upon receiving a signed JWT, a JWTAuthenticator will performs some validation
on it (e.g., valid signature, existence of claims, etc.) and extract the
username and groups from the token."
description: |-
JWTAuthenticator describes the configuration of a JWT authenticator.
Upon receiving a signed JWT, a JWTAuthenticator will performs some validation on it (e.g., valid
signature, existence of claims, etc.) and extract the username and groups from the token.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: Spec for configuring the authenticator.
description: spec for configuring the authenticator.
properties:
audience:
description: Audience is the required value of the "aud" JWT claim.
description: audience is the required value of the "aud" JWT claim.
minLength: 1
type: string
claimValidationRules:
description: |-
claimValidationRules are rules that are applied to validate token claims to authenticate users.
This is similar to claimValidationRules from Kubernetes AuthenticationConfiguration as documented in
https://kubernetes.io/docs/reference/access-authn-authz/authentication.
This is an advanced configuration option. During an end-user login flow, mistakes in this
configuration will cause the user's login to fail.
items:
description: ClaimValidationRule provides the configuration for
a single claim validation rule.
properties:
claim:
description: |-
claim is the name of a required claim.
Only string claim keys are supported.
Mutually exclusive with expression and message.
type: string
expression:
description: |-
expression represents the expression which will be evaluated by CEL.
Must produce a boolean.
CEL expressions have access to the contents of the token claims, organized into CEL variable:
- 'claims' is a map of claim names to claim values.
For example, a variable named 'sub' can be accessed as 'claims.sub'.
Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
Must return true for the validation to pass.
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
Mutually exclusive with claim and requiredValue.
type: string
message:
description: |-
message customizes the returned error message when expression returns false.
message is a literal string.
Mutually exclusive with claim and requiredValue.
type: string
requiredValue:
description: |-
requiredValue is the value of a required claim.
Only string claim values are supported.
If claim is set and requiredValue is not set, the claim must be present with a value set to the empty string.
Mutually exclusive with expression and message.
type: string
type: object
type: array
claims:
description: Claims allows customization of the claims that will be
mapped to user identity for Kubernetes access.
description: |-
claims allows customization of the claims that will be mapped to user identity
for Kubernetes access.
properties:
extra:
description: |-
extra is similar to claimMappings.extra from Kubernetes AuthenticationConfiguration
as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
However, note that the Pinniped Concierge issues client certificates to users for the purpose
of authenticating, and the Kubernetes API server does not have any mechanism for transmitting
auth extras via client certificates. When configured, these extras will appear in client
certificates issued by the Pinniped Supervisor in the x509 Subject field as Organizational
Units (OU). However, when this client certificate is presented to Kubernetes for authentication,
Kubernetes will ignore these extras. This is probably only useful if you are using a custom
authenticating proxy in front of your Kubernetes API server which can translate these OUs into
auth extras, as described by
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authenticating-proxy.
This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
must evaluate to either a string or an array of strings, or else the user's login will fail.
These keys must be a domain-prefixed path (such as "acme.io/foo") and must not contain an equals sign ("=").
expression must produce a string or string array value.
If the value is empty, the extra mapping will not be present.
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
hard-coded extra key/value
- key: "acme.io/foo"
valueExpression: "'bar'"
This will result in an extra attribute - acme.io/foo: ["bar"]
hard-coded key, value copying claim value
- key: "acme.io/foo"
valueExpression: "claims.some_claim"
This will result in an extra attribute - acme.io/foo: [value of some_claim]
hard-coded key, value derived from claim value
- key: "acme.io/admin"
valueExpression: '(has(claims.is_admin) && claims.is_admin) ? "true":""'
This will result in:
- if is_admin claim is present and true, extra attribute - acme.io/admin: ["true"]
- if is_admin claim is present and false or is_admin claim is not present, no extra attribute will be added
items:
description: ExtraMapping provides the configuration for a single
extra mapping.
properties:
key:
description: |-
key is a string to use as the extra attribute key.
key must be a domain-prefix path (e.g. example.org/foo). All characters before the first "/" must be a valid
subdomain as defined by RFC 1123. All characters trailing the first "/" must
be valid HTTP Path characters as defined by RFC 3986.
key must be lowercase.
Required to be unique.
Additionally, the key must not contain an equals sign ("=").
type: string
valueExpression:
description: |-
valueExpression is a CEL expression to extract extra attribute value.
valueExpression must produce a string or string array value.
"", [], and null values are treated as the extra mapping not being present.
Empty string values contained within a string array are filtered out.
CEL expressions have access to the contents of the token claims, organized into CEL variable:
- 'claims' is a map of claim names to claim values.
For example, a variable named 'sub' can be accessed as 'claims.sub'.
Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
type: string
required:
- key
- valueExpression
type: object
type: array
groups:
description: Groups is the name of the claim which should be read
to extract the user's group membership from the JWT token. When
not specified, it will default to "groups".
description: |-
groups is the name of the claim which should be read to extract the user's
group membership from the JWT token. When not specified, it will default to "groups",
unless groupsExpression is specified.
Mutually exclusive with groupsExpression. Use either groups or groupsExpression to
determine the user's group membership from the JWT token.
type: string
groupsExpression:
description: |-
groupsExpression represents an expression which will be evaluated by CEL.
The expression's result will become the user's group memberships.
groupsExpression is similar to claimMappings.groups.expression from Kubernetes AuthenticationConfiguration
as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
must evaluate to one of the expected types without errors, or else the user's login will fail.
Additionally, mistakes in this configuration can cause the users to have unintended group memberships.
The expression must produce a string or string array value.
"", [], and null values are treated as the group mapping not being present.
CEL expressions have access to the contents of the token claims, organized into CEL variable:
- 'claims' is a map of claim names to claim values.
For example, a variable named 'sub' can be accessed as 'claims.sub'.
Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
Mutually exclusive with groups. Use either groups or groupsExpression to
determine the user's group membership from the JWT token.
type: string
username:
description: Username is the name of the claim which should be
read to extract the username from the JWT token. When not specified,
it will default to "username".
description: |-
username is the name of the claim which should be read to extract the
username from the JWT token. When not specified, it will default to "username",
unless usernameExpression is specified.
Mutually exclusive with usernameExpression. Use either username or usernameExpression to
determine the user's username from the JWT token.
type: string
usernameExpression:
description: |-
usernameExpression represents an expression which will be evaluated by CEL.
The expression's result will become the user's username.
usernameExpression is similar to claimMappings.username.expression from Kubernetes AuthenticationConfiguration
as documented in https://kubernetes.io/docs/reference/access-authn-authz/authentication.
This is an advanced configuration option. During an end-user login flow, each of these CEL expressions
must evaluate to the expected type without errors, or else the user's login will fail.
Additionally, mistakes in this configuration can cause the users to have unintended usernames.
The expression must produce a non-empty string value.
If the expression uses 'claims.email', then 'claims.email_verified' must be used in
the expression or extra[*].valueExpression or claimValidationRules[*].expression.
An example claim validation rule expression that matches the validation automatically
applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true) == true'.
By explicitly comparing the value to true, we let type-checking see the result will be a boolean,
and to make sure a non-boolean email_verified claim will be caught at runtime.
CEL expressions have access to the contents of the token claims, organized into CEL variable:
- 'claims' is a map of claim names to claim values.
For example, a variable named 'sub' can be accessed as 'claims.sub'.
Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
Mutually exclusive with username. Use either username or usernameExpression to
determine the user's username from the JWT token.
type: string
type: object
issuer:
description: Issuer is the OIDC issuer URL that will be used to discover
public signing keys. Issuer is also used to validate the "iss" JWT
claim.
description: |-
issuer is the OIDC issuer URL that will be used to discover public signing keys. Issuer is
also used to validate the "iss" JWT claim.
minLength: 1
pattern: ^https://
type: string
tls:
description: TLS configuration for communicating with the OIDC provider.
description: tls is the configuration for communicating with the OIDC
provider via TLS.
properties:
certificateAuthorityData:
description: X.509 Certificate Authority (base64-encoded PEM bundle).
If omitted, a default set of system roots will be trusted.
type: string
certificateAuthorityDataSource:
description: |-
Reference to a CA bundle in a secret or a configmap.
Any changes to the CA bundle in the secret or configmap will be dynamically reloaded.
properties:
key:
description: |-
Key is the key name within the secret or configmap from which to read the CA bundle.
The value found at this key in the secret or configmap must not be empty, and must be a valid PEM-encoded
certificate bundle.
minLength: 1
type: string
kind:
description: |-
Kind configures whether the CA bundle is being sourced from a Kubernetes secret or a configmap.
Allowed values are "Secret" or "ConfigMap".
"ConfigMap" uses a Kubernetes configmap to source CA Bundles.
"Secret" uses Kubernetes secrets of type kubernetes.io/tls or Opaque to source CA Bundles.
enum:
- Secret
- ConfigMap
type: string
name:
description: |-
Name is the resource name of the secret or configmap from which to read the CA bundle.
The referenced secret or configmap must be created in the same namespace where Pinniped Concierge is installed.
minLength: 1
type: string
required:
- key
- kind
- name
type: object
type: object
userValidationRules:
description: |-
userValidationRules are rules that are applied to final user before completing authentication.
These allow invariants to be applied to incoming identities such as preventing the
use of the system: prefix that is commonly used by Kubernetes components.
The validation rules are logically ANDed together and must all return true for the validation to pass.
This is similar to claimValidationRules from Kubernetes AuthenticationConfiguration as documented in
https://kubernetes.io/docs/reference/access-authn-authz/authentication.
This is an advanced configuration option. During an end-user login flow, mistakes in this
configuration will cause the user's login to fail.
items:
description: UserValidationRule provides the configuration for a
single user info validation rule.
properties:
expression:
description: |-
expression represents the expression which will be evaluated by CEL.
Must return true for the validation to pass.
CEL expressions have access to the contents of UserInfo, organized into CEL variable:
- 'user' - authentication.k8s.io/v1, Kind=UserInfo object
Refer to https://github.com/kubernetes/api/blob/release-1.28/authentication/v1/types.go#L105-L122 for the definition.
API documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#userinfo-v1-authentication-k8s-io
Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
type: string
message:
description: |-
message customizes the returned error message when rule returns false.
message is a literal string.
type: string
required:
- expression
type: object
type: array
required:
- audience
- issuer
type: object
status:
description: Status of the authenticator.
description: status of the authenticator.
properties:
conditions:
description: Represents the observations of the authenticator's current
state.
items:
description: Condition status of a resource (mirrored from the metav1.Condition
type added in Kubernetes 1.19). In a future API version we can
switch to using the upstream type. See https://github.com/kubernetes/apimachinery/blob/v0.19.0/pkg/apis/meta/v1/types.go#L1353-L1413.
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
@@ -142,10 +399,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -160,6 +413,14 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
phase:
default: Pending
description: Phase summarizes the overall status of the JWTAuthenticator.
enum:
- Pending
- Ready
- Error
type: string
type: object
required:
- spec
@@ -168,9 +429,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.20.0
name: webhookauthenticators.authentication.concierge.pinniped.dev
spec:
group: authentication.concierge.pinniped.dev
@@ -23,6 +22,9 @@ spec:
- jsonPath: .spec.endpoint
name: Endpoint
type: string
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
@@ -33,14 +35,19 @@ spec:
authenticator.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -59,6 +66,39 @@ spec:
description: X.509 Certificate Authority (base64-encoded PEM bundle).
If omitted, a default set of system roots will be trusted.
type: string
certificateAuthorityDataSource:
description: |-
Reference to a CA bundle in a secret or a configmap.
Any changes to the CA bundle in the secret or configmap will be dynamically reloaded.
properties:
key:
description: |-
Key is the key name within the secret or configmap from which to read the CA bundle.
The value found at this key in the secret or configmap must not be empty, and must be a valid PEM-encoded
certificate bundle.
minLength: 1
type: string
kind:
description: |-
Kind configures whether the CA bundle is being sourced from a Kubernetes secret or a configmap.
Allowed values are "Secret" or "ConfigMap".
"ConfigMap" uses a Kubernetes configmap to source CA Bundles.
"Secret" uses Kubernetes secrets of type kubernetes.io/tls or Opaque to source CA Bundles.
enum:
- Secret
- ConfigMap
type: string
name:
description: |-
Name is the resource name of the secret or configmap from which to read the CA bundle.
The referenced secret or configmap must be created in the same namespace where Pinniped Concierge is installed.
minLength: 1
type: string
required:
- key
- kind
- name
type: object
type: object
required:
- endpoint
@@ -70,37 +110,35 @@ spec:
description: Represents the observations of the authenticator's current
state.
items:
description: Condition status of a resource (mirrored from the metav1.Condition
type added in Kubernetes 1.19). In a future API version we can
switch to using the upstream type. See https://github.com/kubernetes/apimachinery/blob/v0.19.0/pkg/apis/meta/v1/types.go#L1353-L1413.
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
@@ -115,10 +153,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -133,6 +167,14 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
phase:
default: Pending
description: Phase summarizes the overall status of the WebhookAuthenticator.
enum:
- Pending
- Ready
- Error
type: string
type: object
required:
- spec
@@ -141,9 +183,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.20.0
name: credentialissuers.config.concierge.pinniped.dev
spec:
group: config.concierge.pinniped.dev
@@ -34,14 +33,19 @@ spec:
Pinniped Concierge credential issuer.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -53,18 +57,18 @@ spec:
of the Concierge impersonation proxy.
properties:
externalEndpoint:
description: "ExternalEndpoint describes the HTTPS endpoint where
the proxy will be exposed. If not set, the proxy will be served
using the external name of the LoadBalancer service or the cluster
service DNS name. \n This field must be non-empty when spec.impersonationProxy.service.type
is \"None\"."
description: |-
ExternalEndpoint describes the HTTPS endpoint where the proxy will be exposed. If not set, the proxy will
be served using the external name of the LoadBalancer service or the cluster service DNS name.
This field must be non-empty when spec.impersonationProxy.service.type is "None".
type: string
mode:
description: 'Mode configures whether the impersonation proxy
should be started: - "disabled" explicitly disables the impersonation
proxy. This is the default. - "enabled" explicitly enables the
impersonation proxy. - "auto" enables or disables the impersonation
proxy based upon the cluster in which it is running.'
description: |-
Mode configures whether the impersonation proxy should be started:
- "disabled" explicitly disables the impersonation proxy. This is the default.
- "enabled" explicitly enables the impersonation proxy.
- "auto" enables or disables the impersonation proxy based upon the cluster in which it is running.
enum:
- auto
- enabled
@@ -83,26 +87,43 @@ spec:
pairs to set as annotations on the provisioned Service.
type: object
loadBalancerIP:
description: LoadBalancerIP specifies the IP address to set
in the spec.loadBalancerIP field of the provisioned Service.
description: |-
LoadBalancerIP specifies the IP address to set in the spec.loadBalancerIP field of the provisioned Service.
This is not supported on all cloud providers.
maxLength: 255
minLength: 1
type: string
type:
default: LoadBalancer
description: "Type specifies the type of Service to provision
for the impersonation proxy. \n If the type is \"None\",
then the \"spec.impersonationProxy.externalEndpoint\" field
must be set to a non-empty value so that the Concierge can
properly advertise the endpoint in the CredentialIssuer's
status."
description: |-
Type specifies the type of Service to provision for the impersonation proxy.
If the type is "None", then the "spec.impersonationProxy.externalEndpoint" field must be set to a non-empty
value so that the Concierge can properly advertise the endpoint in the CredentialIssuer's status.
enum:
- LoadBalancer
- ClusterIP
- None
type: string
type: object
tls:
description: |-
TLS contains information about how the Concierge impersonation proxy should serve TLS.
If this field is empty, the impersonation proxy will generate its own TLS certificate.
properties:
certificateAuthorityData:
description: |-
X.509 Certificate Authority (base64-encoded PEM bundle).
Used to advertise the CA bundle for the impersonation proxy endpoint.
type: string
secretName:
description: |-
SecretName is the name of a Secret in the same namespace, of type `kubernetes.io/tls`, which contains
the TLS serving certificate for the Concierge impersonation proxy endpoint.
minLength: 1
type: string
type: object
required:
- mode
- service
@@ -113,24 +134,6 @@ spec:
status:
description: CredentialIssuerStatus describes the status of the Concierge.
properties:
kubeConfigInfo:
description: Information needed to form a valid Pinniped-based kubeconfig
using this credential issuer. This field is deprecated and will
be removed in a future version.
properties:
certificateAuthorityData:
description: The K8s API server CA bundle.
minLength: 1
type: string
server:
description: The K8s API server URL.
minLength: 1
pattern: ^https://|^http://
type: string
required:
- certificateAuthorityData
- server
type: object
strategies:
description: List of integration strategies that were attempted by
Pinniped.
@@ -143,9 +146,9 @@ spec:
this strategy.
properties:
impersonationProxyInfo:
description: ImpersonationProxyInfo describes the parameters
for the impersonation proxy on this Concierge. This field
is only set when Type is "ImpersonationProxy".
description: |-
ImpersonationProxyInfo describes the parameters for the impersonation proxy on this Concierge.
This field is only set when Type is "ImpersonationProxy".
properties:
certificateAuthorityData:
description: CertificateAuthorityData is the base64-encoded
@@ -163,9 +166,9 @@ spec:
- endpoint
type: object
tokenCredentialRequestInfo:
description: TokenCredentialRequestAPIInfo describes the
parameters for the TokenCredentialRequest API on this
Concierge. This field is only set when Type is "TokenCredentialRequestAPI".
description: |-
TokenCredentialRequestAPIInfo describes the parameters for the TokenCredentialRequest API on this Concierge.
This field is only set when Type is "TokenCredentialRequestAPI".
properties:
certificateAuthorityData:
description: CertificateAuthorityData is the base64-encoded
@@ -238,9 +241,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,9 +1,18 @@
#! Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@ load("@ytt:data", "data")
#@ load("@ytt:json", "json")
#@ load("helpers.lib.yaml", "defaultLabel", "labels", "deploymentPodLabel", "namespace", "defaultResourceName", "defaultResourceNameWithSuffix", "getAndValidateLogLevel", "pinnipedDevAPIGroupWithPrefix")
#@ load("helpers.lib.yaml",
#@ "defaultLabel",
#@ "labels",
#@ "deploymentPodLabel",
#@ "namespace",
#@ "defaultResourceName",
#@ "defaultResourceNameWithSuffix",
#@ "getAndValidateLogLevel",
#@ "pinnipedDevAPIGroupWithPrefix",
#@ )
#@ load("@ytt:template", "template")
#@ if not data.values.into_namespace:
@@ -45,8 +54,9 @@ metadata:
annotations:
#! we need to create this service account before we create the secret
kapp.k14s.io/change-group: "impersonation-proxy.concierge.pinniped.dev/serviceaccount"
secrets: #! make sure the token controller does not create any other secrets
- name: #@ defaultResourceNameWithSuffix("impersonation-proxy")
kubernetes.io/enforce-mountable-secrets: "true"
secrets: [] #! make sure the token controller does not create any secrets
automountServiceAccountToken: false
---
apiVersion: v1
kind: ConfigMap
@@ -67,6 +77,7 @@ data:
apiGroupSuffix: (@= data.values.api_group_suffix @)
# aggregatedAPIServerPort may be set here, although other YAML references to the default port (10250) may also need to be updated
# impersonationProxyServerPort may be set here, although other YAML references to the default port (8444) may also need to be updated
aggregatedAPIServerDisableAdmissionPlugins: []
names:
servingCertificateSecret: (@= defaultResourceNameWithSuffix("api-tls-serving-certificate") @)
credentialIssuer: (@= defaultResourceNameWithSuffix("config") @)
@@ -77,9 +88,12 @@ data:
impersonationCACertificateSecret: (@= defaultResourceNameWithSuffix("impersonation-proxy-ca-certificate") @)
impersonationSignerSecret: (@= defaultResourceNameWithSuffix("impersonation-proxy-signer-ca-certificate") @)
agentServiceAccount: (@= defaultResourceNameWithSuffix("kube-cert-agent") @)
impersonationProxyServiceAccount: (@= defaultResourceNameWithSuffix("impersonation-proxy") @)
impersonationProxyLegacySecret: (@= defaultResourceNameWithSuffix("impersonation-proxy") @)
labels: (@= json.encode(labels()).rstrip() @)
kubeCertAgent:
namePrefix: (@= defaultResourceNameWithSuffix("kube-cert-agent-") @)
priorityClassName: (@= data.values.kube_cert_agent_priority_class_name @)
(@ if data.values.kube_cert_agent_image: @)
image: (@= data.values.kube_cert_agent_image @)
(@ else: @)
@@ -91,17 +105,17 @@ data:
(@ end @)
(@ if data.values.image_pull_dockerconfigjson: @)
imagePullSecrets:
- image-pull-secret
- image-pull-secret
(@ end @)
(@ if data.values.log_level or data.values.deprecated_log_format: @)
(@ if data.values.log_level: @)
log:
(@ if data.values.log_level: @)
level: (@= getAndValidateLogLevel() @)
(@ end @)
(@ if data.values.deprecated_log_format: @)
format: (@= data.values.deprecated_log_format @)
(@ end @)
(@ end @)
tls:
onedottwo:
allowedCiphers: (@= str(data.values.allowed_ciphers_for_tls_onedottwo) @)
audit:
logUsernamesAndGroups: (@= data.values.audit.log_usernames_and_groups @)
---
#@ if data.values.image_pull_dockerconfigjson and data.values.image_pull_dockerconfigjson != "":
apiVersion: v1
@@ -134,8 +148,6 @@ spec:
#! More recently added the more unique deploymentPodLabel() so Services can select these Pods more specifically
#! without accidentally selecting any other Deployment's Pods, especially the kube cert agent Deployment's Pods.
_: #@ template.replace(deploymentPodLabel())
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
spec:
securityContext:
runAsUser: #@ data.values.run_as_user
@@ -184,9 +196,6 @@ spec:
- name: podinfo
mountPath: /etc/podinfo
readOnly: true
- name: impersonation-proxy
mountPath: /var/run/secrets/impersonation-proxy.concierge.pinniped.dev/serviceaccount
readOnly: true
env:
#@ if data.values.https_proxy:
- name: HTTPS_PROXY
@@ -222,12 +231,6 @@ spec:
- name: config-volume
configMap:
name: #@ defaultResourceNameWithSuffix("config")
- name: impersonation-proxy
secret:
secretName: #@ defaultResourceNameWithSuffix("impersonation-proxy")
items: #! make sure our pod does not start until the token controller has a chance to populate the secret
- key: token
path: token
- name: podinfo
downwardAPI:
items:
@@ -247,9 +250,14 @@ spec:
effect: NoSchedule
- key: node-role.kubernetes.io/control-plane #! The new name for these nodes as of Kubernetes 1.24.
effect: NoSchedule
#! "system-cluster-critical" cannot be used outside the kube-system namespace until Kubernetes >= 1.17,
#! so we skip setting this for now (see https://github.com/kubernetes/kubernetes/issues/60596).
#!priorityClassName: system-cluster-critical
- key: kubernetes.io/arch
effect: NoSchedule
operator: Equal
value: amd64 #! Allow running on amd64 nodes.
- key: kubernetes.io/arch
effect: NoSchedule
operator: Equal
value: arm64 #! Also allow running on arm64 nodes.
#! This will help make sure our multiple pods run on different nodes, making
#! our deployment "more" "HA".
affinity:
@@ -344,17 +352,9 @@ spec:
#@ if data.values.impersonation_proxy_spec.service.load_balancer_ip:
loadBalancerIP: #@ data.values.impersonation_proxy_spec.service.load_balancer_ip
#@ end
#@ if data.values.impersonation_proxy_spec.service.annotations == None:
annotations:
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "4000"
#@ else:
annotations: #@ data.values.impersonation_proxy_spec.service.annotations
---
apiVersion: v1
kind: Secret
metadata:
name: #@ defaultResourceNameWithSuffix("impersonation-proxy")
namespace: #@ namespace()
labels: #@ labels()
annotations:
#! wait until the SA exists to create this secret so that the token controller does not delete it
#! we have this secret at the end so that kubectl will create the service account first
kapp.k14s.io/change-rule: "upsert after upserting impersonation-proxy.concierge.pinniped.dev/serviceaccount"
kubernetes.io/service-account.name: #@ defaultResourceNameWithSuffix("impersonation-proxy")
type: kubernetes.io/service-account-token
#@ end

View File

@@ -1,4 +1,4 @@
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@ load("@ytt:data", "data")

View File

@@ -1,4 +1,4 @@
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@ load("@ytt:data", "data")
@@ -19,7 +19,7 @@ rules:
resources: [ apiservices ]
verbs: [ get, list, patch, update, watch ]
- apiGroups: [ admissionregistration.k8s.io ]
resources: [ validatingwebhookconfigurations, mutatingwebhookconfigurations ]
resources: [ validatingwebhookconfigurations, mutatingwebhookconfigurations, validatingadmissionpolicies, validatingadmissionpolicybindings ]
verbs: [ get, list, watch ]
- apiGroups: [ flowcontrol.apiserver.k8s.io ]
resources: [ flowschemas, prioritylevelconfigurations ]
@@ -43,6 +43,10 @@ rules:
- #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge")
resources: [ jwtauthenticators, webhookauthenticators ]
verbs: [ get, list, watch ]
- apiGroups:
- #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge")
resources: [ jwtauthenticators/status, webhookauthenticators/status ]
verbs: [ get, list, watch, update ]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
@@ -156,6 +160,13 @@ rules:
- apiGroups: [ coordination.k8s.io ]
resources: [ leases ]
verbs: [ create, get, update ]
#! We need to be able to get service accounts and create serviceaccounts/tokens so that we can create short-lived tokens for the impersonation proxy
- apiGroups: [""]
resources: [ serviceaccounts ]
verbs: [ get ]
- apiGroups: [""]
resources: [ serviceaccounts/token ]
verbs: [ create ]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1

View File

@@ -1,107 +1,254 @@
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@data/values
---
#@ def validate_strings_map(obj):
#@ # Returns True if obj is an associative data structure string→string, and False otherwise.
#@ for key in obj:
#@ if type(key) != "string" or type(obj[key]) != "string":
#@ return False
#@ end
#@ end
#@ return True
#@ end
#@data/values-schema
---
#@schema/title "App name"
#@schema/desc "Used to help determine the names of various resources and labels."
#@schema/validation min_len=1
app_name: pinniped-concierge
#! Creates a new namespace statically in yaml with the given name and installs the app into that namespace.
#@schema/title "Namespace"
#@schema/desc "Creates a new namespace statically in yaml with the given name and installs the app into that namespace."
#@schema/validation min_len=1
namespace: pinniped-concierge
#! If specified, assumes that a namespace of the given name already exists and installs the app into that namespace.
#! If both `namespace` and `into_namespace` are specified, then only `into_namespace` is used.
into_namespace: #! e.g. my-preexisting-namespace
#! All resources created statically by yaml at install-time and all resources created dynamically
#! by controllers at runtime will be labelled with `app: $app_name` and also with the labels
#! specified here. The value of `custom_labels` must be a map of string keys to string values.
#! The app can be uninstalled either by:
#! 1. Deleting the static install-time yaml resources including the static namespace, which will cascade and also delete
#! resources that were dynamically created by controllers at runtime
#! 2. Or, deleting all resources by label, which does not assume that there was a static install-time yaml namespace.
custom_labels: {} #! e.g. {myCustomLabelName: myCustomLabelValue, otherCustomLabelName: otherCustomLabelValue}
#@schema/title "Into namespace"
#@ into_namespace_desc = "If specified, assumes that a namespace of the given name already exists and installs the app into that namespace. \
#@ If both `namespace` and `into_namespace` are specified, then only `into_namespace` is used."
#@schema/desc into_namespace_desc
#@schema/examples ("The name of an existing namespace", "my-preexisting-namespace")
#@schema/nullable
#@schema/validation min_len=1
into_namespace: ""
#! Specify how many replicas of the Pinniped server to run.
#@schema/title "Custom labels"
#@ custom_labels_desc = "All resources created statically by yaml at install-time and all resources created dynamically \
#@ by controllers at runtime will be labelled with `app: $app_name` and also with the labels specified here. The value of \
#@ `custom_labels` must be a map of string keys to string values. The app can be uninstalled either by: 1.) deleting the \
#@ static install-time yaml resources including the static namespace, which will cascade and also delete \
#@ resources that were dynamically created by controllers at runtime, or 2.) deleting all resources by label, which does \
#@ not assume that there was a static install-time yaml namespace."
#@schema/desc custom_labels_desc
#@schema/examples ("Example set of labels", {"myCustomLabelName": "myCustomLabelValue", "otherCustomLabelName": "otherCustomLabelValue"})
#@schema/type any=True
#@schema/validation ("a map of string keys and string values", validate_strings_map)
custom_labels: { }
#@schema/title "Replicas"
#@schema/desc "Specify how many replicas of the Pinniped server to run."
replicas: 2
#! Specify either an image_digest or an image_tag. If both are given, only image_digest will be used.
image_repo: projects.registry.vmware.com/pinniped/pinniped-server
image_digest: #! e.g. sha256:f3c4fdfd3ef865d4b97a1fd295d94acc3f0c654c46b6f27ffad5cf80216903c8
#@schema/title "Image repo"
#@schema/desc "The repository for the Concierge container image."
#@schema/validation min_len=1
image_repo: ghcr.io/vmware/pinniped/pinniped-server
#@schema/title "Image digest"
#@schema/desc "The image digest for the Concierge container image. If both image_digest or an image_tag are given, only image_digest will be used."
#@schema/examples ("Providing a digest", "sha256:f3c4fdfd3ef865d4b97a1fd295d94acc3f0c654c46b6f27ffad5cf80216903c8")
#@schema/nullable
#@schema/validation min_len=1, when=lambda _, ctx: ctx.parent["image_tag"] == None
image_digest: ""
#@schema/title "Image tag"
#@schema/desc "The image tag for the Concierge container image. If both image_digest or an image_tag are given, only image_digest will be used."
#@schema/examples ("Providing a tag", "v0.25.0")
#@schema/validation min_len=1, when=lambda _, ctx: ctx.parent["image_digest"] == None
image_tag: latest
#! Optionally specify a different image for the "kube-cert-agent" pod which is scheduled
#! on the control plane. This image needs only to include `sleep` and `cat` binaries.
#! By default, the same image specified for image_repo/image_digest/image_tag will be re-used.
kube_cert_agent_image:
#@schema/title "Kube Cert Agent image"
#@ kube_cert_agent_image_desc = "Optionally specify a different image for the 'kube-cert-agent' pod which is scheduled \
#@ on the control plane. This image needs only to include `sleep` and `cat` binaries. \
#@ By default, the same image specified for image_repo/image_digest/image_tag will be re-used."
#@schema/desc kube_cert_agent_image_desc
#@schema/examples ("Image including tag or digest", "ghcr.io/vmware/pinniped/pinniped-server:latest")
#@schema/nullable
#@schema/validation min_len=1
kube_cert_agent_image: ""
#! Specifies a secret to be used when pulling the above `image_repo` container image.
#! Can be used when the above image_repo is a private registry.
#! Typically the value would be the output of: kubectl create secret docker-registry x --docker-server=https://example.io --docker-username="USERNAME" --docker-password="PASSWORD" --dry-run=client -o json | jq -r '.data[".dockerconfigjson"]'
#! Optional.
image_pull_dockerconfigjson: #! e.g. {"auths":{"https://registry.example.com":{"username":"USERNAME","password":"PASSWORD","auth":"BASE64_ENCODED_USERNAME_COLON_PASSWORD"}}}
#@schema/title "Kube Cert Agent Priority Class Name"
#@ kube_cert_agent_priority_class_name_desc = "Optionally specify a PriorityClassName for the 'kube-cert-agent' pod. \
#@ See https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ for more details. \
#@ By default, this is the empty string."
#@schema/desc kube_cert_agent_priority_class_name_desc
#@schema/examples ("name of a PriorityClass object", "high-priority")
#@schema/validation min_len=0
kube_cert_agent_priority_class_name: ""
#! Pinniped will try to guess the right K8s API URL for sharing that information with potential clients.
#! This setting allows the guess to be overridden.
#! Optional.
discovery_url: #! e.g., https://example.com
#@schema/title "Image pull dockerconfigjson"
#@ image_pull_dockerconfigjson_desc = "A base64 encoded secret to be used when pulling the `image_repo` container image. \
#@ Can be used when the image_repo is a private registry. Typically, the value would be the output of: \
#@ kubectl create secret docker-registry x --docker-server=https://example.io --docker-username='USERNAME' --docker-password='PASSWORD' --dry-run=client -o json | jq -r '.data[\".dockerconfigjson\"]'"
#@schema/desc image_pull_dockerconfigjson_desc
#@ example_desc = 'base64 encoding of: {"auths":{"https://registry.example.com":{"username":"USERNAME","password":"PASSWORD","auth":"BASE64_ENCODED_USERNAME_COLON_PASSWORD"}}}'
#@ example_value = "eyJhdXRocyI6eyJodHRwczovL2V4YW1wbGUuaW8iOnsidXNlcm5hbWUiOiJVU0VSTkFNRSIsInBhc3N3b3JkIjoiUEFTU1dPUkQiLCJhdXRoIjoiVlZORlVrNUJUVVU2VUVGVFUxZFBVa1E9In19fQ=="
#@schema/examples (example_desc, example_value)
#@schema/nullable
#@schema/validation min_len=1
image_pull_dockerconfigjson: ""
#! Specify the duration and renewal interval for the API serving certificate.
#! The defaults are set to expire the cert about every 30 days, and to rotate it
#! about every 25 days.
#@schema/title "Discovery URL"
#@schema/desc "Pinniped will try to guess the right K8s API URL for sharing that information with potential clients. This setting allows the guess to be overridden."
#@schema/examples ("Kubernetes API URL","https://example.com")
#@schema/nullable
#@schema/validation min_len=1
discovery_url: ""
#@schema/title "API serving certificate duration seconds"
#@ api_serving_certificate_duration_seconds_desc = "Specify the duration for the API serving certificate. \
#@ The default is set to expire the cert about every 30 days. \
#@ Specify this as an integer or as a string which contains an integer value."
#@schema/desc api_serving_certificate_duration_seconds_desc
#@schema/type any=True
#@schema/validation ("an int or string which contains an integer value", lambda v: type(v) in ["int", "string"])
api_serving_certificate_duration_seconds: 2592000
#@schema/title "API serving certificate renew before seconds"
#@ api_serving_certificate_renew_before_seconds_desc = "Specify the renewal interval for the API serving certificate. \
#@ The default is set to rotate it about every 25 days. \
#@ Specify this as an integer or as a string which contains an integer value."
#@schema/desc api_serving_certificate_renew_before_seconds_desc
#@schema/type any=True
#@schema/validation ("an int or string which contains an integer value", lambda v: type(v) in ["int", "string"])
api_serving_certificate_renew_before_seconds: 2160000
#! Specify the verbosity of logging: info ("nice to know" information), debug (developer
#! information), trace (timing information), all (kitchen sink).
log_level: #! By default, when this value is left unset, only warnings and errors are printed. There is no way to suppress warning and error logs.
#! Specify the format of logging: json (for machine parsable logs) and text (for legacy klog formatted logs).
#! By default, when this value is left unset, logs are formatted in json.
#! This configuration is deprecated and will be removed in a future release at which point logs will always be formatted as json.
deprecated_log_format:
#@schema/title "Log level"
#@ log_level_desc = "Specify the verbosity of logging: info (\"nice to know\" information), debug (developer information), trace (timing information), \
#@ or all (kitchen sink). Do not use trace or all on production systems, as credentials may get logged. \
#@ When this value is left unset, only warnings and errors are printed. There is no way to suppress warning and error logs."
#@schema/desc log_level_desc
#@schema/examples ("Developer logging information","debug")
#@schema/nullable
#@schema/validation one_of=["info", "debug", "trace", "all"]
log_level: ""
run_as_user: 65532 #! run_as_user specifies the user ID that will own the process, see the Dockerfile for the reasoning behind this choice
run_as_group: 65532 #! run_as_group specifies the group ID that will own the process, see the Dockerfile for the reasoning behind this choice
#@schema/title "Run as user"
#@schema/desc "The user ID that will own the process."
#! See the Dockerfile for the reasoning behind this default value.
run_as_user: 65532
#! Specify the API group suffix for all Pinniped API groups. By default, this is set to
#! pinniped.dev, so Pinniped API groups will look like foo.pinniped.dev,
#! authentication.concierge.pinniped.dev, etc. As an example, if this is set to tuna.io, then
#! Pinniped API groups will look like foo.tuna.io. authentication.concierge.tuna.io, etc.
#@schema/title "Run as group"
#@schema/desc "The group ID that will own the process."
#! See the Dockerfile for the reasoning behind this default value.
run_as_group: 65532
#@schema/title "API group suffix"
#@ api_group_suffix_desc = "Specify the API group suffix for all Pinniped API groups. By default, this is set to \
#@ pinniped.dev, so Pinniped API groups will look like foo.pinniped.dev, \
#@ authentication.concierge.pinniped.dev, etc. As an example, if this is set to tuna.io, then \
#@ Pinniped API groups will look like foo.tuna.io. authentication.concierge.tuna.io, etc."
#@schema/desc api_group_suffix_desc
#@schema/validation min_len=1
api_group_suffix: pinniped.dev
#! Customize CredentialIssuer.spec.impersonationProxy to change how the concierge
#! handles impersonation.
#@schema/title "Impersonation proxy spec"
#@schema/desc "Customize CredentialIssuer.spec.impersonationProxy to change how the concierge handles impersonation."
impersonation_proxy_spec:
#! options are "auto", "disabled" or "enabled".
#! If auto, the impersonation proxy will run only if the cluster signing key is not available
#! and the other strategy does not work.
#! If disabled, the impersonation proxy will never run, which could mean that the concierge
#! doesn't work at all.
#! If enabled, the impersonation proxy will always run regardless of other strategies available.
mode: auto
#! The endpoint which the client should use to connect to the impersonation proxy.
#! If left unset, the client will default to connecting based on the ClusterIP or LoadBalancer
#! endpoint.
external_endpoint:
service:
#! Options are "LoadBalancer", "ClusterIP" and "None".
#! LoadBalancer automatically provisions a Service of type LoadBalancer pointing at
#! the impersonation proxy. Some cloud providers will allocate
#! a public IP address by default even on private clusters.
#! ClusterIP automatically provisions a Service of type ClusterIP pointing at the
#! impersonation proxy.
#! None does not provision either and assumes that you have set the external_endpoint
#! and set up your own ingress to connect to the impersonation proxy.
type: LoadBalancer
#! The annotations that should be set on the ClusterIP or LoadBalancer Service.
annotations:
{service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "4000"}
#! When mode LoadBalancer is set, this will set the LoadBalancer Service's Spec.LoadBalancerIP.
load_balancer_ip:
#! Set the standard golang HTTPS_PROXY and NO_PROXY environment variables on the Concierge containers.
#! These will be used when the Concierge makes backend-to-backend calls to authenticators using HTTPS,
#! e.g. when the Concierge fetches discovery documents, JWKS keys, and POSTs to token webhooks.
#! The Concierge never makes insecure HTTP calls, so there is no reason to set HTTP_PROXY.
#! Optional.
https_proxy: #! e.g. http://proxy.example.com
no_proxy: "$(KUBERNETES_SERVICE_HOST),169.254.169.254,127.0.0.1,localhost,.svc,.cluster.local" #! do not proxy Kubernetes endpoints
#@schema/title "Mode"
#@ impersonation_mode_desc = "Enables or disables the impersonation proxy. Options are 'auto', 'disabled' or 'enabled'. \
#@ If auto, the impersonation proxy will run only if the cluster signing key is \
#@ not available and the other strategy does not work. \
#@ If enabled, the impersonation proxy will always run regardless of other strategies available. \
#@ If disabled, the impersonation proxy will never run, which could mean \
#@ that the concierge doesn't work at all."
#@schema/desc impersonation_mode_desc
#@schema/validation one_of=["auto", "disabled", "enabled"]
mode: auto
#@schema/title "External endpoint"
#@ external_endpoint_desc = "The endpoint which the client should use to connect to the impersonation proxy. \
#@ If left unset, the client will default to connecting based on the ClusterIP or LoadBalancer endpoint."
#@schema/desc external_endpoint_desc
#@schema/examples ("Specified impersonation proxy endpoint", "https://1.2.3.4:5678")
#@schema/nullable
#@schema/validation min_len=1
external_endpoint: ""
#@schema/title "Service"
#@schema/desc "The impersonation proxy service configuration"
service:
#@schema/title "Type"
#@ impersonation_service_type_desc = "Service backing the impersonation proxy. Options are 'LoadBalancer', 'ClusterIP' \
#@ and 'None'. LoadBalancer automatically provisions a Service of type LoadBalancer pointing at the impersonation \
#@ proxy. Some cloud providers will allocate a public IP address by default even on private clusters. ClusterIP \
#@ automatically provisions a Service of type ClusterIP pointing at the impersonation proxy. None does not provision \
#@ either and assumes that you have set the external_endpoint and set up your own ingress to connect to the impersonation proxy."
#@schema/desc impersonation_service_type_desc
#@schema/validation one_of=["LoadBalancer", "ClusterIP", "None"]
type: LoadBalancer
#@schema/title "Annotations"
#@ annotations_desc = "The annotations that should be set on the ClusterIP or LoadBalancer Service. The default includes \
#@ a value for the AWS-specific service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout annotation, which will \
#@ be ignored except when using AWS to provide load balancer Services."
#@schema/desc annotations_desc
#@schema/nullable
#@schema/type any=True
#@schema/validation ("a map of string keys and string values", validate_strings_map)
annotations:
#@schema/title "Load balancer IP"
#@schema/desc "When mode LoadBalancer is set, this will set the LoadBalancer Service's spec.loadBalancerIP."
#@schema/examples ("Specifying an IP", "1.2.3.4")
#@schema/nullable
#@schema/validation min_len=1
load_balancer_ip: ""
#@schema/title "HTTPS proxy"
#@ https_proxy_desc = "Set the standard golang HTTPS_PROXY and NO_PROXY environment variables on the Concierge containers. \
#@ These will be used when the Concierge makes backend-to-backend calls to authenticators using HTTPS, \
#@ e.g. when the Concierge fetches discovery documents and JWKS keys for JWTAuthenticators and POSTs to webhooks for WebhookAuthenticators. \
#@ The Concierge never makes insecure HTTP calls, so there is no reason to set HTTP_PROXY."
#@schema/desc https_proxy_desc
#@schema/examples ("Providing a proxy endpoint","http://proxy.example.com")
#@schema/nullable
#@schema/validation min_len=1
https_proxy: ""
#@schema/title "No proxy"
#@ no_proxy_desc = "Endpoints that should not be proxied. Defaults to not proxying internal Kubernetes endpoints, \
#@ localhost endpoints, and the known instance metadata IP address for public cloud providers."
#@schema/desc no_proxy_desc
no_proxy: "$(KUBERNETES_SERVICE_HOST),169.254.169.254,127.0.0.1,localhost,.svc,.cluster.local"
#@schema/title "Allowed Ciphers for TLS 1.2"
#@ allowed_ciphers_for_tls_onedottwo_desc = "When specified, only the ciphers listed will be used for TLS 1.2. \
#@ This includes both server-side and client-side TLS connections. \
#@ This list must only include cipher suites that Pinniped is configured to accept \
#@ (see internal/crypto/ptls/profiles.go and internal/crypto/ptls/profiles_fips_strict.go). \
#@ Allowing too few ciphers may cause critical parts of Pinniped to be unable to function. For example, \
#@ Kubernetes pod readiness checks, Pinniped pods acting as a client to the Kubernetes API server, \
#@ Pinniped pods acting as a client to external identity providers, or Pinniped pods acting as an APIService server \
#@ all need to be able to function with the allowed TLS cipher suites. \
#@ An empty array means accept Pinniped's defaults."
#@schema/desc allowed_ciphers_for_tls_onedottwo_desc
#@schema/examples ("Example with a few secure ciphers", ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"])
#! No type, default, or validation is required here.
#! An empty array is perfectly valid, as is any array of strings.
allowed_ciphers_for_tls_onedottwo:
- ""
#@schema/title "Audit logging configuration"
#@schema/desc "Customize the content of audit log events."
audit:
#@schema/title "Log usernames and groups"
#@ log_usernames_and_groups_desc = "Enables or disables printing usernames and group names in audit logs. Options are 'enabled' or 'disabled'. \
#@ If enabled, usernames are group names may be printed in audit log events. \
#@ If disabled, usernames and group names will be redacted from audit logs because they might contain personally identifiable information."
#@schema/desc log_usernames_and_groups_desc
#@schema/validation one_of=["enabled", "disabled"]
log_usernames_and_groups: disabled

View File

@@ -20,7 +20,7 @@ kubectl apply -f https://get.pinniped.dev/latest/install-local-user-authenticato
## Installing a Specific Version with Default Options
Choose your preferred [release](https://github.com/vmware-tanzu/pinniped/releases) version number
Choose your preferred [release](https://github.com/vmware/pinniped/releases) version number
and use it to replace the version number in the URL below.
```bash

View File

@@ -1,4 +1,4 @@
#! Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@ load("@ytt:data", "data")
@@ -76,6 +76,15 @@ spec:
#! `--validate=false` flag. Note that installing via `kapp` does not complain about this validation error.
seccompProfile:
type: "RuntimeDefault"
tolerations:
- key: kubernetes.io/arch
effect: NoSchedule
operator: Equal
value: amd64 #! Allow running on amd64 nodes.
- key: kubernetes.io/arch
effect: NoSchedule
operator: Equal
value: arm64 #! Also allow running on arm64 nodes.
---
apiVersion: v1
kind: Service

View File

@@ -1,19 +1,44 @@
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@data/values
#@data/values-schema
---
#@schema/title "Image repo"
#@schema/desc "The repository for the local-user-authenticator container image."
#@schema/validation min_len=1
image_repo: ghcr.io/vmware/pinniped/pinniped-server
#! Specify either an image_digest or an image_tag. If both are given, only image_digest will be used.
image_repo: projects.registry.vmware.com/pinniped/pinniped-server
image_digest: #! e.g. sha256:f3c4fdfd3ef865d4b97a1fd295d94acc3f0c654c46b6f27ffad5cf80216903c8
#@schema/title "Image digest"
#@schema/desc "The image digest for the local-user-authenticator container image. If both image_digest or an image_tag are given, only image_digest will be used."
#@schema/examples ("Providing a digest", "sha256:f3c4fdfd3ef865d4b97a1fd295d94acc3f0c654c46b6f27ffad5cf80216903c8")
#@schema/nullable
#@schema/validation min_len=1, when=lambda _, ctx: ctx.parent["image_tag"] == None
image_digest: ""
#@schema/title "Image tag"
#@schema/desc "The image tag for the local-user-authenticator container image. If both image_digest or an image_tag are given, only image_digest will be used."
#@schema/examples ("Providing a tag", "v0.25.0")
#@schema/validation min_len=1, when=lambda _, ctx: ctx.parent["image_digest"] == None
image_tag: latest
#! Specifies a secret to be used when pulling the above `image_repo` container image.
#! Can be used when the above image_repo is a private registry.
#! Typically the value would be the output of: kubectl create secret docker-registry x --docker-server=https://example.io --docker-username="USERNAME" --docker-password="PASSWORD" --dry-run=client -o json | jq -r '.data[".dockerconfigjson"]'
#! Optional.
image_pull_dockerconfigjson: #! e.g. {"auths":{"https://registry.example.com":{"username":"USERNAME","password":"PASSWORD","auth":"BASE64_ENCODED_USERNAME_COLON_PASSWORD"}}}
#@schema/title "Image pull dockerconfigjson"
#@ image_pull_dockerconfigjson_desc = "A base64 encoded secret to be used when pulling the `image_repo` container image. \
#@ Can be used when the image_repo is a private registry. Typically, the value would be the output of: \
#@ kubectl create secret docker-registry x --docker-server=https://example.io --docker-username='USERNAME' --docker-password='PASSWORD' --dry-run=client -o json | jq -r '.data[\".dockerconfigjson\"]'"
#@schema/desc image_pull_dockerconfigjson_desc
#@ example_desc = 'base64 encoding of: {"auths":{"https://registry.example.com":{"username":"USERNAME","password":"PASSWORD","auth":"BASE64_ENCODED_USERNAME_COLON_PASSWORD"}}}'
#@ example_value = "eyJhdXRocyI6eyJodHRwczovL2V4YW1wbGUuaW8iOnsidXNlcm5hbWUiOiJVU0VSTkFNRSIsInBhc3N3b3JkIjoiUEFTU1dPUkQiLCJhdXRoIjoiVlZORlVrNUJUVVU2VUVGVFUxZFBVa1E9In19fQ=="
#@schema/examples (example_desc, example_value)
#@schema/nullable
#@schema/validation min_len=1
image_pull_dockerconfigjson: ""
run_as_user: 65532 #! run_as_user specifies the user ID that will own the process, see the Dockerfile for the reasoning behind this choice
run_as_group: 65532 #! run_as_group specifies the group ID that will own the process, see the Dockerfile for the reasoning behind this choice
#@schema/title "Run as user"
#@schema/desc "The user ID that will own the process."
#! See the Dockerfile for the reasoning behind this default value.
run_as_user: 65532
#@schema/title "Run as group"
#@schema/desc "The group ID that will own the process."
#! See the Dockerfile for the reasoning behind this default value.
run_as_group: 65532

View File

@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.20.0
name: federationdomains.config.supervisor.pinniped.dev
spec:
group: config.supervisor.pinniped.dev
@@ -21,7 +20,7 @@ spec:
- jsonPath: .spec.issuer
name: Issuer
type: string
- jsonPath: .status.status
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
@@ -33,56 +32,289 @@ spec:
description: FederationDomain describes the configuration of an OIDC provider.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: Spec of the OIDC provider.
properties:
identityProviders:
description: |-
IdentityProviders is the list of identity providers available for use by this FederationDomain.
An identity provider CR (e.g. OIDCIdentityProvider or LDAPIdentityProvider) describes how to connect to a server,
how to talk in a specific protocol for authentication, and how to use the schema of that server/protocol to
extract a normalized user identity. Normalized user identities include a username and a list of group names.
In contrast, IdentityProviders describes how to use that normalized identity in those Kubernetes clusters which
belong to this FederationDomain. Each entry in IdentityProviders can be configured with arbitrary transformations
on that normalized identity. For example, a transformation can add a prefix to all usernames to help avoid
accidental conflicts when multiple identity providers have different users with the same username (e.g.
"idp1:ryan" versus "idp2:ryan"). Each entry in IdentityProviders can also implement arbitrary authentication
rejection policies. Even though a user was able to authenticate with the identity provider, a policy can disallow
the authentication to the Kubernetes clusters that belong to this FederationDomain. For example, a policy could
disallow the authentication unless the user belongs to a specific group in the identity provider.
For backwards compatibility with versions of Pinniped which predate support for multiple identity providers,
an empty IdentityProviders list will cause the FederationDomain to use all available identity providers which
exist in the same namespace, but also to reject all authentication requests when there is more than one identity
provider currently defined. In this backwards compatibility mode, the name of the identity provider resource
(e.g. the Name of an OIDCIdentityProvider resource) will be used as the name of the identity provider in this
FederationDomain. This mode is provided to make upgrading from older versions easier. However, instead of
relying on this backwards compatibility mode, please consider this mode to be deprecated and please instead
explicitly list the identity provider using this IdentityProviders field.
items:
description: FederationDomainIdentityProvider describes how an identity
provider is made available in this FederationDomain.
properties:
displayName:
description: |-
DisplayName is the name of this identity provider as it will appear to clients. This name ends up in the
kubeconfig of end users, so changing the name of an identity provider that is in use by end users will be a
disruptive change for those users.
minLength: 1
type: string
objectRef:
description: |-
ObjectRef is a reference to a Pinniped identity provider resource. A valid reference is required.
If the reference cannot be resolved then the identity provider will not be made available.
Must refer to a resource of one of the Pinniped identity provider types, e.g. OIDCIdentityProvider,
LDAPIdentityProvider, ActiveDirectoryIdentityProvider.
properties:
apiGroup:
description: |-
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
transforms:
description: |-
Transforms is an optional way to specify transformations to be applied during user authentication and
session refresh.
properties:
constants:
description: Constants defines constant variables and their
values which will be made available to the transform expressions.
items:
description: |-
FederationDomainTransformsConstant defines a constant variable and its value which will be made available to
the transform expressions. This is a union type, and Type is the discriminator field.
properties:
name:
description: Name determines the name of the constant.
It must be a valid identifier name.
maxLength: 64
minLength: 1
pattern: ^[a-zA-Z][_a-zA-Z0-9]*$
type: string
stringListValue:
description: StringListValue should hold the value
when Type is "stringList", and is otherwise ignored.
items:
type: string
type: array
stringValue:
description: StringValue should hold the value when
Type is "string", and is otherwise ignored.
type: string
type:
description: |-
Type determines the type of the constant, and indicates which other field should be non-empty.
Allowed values are "string" or "stringList".
enum:
- string
- stringList
type: string
required:
- name
- type
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
examples:
description: |-
Examples can optionally be used to ensure that the sequence of transformation expressions are working as
expected. Examples define sample input identities which are then run through the expression list, and the
results are compared to the expected results. If any example in this list fails, then this
identity provider will not be available for use within this FederationDomain, and the error(s) will be
added to the FederationDomain status. This can be used to help guard against programming mistakes in the
expressions, and also act as living documentation for other administrators to better understand the expressions.
items:
description: FederationDomainTransformsExample defines
a transform example.
properties:
expects:
description: |-
Expects is the expected output of the entire sequence of transforms when they are run against the
input Username and Groups.
properties:
groups:
description: Groups is the expected list of group
names after the transformations have been applied.
items:
type: string
type: array
message:
description: |-
Message is the expected error message of the transforms. When Rejected is true, then Message is the expected
message for the policy which rejected the authentication attempt. When Rejected is true and Message is blank,
then Message will be treated as the default error message for authentication attempts which are rejected by a
policy. When Rejected is false, then Message is the expected error message for some other non-policy
transformation error, such as a runtime error. When Rejected is false, there is no default expected Message.
type: string
rejected:
description: |-
Rejected is a boolean that indicates whether authentication is expected to be rejected by a policy expression
after the transformations have been applied. True means that it is expected that the authentication would be
rejected. The default value of false means that it is expected that the authentication would not be rejected
by any policy expression.
type: boolean
username:
description: Username is the expected username
after the transformations have been applied.
type: string
type: object
groups:
description: Groups is the input list of group names.
items:
type: string
type: array
username:
description: Username is the input username.
minLength: 1
type: string
required:
- expects
- username
type: object
type: array
expressions:
description: |-
Expressions are an optional list of transforms and policies to be executed in the order given during every
authentication attempt, including during every session refresh.
Each is a CEL expression. It may use the basic CEL language as defined in
https://github.com/google/cel-spec/blob/master/doc/langdef.md plus the CEL string extensions defined in
https://github.com/google/cel-go/tree/master/ext#strings.
The username and groups extracted from the identity provider, and the constants defined in this CR, are
available as variables in all expressions. The username is provided via a variable called `username` and
the list of group names is provided via a variable called `groups` (which may be an empty list).
Each user-provided constants is provided via a variable named `strConst.varName` for string constants
and `strListConst.varName` for string list constants.
The only allowed types for expressions are currently policy/v1, username/v1, and groups/v1.
Each policy/v1 must return a boolean, and when it returns false, no more expressions from the list are evaluated
and the authentication attempt is rejected.
Transformations of type policy/v1 do not return usernames or group names, and therefore cannot change the
username or group names.
Each username/v1 transform must return the new username (a string), which can be the same as the old username.
Transformations of type username/v1 do not return group names, and therefore cannot change the group names.
Each groups/v1 transform must return the new groups list (list of strings), which can be the same as the old
groups list.
Transformations of type groups/v1 do not return usernames, and therefore cannot change the usernames.
After each expression, the new (potentially changed) username or groups get passed to the following expression.
Any compilation or static type-checking failure of any expression will cause an error status on the FederationDomain.
During an authentication attempt, any unexpected runtime evaluation errors (e.g. division by zero) cause the
authentication attempt to fail. When all expressions evaluate successfully, then the (potentially changed) username
and group names have been decided for that authentication attempt.
items:
description: FederationDomainTransformsExpression defines
a transform expression.
properties:
expression:
description: Expression is a CEL expression that will
be evaluated based on the Type during an authentication.
minLength: 1
type: string
message:
description: |-
Message is only used when Type is policy/v1. It defines an error message to be used when the policy rejects
an authentication attempt. When empty, a default message will be used.
type: string
type:
description: |-
Type determines the type of the expression. It must be one of the supported types.
Allowed values are "policy/v1", "username/v1", or "groups/v1".
enum:
- policy/v1
- username/v1
- groups/v1
type: string
required:
- expression
- type
type: object
type: array
type: object
required:
- displayName
- objectRef
type: object
type: array
issuer:
description: "Issuer is the OIDC Provider's issuer, per the OIDC Discovery
Metadata document, as well as the identifier that it will use for
the iss claim in issued JWTs. This field will also be used as the
base URL for any endpoints used by the OIDC Provider (e.g., if your
issuer is https://example.com/foo, then your authorization endpoint
will look like https://example.com/foo/some/path/to/auth/endpoint).
\n See https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3
for more information."
description: |-
Issuer is the OIDC Provider's issuer, per the OIDC Discovery Metadata document, as well as the
identifier that it will use for the iss claim in issued JWTs. This field will also be used as
the base URL for any endpoints used by the OIDC Provider (e.g., if your issuer is
https://example.com/foo, then your authorization endpoint will look like
https://example.com/foo/some/path/to/auth/endpoint).
See
https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3 for more information.
minLength: 1
type: string
x-kubernetes-validations:
- message: issuer must be an HTTPS URL
rule: isURL(self) && url(self).getScheme() == 'https'
tls:
description: TLS configures how this FederationDomain is served over
Transport Layer Security (TLS).
description: TLS specifies a secret which will contain Transport Layer
Security (TLS) configuration for the FederationDomain.
properties:
secretName:
description: "SecretName is an optional name of a Secret in the
same namespace, of type `kubernetes.io/tls`, which contains
the TLS serving certificate for the HTTPS endpoints served by
this FederationDomain. When provided, the TLS Secret named here
must contain keys named `tls.crt` and `tls.key` that contain
the certificate and private key to use for TLS. \n Server Name
Indication (SNI) is an extension to the Transport Layer Security
(TLS) supported by all major browsers. \n SecretName is required
if you would like to use different TLS certificates for issuers
of different hostnames. SNI requests do not include port numbers,
so all issuers with the same DNS hostname must use the same
SecretName value even if they have different port numbers. \n
SecretName is not required when you would like to use only the
HTTP endpoints (e.g. when the HTTP listener is configured to
listen on loopback interfaces or UNIX domain sockets for traffic
from a service mesh sidecar). It is also not required when you
would like all requests to this OIDC Provider's HTTPS endpoints
to use the default TLS certificate, which is configured elsewhere.
\n When your Issuer URL's host is an IP address, then this field
is ignored. SNI does not work for IP addresses."
description: |-
SecretName is an optional name of a Secret in the same namespace, of type `kubernetes.io/tls`, which contains
the TLS serving certificate for the HTTPS endpoints served by this FederationDomain. When provided, the TLS Secret
named here must contain keys named `tls.crt` and `tls.key` that contain the certificate and private key to use
for TLS.
Server Name Indication (SNI) is an extension to the Transport Layer Security (TLS) supported by all major browsers.
SecretName is required if you would like to use different TLS certificates for issuers of different hostnames.
SNI requests do not include port numbers, so all issuers with the same DNS hostname must use the same
SecretName value even if they have different port numbers.
SecretName is not required when you would like to use only the HTTP endpoints (e.g. when the HTTP listener is
configured to listen on loopback interfaces or UNIX domain sockets for traffic from a service mesh sidecar).
It is also not required when you would like all requests to this OIDC Provider's HTTPS endpoints to
use the default TLS certificate, which is configured elsewhere.
When your Issuer URL's host is an IP address, then this field is ignored. SNI does not work for IP addresses.
type: string
type: object
required:
@@ -91,69 +323,145 @@ spec:
status:
description: Status of the OIDC provider.
properties:
lastUpdateTime:
description: LastUpdateTime holds the time at which the Status was
last updated. It is a pointer to get around some undesirable behavior
with respect to the empty metav1.Time value (see https://github.com/kubernetes/kubernetes/issues/86811).
format: date-time
type: string
message:
description: Message provides human-readable details about the Status.
conditions:
description: Conditions represent the observations of an FederationDomain's
current state.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
phase:
default: Pending
description: Phase summarizes the overall status of the FederationDomain.
enum:
- Pending
- Ready
- Error
type: string
secrets:
description: Secrets contains information about this OIDC Provider's
secrets.
properties:
jwks:
description: JWKS holds the name of the corev1.Secret in which
this OIDC Provider's signing/verification keys are stored. If
it is empty, then the signing/verification keys are either unknown
or they don't exist.
description: |-
JWKS holds the name of the corev1.Secret in which this OIDC Provider's signing/verification keys are
stored. If it is empty, then the signing/verification keys are either unknown or they don't
exist.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
stateEncryptionKey:
description: StateSigningKey holds the name of the corev1.Secret
in which this OIDC Provider's key for encrypting state parameters
is stored.
description: |-
StateSigningKey holds the name of the corev1.Secret in which this OIDC Provider's key for
encrypting state parameters is stored.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
stateSigningKey:
description: StateSigningKey holds the name of the corev1.Secret
in which this OIDC Provider's key for signing state parameters
is stored.
description: |-
StateSigningKey holds the name of the corev1.Secret in which this OIDC Provider's key for
signing state parameters is stored.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
tokenSigningKey:
description: TokenSigningKey holds the name of the corev1.Secret
in which this OIDC Provider's key for signing tokens is stored.
description: |-
TokenSigningKey holds the name of the corev1.Secret in which this OIDC Provider's key for
signing tokens is stored.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: object
status:
description: Status holds an enum that describes the state of this
OIDC Provider. Note that this Status can represent success or failure.
enum:
- Success
- Duplicate
- Invalid
- SameIssuerHostMustUseSameSecret
type: string
type: object
required:
- spec
@@ -162,9 +470,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

Some files were not shown because too many files have changed in this diff Show More