You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: release 2.5.0
2.5.0: CA Bundle with ConfigMap + GKE Ambient Credentials Documentation
* release: 2.5.1
* feat: release 2.5.0 (#62)
2.5.0: CA Bundle with ConfigMap + GKE Ambient Credentials Documentation
Co-authored-by: Matthew H. Irby <irby@users.noreply.github.com>
* feat: add client caching to reduce OAuth token requests
Previously, every certificate request reconciliation created a new Command
API client, which meant a new OAuth token was fetched for each request.
For customers with OAuth provider quotas, this caused rate limiting issues.
This change introduces a ClientCache that:
- Caches Command API clients by configuration hash
- Reuses cached clients across reconciliations for the same issuer
- Allows the underlying oauth2 library's token caching to work as intended
- Is thread-safe for concurrent reconciliations
The cache key is a SHA-256 hash of all configuration fields that affect
the client connection (hostname, API path, credentials, scopes, etc.),
ensuring different issuers get different clients while the same issuer
reuses its client.
Fixes: OAuth token re-authentication on every request
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(scripts): update scripting usability
* feat: update keyfactor-auth-client-go to v1.3.1
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
* chore: remove test short circuit
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Revert "Potential fix for pull request finding"
This reverts commit 19bc19b.
* chore: cleanup
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
* chore: break build & test into its own workflow
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
* fix: remove lint from CI
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
* chore(docs): update CHANGELOG
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
---------
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
Co-authored-by: Morgan Gangwere <470584+indrora@users.noreply.github.com>
Co-authored-by: Matthew H. Irby <irby@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Matthew H. Irby <matt.irby@keyfactor.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
Co-authored-by: Matthew H. Irby <irby@users.noreply.github.com>
Co-authored-by: spb <1661003+spbsoluble@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Matthew H. Irby <matt.irby@keyfactor.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
setupLog.Error(errors.New(fmt.Sprintf("interval %s is invalid, must be greater than or equal to '30s'", healthCheckInterval)), "invalid health check interval")
201
201
os.Exit(1)
202
202
}
203
203
204
+
// Create a shared client cache to avoid re-authenticating (fetching new OAuth tokens)
205
+
// for every certificate request. Clients are cached by configuration hash.
206
+
clientCache:=command.NewClientCache()
207
+
setupLog.Info("initialized Command client cache for OAuth token reuse")
Copy file name to clipboardExpand all lines: e2e/README.md
+88-11Lines changed: 88 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,34 @@ The test suite does the following:
13
13
This is currently configured as a Bash script, so it is necessary to run this on a UNIX-compatible machine.
14
14
15
15
## Requirements
16
-
- An available Command instance is running and configured as described in the [root README](../README.md#configuring-command)
17
-
- OAuth is used to communicate with Command
16
+
17
+
**Local tools:**
18
18
- Docker (>= 28.2.2)
19
-
- Minikube (>= v1.35.0)
20
19
- kubectl (>= v1.32.2)
21
20
- helm (>= v3.17.1)
22
21
- cmctl (>= v2.1.1)
22
+
- Minikube (>= v1.35.0) - only required if using `USE_MINIKUBE=true`
23
+
24
+
**Kubernetes cluster:**
25
+
- By default, tests run against your current kubeconfig context
26
+
- Set `USE_MINIKUBE=true` to use minikube instead
27
+
28
+
**Command instance:**
29
+
- An available Command instance configured as described in the [root README](../README.md#configuring-command)
30
+
- OAuth credentials for API access
31
+
- An enrollment pattern (default: "Default Pattern") with CSR Enrollment enabled
32
+
- A security role (default: "InstanceOwner") with Enrollment permissions
33
+
34
+
On the Command side:
35
+
- An enrollment pattern is created called "Test Enrollment Pattern" that is has CSR Enrollment, CSR Generation, and PFX Enrollment enabled
36
+
- A security role by the name of "InstanceOwner" exists and has the ability to perform Enrollment
23
37
24
38
On the Command side:
25
39
- An enrollment pattern is created called "Test Enrollment Pattern" that is has CSR Enrollment, CSR Generation, and PFX Enrollment enabled
26
40
- A security role by the name of "InstanceOwner" exists and has the ability to perform Enrollment
27
41
28
42
## Configuring the environment variables
43
+
29
44
command-cert-manager-issuer interacts with an external Command instance. An environment variable file `.env` can be used to store the environment variables to be used to talk to the Command instance.
30
45
31
46
A `.env.example` file is available as a template for your environment variables.
@@ -35,24 +50,86 @@ A `.env.example` file is available as a template for your environment variables.
35
50
cp .env.example .env
36
51
```
37
52
38
-
Modify the fields as needed.
53
+
### Required variables
54
+
55
+
| Variable | Description |
56
+
|----------|-------------|
57
+
|`HOSTNAME`| Command instance hostname |
58
+
|`API_PATH`| API path (default: `KeyfactorAPI`) |
59
+
|`OAUTH_TOKEN_URL`| OAuth token endpoint URL |
60
+
|`OAUTH_CLIENT_ID`| OAuth client ID |
61
+
|`OAUTH_CLIENT_SECRET`| OAuth client secret |
62
+
|`CERTIFICATE_TEMPLATE`| Certificate template short name |
63
+
|`CERTIFICATE_AUTHORITY_LOGICAL_NAME`| CA logical name in Command |
64
+
65
+
### Optional variables
66
+
67
+
| Variable | Description | Default |
68
+
|----------|-------------|---------|
69
+
|`IMAGE_TAG`| Docker image version to test |`2.5.0`|
70
+
|`HELM_CHART_VERSION`| Helm chart version |`2.5.0`|
71
+
|`E2E_ENROLLMENT_PATTERN_NAME`| Enrollment pattern name |`Default Pattern`|
72
+
|`E2E_OWNER_ROLE_NAME`| Owner role name |`InstanceOwner`|
73
+
|`DISABLE_CA_CHECK`| Skip TLS CA verification |`false`|
74
+
|`USE_MINIKUBE`| Use minikube instead of current kubeconfig |`false`|
75
+
|`IMAGE_REGISTRY`| Registry to push local builds (when `IMAGE_TAG=local`) | - |
39
76
40
77
## Configuring the trusted certificate store
78
+
41
79
The issuer created in the end-to-end tests can leverage the `caSecretName` specification to determine a collection of CAs to trust in order to establish a trusted connection with the remote Keyfactor Command instance. The certificates defined in this secret will be pulled from the `certs` folder in this directory.
42
80
43
-
Please place the CA certificates for the Keyfactor Command instance you'd like to connect to (the intermediate and/or root CAs) under `certs` directory.
81
+
Place the CA certificates for the Keyfactor Command instance you'd like to connect to (the intermediate and/or root CAs) under `certs` directory.
44
82
45
83
> NOTE: This check can be disabled by setting the env variable `DISABLE_CA_CHECK=true`.
46
84
47
-
## Running the script
85
+
## Running the tests
86
+
87
+
### Using current kubeconfig context (default)
88
+
89
+
```bash
90
+
# Configure your .env file first
91
+
source .env
92
+
93
+
# Run the tests
94
+
./run_tests.sh
95
+
```
96
+
97
+
Or from the project root:
98
+
```bash
99
+
make test-e2e
100
+
```
101
+
102
+
### Using minikube
48
103
49
104
```bash
50
-
# enable the script to be executed
51
-
chmod +x ./run_tests.sh
105
+
export USE_MINIKUBE=true
106
+
source .env
107
+
./run_tests.sh
108
+
```
109
+
110
+
### Testing a specific version
52
111
53
-
# load the environment variables
112
+
```bash
113
+
export IMAGE_TAG="2.4.0"
114
+
export HELM_CHART_VERSION="2.4.0"
54
115
source .env
116
+
./run_tests.sh
117
+
```
118
+
119
+
### Testing local changes
120
+
121
+
```bash
122
+
# With minikube (image built directly into minikube's docker)
123
+
export IMAGE_TAG="local"
124
+
export HELM_CHART_VERSION="local"
125
+
export USE_MINIKUBE=true
126
+
source .env
127
+
./run_tests.sh
55
128
56
-
# run the end-to-end tests
129
+
# With a remote cluster (requires pushing to a registry)
0 commit comments