Commit Graph

142 Commits

Author SHA1 Message Date
Ryan Richard 55a1f20d2b update impersonator test expectations for kube 1.36 libs
Signed-off-by: Ryan Richard <richardry@vmware.com>
2026-05-06 08:53:00 -07:00
Ryan Richard d863e77b19 fix linters errors about deprecated functions
Signed-off-by: Ryan Richard <richardry@vmware.com>
2026-05-06 08:34:17 -07:00
Ryan Richard 5f38bc05c4 upgrade linter and fix/ignore all new lint warnings 2026-03-27 10:08:17 -07:00
Ryan Richard e5366d782d fix new linter warnings from prealloc linter 2026-02-13 15:19:15 -08:00
Ryan Richard 0f0f3997a0 support partial enablement of anonymous authentication in impersonator 2026-01-23 13:11:29 -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 2a83d00373 add claimValidationRules, userValidationRules, and claims.extra to JWTAuthenticator CRD 2025-07-16 14:56:44 -07:00
Ryan Richard e743beac53 upgrade k8s libs to v0.33.0 2025-05-13 11:56:03 -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 c600cf7949 upgrade linter to latest 2025-05-12 15:19:50 -07:00
Ryan Richard d90b3c23ef introduce new configuration option to disable admission plugin types 2025-03-17 14:49:17 -07:00
Ryan Richard 39a86e7d52 upgrade Go linter to current latest 2025-02-18 10:47:24 -08: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 e21e1326b7 tokencredentialrequest audit logs successful responses
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
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
Ryan Richard 4f9530eec7 audit logging WIP 2024-11-27 13:53:00 -06: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 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 f09b3c2f72 Bump K8s libs to 1.31 and fix compilation errors 2024-08-27 13:26:38 -05:00
Ryan Richard f7f32f2f98 some mild refactoring of ptls common.go (mostly renames) 2024-06-14 13:27:38 -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 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 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 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
Ryan Richard 9838a7cb6d avoid the ValidatingAdmissionPolicy admission plugin when it can't work 2024-04-29 13:22:14 -07:00
Joshua Casey 94bee9e882 Remove testutil.TLSTestServerWithCert in favor of the testutil/tlsserver package 2024-04-19 10:30:23 -05:00
Ryan Richard c7299f4daf Update dependencies, including Kube packages to v0.29.0 2024-01-04 12:30:22 -08:00
Ryan Richard a4883507b5 Disable UnauthenticatedHTTP2DOSMitigation feature gate 2023-12-12 08:47:03 -08:00
Ryan Richard 4b7b9e4362 Defensive changes to mitigate potential http2 rapid reset attacks 2023-12-05 14:57:50 -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
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 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
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
Joshua Casey 38230fc518 Use pversion to retrieve buildtime information 2023-08-28 11:54:27 -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 23ec91dee0 K8s API Server audit events are no longer pointers 2023-08-28 10:50:10 -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
Joshua Casey 741ccfd2ce Fix lint 2023-07-19 15:47:48 -05:00
Joshua Casey 52b0cf43ca Fix godoc 2023-07-19 15:47:47 -05:00
Ryan Richard d30d76b7ac Increase some test timeouts 2023-05-31 17:41:36 -07:00
Ryan Richard 7ff3b3d9cb Code changes to support Kube 0.26 deps 2023-01-18 14:39:22 -08:00
Ryan Richard af01c3aeb6 Make kubectl explain work for Pinniped aggregated APIs
- Change update-codegen.sh script to also generated openapi code for the
  aggregated API types
- Update both aggregated API servers' configuration to make them serve
  the openapi docs for the aggregated APIs
- Add new integration test which runs `kubectl explain` for all Pinniped
  API resources, and all fields and subfields of those resources
- Update some the comments on the API structs
- Change some names of the tmpl files to make the filename better match
  the struct names
2022-09-21 15:15:37 -07:00
Ryan Richard c6c2c525a6 Upgrade the linter and fix all new linter warnings
Also fix some tests that were broken by bumping golang and dependencies
in the previous commits.

Note that in addition to changes made to satisfy the linter which do not
impact the behavior of the code, this commit also adds ReadHeaderTimeout
to all usages of http.Server to satisfy the linter (and because it
seemed like a good suggestion).
2022-08-24 14:45:55 -07:00
Monis Khan 0674215ef3 Switch to go.uber.org/zap for JSON formatted logging
Signed-off-by: Monis Khan <mok@vmware.com>
2022-05-24 11:17:42 -04:00
Margo Crawford 03f19da21c the http2RoundTripper should only use http2
Signed-off-by: Margo Crawford <margaretc@vmware.com>
2022-04-14 10:51:25 -07:00