Repository navigation
feat(chart): deprecate auth.clientSecret - #258
Conversation
tesk-api 1.2.0 and later treat the Swagger UI as a public client and ignore its client secret. Render the secret key only if the value is set, warn in the notes when it is, and document the deprecation and the upgrade steps. Closes #257 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Render the secret key empty when auth.clientSecret is unset, so an upgrade also clears a stored value; share an isSet helper; one notes warning (a public client needs no secret); tighten docs and schema. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideAPIUpdate the values schema to describe the deprecated
ImplementationAdd shared set-value detection and use it for the FTP and client-secret warnings, including values YAML may parse as
ConfigurationRender an empty OAuth Secret value when the deprecated client secret is unset, while retaining the environment-variable wiring for older API images.
DocumentationDocument the public-client recommendation, the deprecation, and the steps to remove and rotate the secret and restart the API if needed.
TestsCover empty and set client-secret rendering, warning behavior and redaction, and compatibility with the earlier chart's null value.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #258 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 229 229
=========================================
Hits 229 229 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="charts/tesk/templates/common/oauth-client-secret.yaml" line_range="17" />
<code_context>
+ Empty if unset, so that an upgrade also clears a value set before (Helm
+ can't remove a key of stringData from the stored data) */}}
+ {{- $secret := index $values "auth.clientSecret" }}
+ secret: {{ if include "tesk.isSet" $secret }}{{ include "tesk.secretValue" $secret }}{{ else }}""{{ end }}
{{- end }}
</code_context>
<issue_to_address>
**Removed secret remains stored**
When an operator removes `auth.clientSecret` from their values files and upgrades with `--reuse-values`, `tesk.resolveValues` retains the prior release value, so `tesk.isSet` treats it as set and the template renders the old secret. The Secret stays populated and older API images keep receiving the old value.
Update value resolution or the template so removing `auth.clientSecret` clears the Secret even when the upgrade uses `--reuse-values`.
</issue_to_address>
### Comment 2
<location path="docs/upgrading.md" line_range="20" />
<code_context>
+older tesk-api images, and its notes warn when it is set; a future release
+may remove it. When you upgrade:
+
+- Remove `auth.clientSecret` (or `auth.client_secret`) from your values
+ (e.g., `secrets.yaml`). The chart then sets the secret's `secret` key to
+ empty, which also clears the value stored before. Running pods keep the
</code_context>
<issue_to_address>
**Reuse upgrades retain the secret**
When operators use `--reuse-values` after removing the key only from their values files, when operators remove `auth.clientSecret` from their files but run `helm upgrade --reuse-values`, `tesk.resolveValues` still sees the value retained from the previous release and renders it as set. The Secret therefore keeps the old secret and the notes continue to warn; tell operators to upgrade without `--reuse-values` or explicitly override the value to null.
In the upgrade instructions, say to run without `--reuse-values` or explicitly set `auth.clientSecret=null` (and the legacy alias if applicable).
</issue_to_address>
### Comment 3
<location path="tests/test_chart.py" line_range="1079" />
<code_context>
assert get(manifests, "Secret", "oauth-client-secret")["stringData"] == {
"id": None,
- "secret": None,
+ "secret": "",
}
</code_context>
<issue_to_address>
**Unset-secret test description is false**
When `auth.clientSecret` is unset, `test_secret_unset` now expects the OAuth secret to be empty, but its docstring says unset credentials render as null; readers get the wrong description of the test's behavior.
Update the docstring to distinguish the FTP credentials, which remain null, from the OAuth client secret, which is empty.
</issue_to_address>Linked issues
#257 Deprecate the Swagger UI client secret value · 5 of 5 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Document the deprecation and tesk-api 1.2.0 behavior in the values file, schema, configuration reference, and deployment guide. | ✅ Met | The values file, schema, configuration reference, and deployment guide explain that the Swagger UI is a public client and tesk-api 1.2.0 and later ignore the secret. |
| 2 | Render the OAuth Secret's secret key empty when the value is unset, and preserve the value when it is set. |
✅ Met | The template renders an empty string when auth.clientSecret is unset or empty, and uses the secret value otherwise. |
| 3 | Warn in the notes when auth.clientSecret or auth.client_secret is set. |
✅ Met | The notes check the resolved value, including the legacy key, and the shared helper treats values such as 0 and false as set. |
| 4 | Document upgrade steps to remove the value, register a public client, and rotate the secret at the identity provider. | ✅ Met | The upgrading guide includes all three steps and explains that a restart may be needed to clear the value from running pods. |
| 5 | Add tests for the unset and set cases, and describe the deprecation in the docs and upgrade notes. | ✅ Met | Tests cover unset, empty, null, and set values, as well as the warning for the legacy key; the relevant documentation is updated. |
Sourcery assessment
Needs a human reviewer. 2 findings to address first, and when the deprecated value is unset, the chart writes an empty secret key, clearing the credential from the Kubernetes Secret. An older API image that still reads it could lose Swagger UI login; restoring the value and redeploying can repair this bounded configuration loss.
Blocking findings: charts/tesk/templates/common/oauth-client-secret.yaml:17, docs/upgrading.md:20
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Deprecates the chart value
auth.clientSecret(and its old keyauth.client_secret). The Swagger UI is a public client: its default implicit grant needs no secret, and tesk-api 1.2.0 and later ignoreTESK_API_SWAGGER_OAUTH_CLIENT_SECRET(elixir-cloud-aai/tesk-api#106).secretkey of theoauth-client-secretSecret is empty when the value is unset or empty (before, it was null, which Kubernetes also stores as empty). An upgrade without the value therefore also clears a value stored before; Helm can't remove astringDatakey from the stored data. A set value (also0orfalse) renders as before, and older tesk-api images still get it.tesk.isSet(set: not null, not empty) is shared by the Secret, this warning and the FTP warning.auth.clientSecretis deprecated itself.Closes #257
Verification
Full-review lane (Helm chart, 2 rounds).
tests/test_chart.py):secret), and set;0, the old key and withauth.mode=auth, never printing the value;test_secret_unsetupdated;secretas empty.REQUIRE_HELM=1 pytest testswith Helm 3.22.1: 344 passed.ruff check,ruff format --check,mypy tests,helm lint charts/tesk: pass.mkdocs build --strict: passes.Declined review findings
auth.client_secretunder renamed keys and then warn thatauth.clientSecretis deprecated. Both hold; the rename table in the upgrade notes now says so.auth.mode: noauth. Intended: the value is deprecated whatever the mode.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Deprecate the Swagger UI OAuth client secret and provide migration guidance for public OIDC client configuration.
Enhancements:
Documentation:
Tests: