Repository navigation
test(auth): fold repr and invalid-config errors into the sentinel test - #437
Merged
Merged
Conversation
CamundaSdkConfiguration is a plain pydantic model, so its generated repr printed every value it held: the OAuth client secret and its alias, the basic-auth password, the inline mTLS key and its passphrase. ResolvedCamundaSdkConfiguration is a dataclass whose generated repr nested the unfiltered environment and explicit partials on top of that, and _OAuthToken's printed the bearer token. Any print(client.configuration), %r in an f-string, or traceback renderer that shows locals wrote them out. The five credential-bearing configuration fields are now declared repr=False, _OAuthToken.access_token likewise, and ResolvedCamundaSdkConfiguration renders the shape of the two raw partials rather than their contents. Nothing else changes: the values are still readable by attribute and still present in model_dump(), so no caller breaks. The regression test derives the credential set from the model's own field names rather than listing the fields that leaked, so a credential field added later fails here without anyone remembering to extend the test. Closes #422 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Two configuration error paths put credential values verbatim into their message, and both fire at client construction -- process start-up -- where the traceback lands in application logs or a crash reporter. The alias-conflict error interpolated both sides with !r, and CAMUNDA_CLIENT_SECRET / CAMUNDA_CLIENT_AUTH_CLIENTSECRET is one of the alias pairs. It now renders a placeholder for the keys in the credential set and keeps the real values for the others, so a REST-address conflict is still diagnosable. A pydantic ValidationError records the input it was handed on every error, so a required-when failure repeated the whole merged configuration, credentials included. The resolver now validates a redacted copy to obtain the same diagnosis without them -- the model's validators test for presence, not content, so a placeholder is rejected exactly where the real value was -- and raises that, with the original suppressed so a chained traceback cannot print it. The exception type is unchanged. In the one case where the rejected value is itself a credential, the redacted copy validates and the errors are rendered without their input instead; that is a ValueError, which ValidationError already is. Closes #423 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
The shared policy requires one in every SDK and this repo had none: searching the test tree for a sentinel value, or for any assertion that a credential is absent from logs, exceptions or telemetry, returned nothing. The auth tests exercise the credential paths but never assert non-disclosure, and they use client_secret="secret", a value too common to assert against. Configures a recognisable sentinel as the OAuth client secret and as the basic auth password, drives the auth success and failure paths with it -- token fetch and authenticated call, a 401 and its memoized repeat, a non-401, a failing API call with trace-level body logging, and the async equivalents -- and asserts the sentinel reaches none of: the records of a capturing logger installed at trace, str() and repr() of every exception raised (including a pydantic ValidationError's errors()), the rendered client and auth provider, or the name or contents of any file the SDK wrote into the token cache directory. For basic auth the encoded Authorization header is checked as well as the password itself. A guard test fails if a credential-shaped configuration field appears that the file neither drives nor explicitly excludes, so extending it is not left to memory. The mTLS key and its passphrase are the current exclusions: they must be real PEM material or no TLS context can be built. Checked that it bites: logging the client secret from the token request fails four of the tests, and writing it into the token cache file fails three. Refs #425 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
CI's escape-hatch guard failed: the three new helpers raised the `any` count in runtime/ from 371 to 375. None of them needs Any. _render_config_value only reprs its value, and the redaction pair only copies a mapping and compares it, so object expresses all three exactly and keeps the baseline where it was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
From Copilot's review: the placeholder is non-empty, so redacting an empty credential let the redacted copy pass a presence check the real configuration failed. BASIC auth with a username and CAMUNDA_BASIC_AUTH_PASSWORD="" therefore raised a plain ValueError rather than the ValidationError naming the missing password, and an empty credential alongside another error lost its diagnosis entirely. An empty value is not a secret, so it is now left alone. Two tests cover it; the first fails against the previous redaction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
From Copilot's review. The SaaS 401 tarpit was never driven: every OAuth case used auth.local, and the tarpit file is written only for login.cloud.camunda.io. It is keyed on a hash of the client secret, so its name is exactly the kind of place a regression would put one. Sync and async cases now drive it and assert the file exists before inspecting its name and contents; putting the raw secret in that filename fails both. The surface collector recorded only repr(), so a __str__ that discloses what __repr__ hides would have passed. It now records both. The cache sweep visited only immediate children, so the async failure client's nested cache directory was never read. It is recursive now. The async success request was allowed to raise and still satisfy the test's "something raised" assertion. It now has to return 200 and leave a cached token, and the 401 has to raise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
…25-sentinel-repr-and-errors
…25-sentinel-repr-and-errors
The sentinel-secret test drove the auth success and failure paths but did not cover two surfaces the audit named: repr()/str() of the configuration objects and the errors raised for an invalid configuration. Both are now asserted, for every credential field (driven and undriven alike), for both client flavours, for resolver alias conflicts in explicit and environment configuration, and for a credential rejected for its type. The client's effective configuration is also rendered by every existing driven test through the shared surface collector. Stacked on #430, #431 and #435: against main without them the new assertions fail, with them they pass. Refs #425 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Configuration-error sanitization can drop credential diagnostics, while acceptance tests swallow request failures and miss potential secret exposure in exception chains.
4 open issues
What changed in this PR
Extends the SDK’s sentinel-secret regression coverage for #425 to configuration rendering and invalid-configuration errors. The current stacked diff also includes the prerequisite redaction fixes and tests from #430, #431 and #435.
Changes:
- Checks configuration and OAuth token
repr()/str()for credential disclosure. - Covers construction failures, alias conflicts and invalid credential types.
- Includes prerequisite runtime redaction changes and synchronized generated output.
| File | Description |
|---|---|
tests/acceptance/test_secret_repr_redaction.py |
Tests credential-safe configuration and token rendering. |
tests/acceptance/test_secret_redaction_in_errors.py |
Tests redacted errors and preserved diagnostics. |
tests/acceptance/test_secret_non_disclosure.py |
Adds sentinel coverage across authentication, rendering and configuration errors. |
stubs/camunda_orchestration_sdk/runtime/configuration_resolver.pyi |
Reflects configuration redaction changes. |
stubs/camunda_orchestration_sdk/runtime/auth.pyi |
Reflects hidden token rendering. |
runtime/configuration_resolver.py |
Redacts credentials from configuration rendering and errors. |
runtime/auth.py |
Excludes bearer tokens from dataclass rendering. |
generated/camunda_orchestration_sdk/runtime/configuration_resolver.py |
Carries configuration redaction into the generated SDK. |
generated/camunda_orchestration_sdk/runtime/auth.py |
Carries token-rendering protection into the generated SDK. |
Review effort: Balanced
…he success paths Walk the visible cause/context chain of every raised error (honouring raise-from-None), require the sync OAuth success request and the first basic-auth request to succeed, and require the basic-auth 401 to raise UnauthorizedError (its mock body was malformed, so the client raised a parse error instead). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
…is also invalid The redacted copy accepts the placeholder for a non-string credential, so its own type error vanishes from the copy. When another field was also invalid the copy still failed, and that failure was returned as the whole diagnosis, silently dropping the credential's error. Return the redacted copy's error only when its locations, types and messages match the original's; otherwise render the original's errors without their input. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
…ion fix Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Inspect exception chains and formatted tracebacks, require the intended SDK exceptions (complete problem-detail fixtures, strict success status), and add async coverage for basic auth and the async tarpit rejection. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
…tion chain Render the formatted traceback and every visible cause or context, and assert that the validation error suppresses the credential-bearing original, so removing `from None` fails the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Resolved the overlap in the sentinel test in favour of the #435 helpers (drive_expecting, shared problem-detail fixture, ordered exception chain). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
…tured logs The non-disclosure suite declared CAMUNDA_CLIENT_AUTH_CLIENTSECRET as driven but no test set it. Every OAuth test now runs once per name the secret is accepted under, a guard ties the declared set to the fields the tests are parametrised over, and the alias is also driven from the environment. The capturing logger recorded repr of the raw arguments only. It now also renders the message as a brace-style sink would (positional, indexed and keyword placeholders) and a single mapping argument for percent-style, and records str of every structured field (keyword arguments, extra, nested containers). The stdlib collector records the attributes added by extra, which the default formatter never prints. Self-tests plant a value whose repr is opaque and whose str carries the sentinel in each shape; all of them were missed before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
When both names of an alias pair were set to different values, the resolver raised a ValueError that quoted both with repr. For CAMUNDA_CLIENT_SECRET and CAMUNDA_CLIENT_AUTH_CLIENTSECRET that put the client secret in the exception text, which reaches the operator's terminal and crash reports. The message still names both settings and says they conflict, but the value of a credential-shaped setting (name containing SECRET, PASSWORD, PASSPHRASE or KEY) is shown as <redacted>. Non-secret pairs such as the REST address keep quoting both values, which is what makes the conflict actionable. Found by driving CAMUNDA_CLIENT_AUTH_CLIENTSECRET in the sentinel non-disclosure suite; the conflict test fails before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
The generated runtime copy of configuration_resolver.py and its stub now carry the credential redaction added to the alias conflict messages. The runtime file is copied and formatted exactly as the generation step does, and the stub is produced by the stub hook. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
The previous two commits redacted credential values in the alias conflict errors, but that leak is already fixed by the configuration error redaction in #431, with a shared set of credential keys. Carrying a second implementation here would conflict with it when both land, and this PR is test-only. This reverts the redaction, its generated copy and stub, and the two tests that needed it. The sentinel suite still drives the client secret alias end to end; the alias conflict error is asserted by the stacked suite, which includes that fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
Main took the squash of #431 and #435, which added the same test_secret_non_disclosure.py this branch had grown. The add/add conflict is resolved by keeping this branch's version: main's file is a strict subset of it (every conflict hunk had an empty main side). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda
emilyoram
approved these changes
Nov 19, 2026
emilyoram
left a comment
Collaborator
There was a problem hiding this comment.
Approved: CI green and Copilot review recommends approval.
Contributor
|
Successfully created backport PR for |
Contributor
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-437-to-stable/9
git worktree add --checkout .worktree/backport-437-to-stable/9 backport-437-to-stable/9
cd .worktree/backport-437-to-stable/9
git reset --hard HEAD^
git cherry-pick -x 2f2900eba2d9b1358b351e02044a2728a810f0e3 |
camunda-sdk-automation Bot
pushed a commit
that referenced
this pull request
Nov 30, 2026
Cherry-picked from #437 onto stable/9 with conflicts. The conflict markers are committed as-is and must be resolved before this backport is merged.
jwulf
pushed a commit
that referenced
this pull request
Nov 30, 2026
#437) * fix(config): keep credentials out of repr() and str() CamundaSdkConfiguration is a plain pydantic model, so its generated repr printed every value it held: the OAuth client secret and its alias, the basic-auth password, the inline mTLS key and its passphrase. ResolvedCamundaSdkConfiguration is a dataclass whose generated repr nested the unfiltered environment and explicit partials on top of that, and _OAuthToken's printed the bearer token. Any print(client.configuration), %r in an f-string, or traceback renderer that shows locals wrote them out. The five credential-bearing configuration fields are now declared repr=False, _OAuthToken.access_token likewise, and ResolvedCamundaSdkConfiguration renders the shape of the two raw partials rather than their contents. Nothing else changes: the values are still readable by attribute and still present in model_dump(), so no caller breaks. The regression test derives the credential set from the model's own field names rather than listing the fields that leaked, so a credential field added later fails here without anyone remembering to extend the test. Closes #422 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for credential repr redaction Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): stop configuration errors echoing credentials Two configuration error paths put credential values verbatim into their message, and both fire at client construction -- process start-up -- where the traceback lands in application logs or a crash reporter. The alias-conflict error interpolated both sides with !r, and CAMUNDA_CLIENT_SECRET / CAMUNDA_CLIENT_AUTH_CLIENTSECRET is one of the alias pairs. It now renders a placeholder for the keys in the credential set and keeps the real values for the others, so a REST-address conflict is still diagnosable. A pydantic ValidationError records the input it was handed on every error, so a required-when failure repeated the whole merged configuration, credentials included. The resolver now validates a redacted copy to obtain the same diagnosis without them -- the model's validators test for presence, not content, so a placeholder is rejected exactly where the real value was -- and raises that, with the original suppressed so a chained traceback cannot print it. The exception type is unchanged. In the one case where the rejected value is itself a credential, the redacted copy validates and the errors are rendered without their input instead; that is a ValueError, which ValidationError already is. Closes #423 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for redacted configuration errors Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): add the sentinel-secret regression test The shared policy requires one in every SDK and this repo had none: searching the test tree for a sentinel value, or for any assertion that a credential is absent from logs, exceptions or telemetry, returned nothing. The auth tests exercise the credential paths but never assert non-disclosure, and they use client_secret="secret", a value too common to assert against. Configures a recognisable sentinel as the OAuth client secret and as the basic auth password, drives the auth success and failure paths with it -- token fetch and authenticated call, a 401 and its memoized repeat, a non-401, a failing API call with trace-level body logging, and the async equivalents -- and asserts the sentinel reaches none of: the records of a capturing logger installed at trace, str() and repr() of every exception raised (including a pydantic ValidationError's errors()), the rendered client and auth provider, or the name or contents of any file the SDK wrote into the token cache directory. For basic auth the encoded Authorization header is checked as well as the password itself. A guard test fails if a credential-shaped configuration field appears that the file neither drives nor explicitly excludes, so extending it is not left to memory. The mTLS key and its passphrase are the current exclusions: they must be real PEM material or no TLS context can be built. Checked that it bites: logging the client secret from the token request fails four of the tests, and writing it into the token cache file fails three. Refs #425 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): type the redaction helpers with object, not Any CI's escape-hatch guard failed: the three new helpers raised the `any` count in runtime/ from 371 to 375. None of them needs Any. _render_config_value only reprs its value, and the redaction pair only copies a mapping and compares it, so object expresses all three exactly and keeps the baseline where it was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the redaction helper signatures Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): leave empty credentials unredacted From Copilot's review: the placeholder is non-empty, so redacting an empty credential let the redacted copy pass a presence check the real configuration failed. BASIC auth with a username and CAMUNDA_BASIC_AUTH_PASSWORD="" therefore raised a plain ValueError rather than the ValidationError naming the missing password, and an empty credential alongside another error lost its diagnosis entirely. An empty value is not a secret, so it is now left alone. Two tests cover it; the first fails against the previous redaction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the empty-credential redaction fix Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): close four gaps in the sentinel test From Copilot's review. The SaaS 401 tarpit was never driven: every OAuth case used auth.local, and the tarpit file is written only for login.cloud.camunda.io. It is keyed on a hash of the client secret, so its name is exactly the kind of place a regression would put one. Sync and async cases now drive it and assert the file exists before inspecting its name and contents; putting the raw secret in that filename fails both. The surface collector recorded only repr(), so a __str__ that discloses what __repr__ hides would have passed. It now records both. The cache sweep visited only immediate children, so the async failure client's nested cache directory was never read. It is recursive now. The async success request was allowed to raise and still satisfy the test's "something raised" assertion. It now has to return 200 and leave a cached token, and the 401 has to raise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): fold repr and invalid-config errors into the sentinel test The sentinel-secret test drove the auth success and failure paths but did not cover two surfaces the audit named: repr()/str() of the configuration objects and the errors raised for an invalid configuration. Both are now asserted, for every credential field (driven and undriven alike), for both client flavours, for resolver alias conflicts in explicit and environment configuration, and for a credential rejected for its type. The client's effective configuration is also rendered by every existing driven test through the shared surface collector. Stacked on #430, #431 and #435: against main without them the new assertions fail, with them they pass. Refs #425 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: address review comments - check exception chains and require the success paths Walk the visible cause/context chain of every raised error (honouring raise-from-None), require the sync OAuth success request and the first basic-auth request to succeed, and require the basic-auth 401 to raise UnauthorizedError (its mock body was malformed, so the client raised a parse error instead). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): keep a rejected credential's error when another field is also invalid The redacted copy accepts the placeholder for a non-string credential, so its own type error vanishes from the copy. When another field was also invalid the copy still failed, and that failure was returned as the whole diagnosis, silently dropping the credential's error. Return the redacted copy's error only when its locations, types and messages match the original's; otherwise render the original's errors without their input. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the mixed-invalid-fields redaction fix Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): tighten the sentinel test per review Inspect exception chains and formatted tracebacks, require the intended SDK exceptions (complete problem-detail fixtures, strict success status), and add async coverage for basic auth and the async tarpit rejection. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): assert credential suppression across the visible exception chain Render the formatted traceback and every visible cause or context, and assert that the validation error suppresses the credential-bearing original, so removing `from None` fails the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): require the expected errors in the sync OAuth failure tests Assert HTTPStatusError with the mocked status for each token endpoint failure, that the non-SaaS repeat reuses the memoized 401, and that the SaaS repeat raises the tarpit RuntimeError, so none can pass on an unrelated exception. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: require the expected errors in the configuration-rejection sentinel tests Use drive_expecting for the construction, alias-conflict and rejected-type cases so none can pass on an unrelated exception, and require the diagnostic to name the credential field. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the memoized-401 sentinel test with a manual clock The memoized error only holds for a cooldown measured on the clock, so a live clock made the repeat race runner pauses and wall-clock adjustments. Inject ManualClock so the branch is exercised deterministically. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render client and provider again after requests The non-disclosure tests rendered the client and auth provider only at construction, so state a provider acquires while serving a request (a cached token, a memoized failure) was never checked. Render both again after the requests are driven, in the sync and async tests. A collector self-test shows a leak that exists only after a request is missed by the pre-request snapshot and caught by the new one. A temporary runtime mutation that put the secret in the provider repr once a token was held fails three tests with this change and none without it. Decision record: #444 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): widen the sentinel test per review Capture stdlib logging at DEBUG as well as the injected logger, since httpx and httpcore log there. Check the access token the endpoint issued on every OAuth success path, excluding only the token cache file contents where it is meant to live. Add async equivalents of the memoized 401, the non-401 token endpoint failure and the failing API call with trace-level body logging, which run separate async code. Collector self-tests cover the new checks, and temporary runtime mutations (reverted) that log the bearer header in the async request hook, put the secret in the async memoized 401, or log it through a stdlib logger each fail the new tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): format logged exceptions and narrow the token exemption The stdlib collector read record.exc_text, which stays None until a formatter has run, so a credential in a logged exception passed unless another handler happened to format the record first. Use the handler's format(), which renders the exception and stack whatever the handler order. The issued-token check exempted every file under the cache directory. Exempt only the access_token field of oauth-token-*.json files directly in it, and keep inspecting every other field, every other file and every nested directory. A file that is not a JSON object is not exempt at all. Both are red-first: a record handed straight to the collector, and a stray file, a nested cache file and extra cache fields holding the token, each failed before the change. Temporary runtime mutations (reverted) that write the token to a diagnostics file, copy it into an extra cache field, or log it in an exception each fail the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render logged messages and exc_info as a sink prints them The capturing logger kept only repr() of the raw arguments. A stdlib style sink prints msg % args, which applies str() to each argument, and prints the whole traceback chain for exc_info, so a credential visible only through str() or through the cause of a logged exception passed the non-disclosure assertions. Record the formatted message and, for exc_info given as True, an exception instance or a tuple, the formatted traceback with its chain. A bad format string is recorded as passed rather than raising, as a sink reports it rather than crashing the caller. Red-first: a collector self-test logs a value whose str() leaks but whose repr() does not, and a secret in the cause of an exc_info exception in all three forms, and it failed before the change. With a temporary runtime mutation (reverted) that logs such an exception, the old collector passes and the new one fails five tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the client secret alias and render brace and structured logs The non-disclosure suite declared CAMUNDA_CLIENT_AUTH_CLIENTSECRET as driven but no test set it. Every OAuth test now runs once per name the secret is accepted under, a guard ties the declared set to the fields the tests are parametrised over, and the alias is also driven from the environment. The capturing logger recorded repr of the raw arguments only. It now also renders the message as a brace-style sink would (positional, indexed and keyword placeholders) and a single mapping argument for percent-style, and records str of every structured field (keyword arguments, extra, nested containers). The stdlib collector records the attributes added by extra, which the default formatter never prints. Self-tests plant a value whose repr is opaque and whose str carries the sentinel in each shape; all of them were missed before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): do not quote credential values in alias conflict errors When both names of an alias pair were set to different values, the resolver raised a ValueError that quoted both with repr. For CAMUNDA_CLIENT_SECRET and CAMUNDA_CLIENT_AUTH_CLIENTSECRET that put the client secret in the exception text, which reaches the operator's terminal and crash reports. The message still names both settings and says they conflict, but the value of a credential-shaped setting (name containing SECRET, PASSWORD, PASSPHRASE or KEY) is shown as <redacted>. Non-secret pairs such as the REST address keep quoting both values, which is what makes the conflict actionable. Found by driving CAMUNDA_CLIENT_AUTH_CLIENTSECRET in the sentinel non-disclosure suite; the conflict test fails before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(gen): regenerate for redacted alias conflict errors The generated runtime copy of configuration_resolver.py and its stub now carry the credential redaction added to the alias conflict messages. The runtime file is copied and formatted exactly as the generation step does, and the stub is produced by the stub hook. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: leave alias conflict redaction to the fix PR The previous two commits redacted credential values in the alias conflict errors, but that leak is already fixed by the configuration error redaction in #431, with a shared set of credential keys. Carrying a second implementation here would conflict with it when both land, and this PR is test-only. This reverts the redaction, its generated copy and stub, and the two tests that needed it. The sentinel suite still drives the client secret alias end to end; the alias conflict error is asserted by the stacked suite, which includes that fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda --------- Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 2f2900e)
jwulf
pushed a commit
that referenced
this pull request
Nov 30, 2026
#437) * fix(config): keep credentials out of repr() and str() CamundaSdkConfiguration is a plain pydantic model, so its generated repr printed every value it held: the OAuth client secret and its alias, the basic-auth password, the inline mTLS key and its passphrase. ResolvedCamundaSdkConfiguration is a dataclass whose generated repr nested the unfiltered environment and explicit partials on top of that, and _OAuthToken's printed the bearer token. Any print(client.configuration), %r in an f-string, or traceback renderer that shows locals wrote them out. The five credential-bearing configuration fields are now declared repr=False, _OAuthToken.access_token likewise, and ResolvedCamundaSdkConfiguration renders the shape of the two raw partials rather than their contents. Nothing else changes: the values are still readable by attribute and still present in model_dump(), so no caller breaks. The regression test derives the credential set from the model's own field names rather than listing the fields that leaked, so a credential field added later fails here without anyone remembering to extend the test. Closes #422 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for credential repr redaction Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): stop configuration errors echoing credentials Two configuration error paths put credential values verbatim into their message, and both fire at client construction -- process start-up -- where the traceback lands in application logs or a crash reporter. The alias-conflict error interpolated both sides with !r, and CAMUNDA_CLIENT_SECRET / CAMUNDA_CLIENT_AUTH_CLIENTSECRET is one of the alias pairs. It now renders a placeholder for the keys in the credential set and keeps the real values for the others, so a REST-address conflict is still diagnosable. A pydantic ValidationError records the input it was handed on every error, so a required-when failure repeated the whole merged configuration, credentials included. The resolver now validates a redacted copy to obtain the same diagnosis without them -- the model's validators test for presence, not content, so a placeholder is rejected exactly where the real value was -- and raises that, with the original suppressed so a chained traceback cannot print it. The exception type is unchanged. In the one case where the rejected value is itself a credential, the redacted copy validates and the errors are rendered without their input instead; that is a ValueError, which ValidationError already is. Closes #423 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for redacted configuration errors Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): add the sentinel-secret regression test The shared policy requires one in every SDK and this repo had none: searching the test tree for a sentinel value, or for any assertion that a credential is absent from logs, exceptions or telemetry, returned nothing. The auth tests exercise the credential paths but never assert non-disclosure, and they use client_secret="secret", a value too common to assert against. Configures a recognisable sentinel as the OAuth client secret and as the basic auth password, drives the auth success and failure paths with it -- token fetch and authenticated call, a 401 and its memoized repeat, a non-401, a failing API call with trace-level body logging, and the async equivalents -- and asserts the sentinel reaches none of: the records of a capturing logger installed at trace, str() and repr() of every exception raised (including a pydantic ValidationError's errors()), the rendered client and auth provider, or the name or contents of any file the SDK wrote into the token cache directory. For basic auth the encoded Authorization header is checked as well as the password itself. A guard test fails if a credential-shaped configuration field appears that the file neither drives nor explicitly excludes, so extending it is not left to memory. The mTLS key and its passphrase are the current exclusions: they must be real PEM material or no TLS context can be built. Checked that it bites: logging the client secret from the token request fails four of the tests, and writing it into the token cache file fails three. Refs #425 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): type the redaction helpers with object, not Any CI's escape-hatch guard failed: the three new helpers raised the `any` count in runtime/ from 371 to 375. None of them needs Any. _render_config_value only reprs its value, and the redaction pair only copies a mapping and compares it, so object expresses all three exactly and keeps the baseline where it was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the redaction helper signatures Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): leave empty credentials unredacted From Copilot's review: the placeholder is non-empty, so redacting an empty credential let the redacted copy pass a presence check the real configuration failed. BASIC auth with a username and CAMUNDA_BASIC_AUTH_PASSWORD="" therefore raised a plain ValueError rather than the ValidationError naming the missing password, and an empty credential alongside another error lost its diagnosis entirely. An empty value is not a secret, so it is now left alone. Two tests cover it; the first fails against the previous redaction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the empty-credential redaction fix Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): close four gaps in the sentinel test From Copilot's review. The SaaS 401 tarpit was never driven: every OAuth case used auth.local, and the tarpit file is written only for login.cloud.camunda.io. It is keyed on a hash of the client secret, so its name is exactly the kind of place a regression would put one. Sync and async cases now drive it and assert the file exists before inspecting its name and contents; putting the raw secret in that filename fails both. The surface collector recorded only repr(), so a __str__ that discloses what __repr__ hides would have passed. It now records both. The cache sweep visited only immediate children, so the async failure client's nested cache directory was never read. It is recursive now. The async success request was allowed to raise and still satisfy the test's "something raised" assertion. It now has to return 200 and leave a cached token, and the 401 has to raise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): fold repr and invalid-config errors into the sentinel test The sentinel-secret test drove the auth success and failure paths but did not cover two surfaces the audit named: repr()/str() of the configuration objects and the errors raised for an invalid configuration. Both are now asserted, for every credential field (driven and undriven alike), for both client flavours, for resolver alias conflicts in explicit and environment configuration, and for a credential rejected for its type. The client's effective configuration is also rendered by every existing driven test through the shared surface collector. Stacked on #430, #431 and #435: against main without them the new assertions fail, with them they pass. Refs #425 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: address review comments - check exception chains and require the success paths Walk the visible cause/context chain of every raised error (honouring raise- from-None), require the sync OAuth success request and the first basic-auth request to succeed, and require the basic-auth 401 to raise UnauthorizedError (its mock body was malformed, so the client raised a parse error instead). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): keep a rejected credential's error when another field is also invalid The redacted copy accepts the placeholder for a non-string credential, so its own type error vanishes from the copy. When another field was also invalid the copy still failed, and that failure was returned as the whole diagnosis, silently dropping the credential's error. Return the redacted copy's error only when its locations, types and messages match the original's; otherwise render the original's errors without their input. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the mixed-invalid-fields redaction fix Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): tighten the sentinel test per review Inspect exception chains and formatted tracebacks, require the intended SDK exceptions (complete problem-detail fixtures, strict success status), and add async coverage for basic auth and the async tarpit rejection. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): assert credential suppression across the visible exception chain Render the formatted traceback and every visible cause or context, and assert that the validation error suppresses the credential-bearing original, so removing `from None` fails the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): require the expected errors in the sync OAuth failure tests Assert HTTPStatusError with the mocked status for each token endpoint failure, that the non-SaaS repeat reuses the memoized 401, and that the SaaS repeat raises the tarpit RuntimeError, so none can pass on an unrelated exception. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: require the expected errors in the configuration-rejection sentinel tests Use drive_expecting for the construction, alias-conflict and rejected-type cases so none can pass on an unrelated exception, and require the diagnostic to name the credential field. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the memoized-401 sentinel test with a manual clock The memoized error only holds for a cooldown measured on the clock, so a live clock made the repeat race runner pauses and wall-clock adjustments. Inject ManualClock so the branch is exercised deterministically. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render client and provider again after requests The non-disclosure tests rendered the client and auth provider only at construction, so state a provider acquires while serving a request (a cached token, a memoized failure) was never checked. Render both again after the requests are driven, in the sync and async tests. A collector self-test shows a leak that exists only after a request is missed by the pre-request snapshot and caught by the new one. A temporary runtime mutation that put the secret in the provider repr once a token was held fails three tests with this change and none without it. Decision record: #444 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): widen the sentinel test per review Capture stdlib logging at DEBUG as well as the injected logger, since httpx and httpcore log there. Check the access token the endpoint issued on every OAuth success path, excluding only the token cache file contents where it is meant to live. Add async equivalents of the memoized 401, the non-401 token endpoint failure and the failing API call with trace-level body logging, which run separate async code. Collector self-tests cover the new checks, and temporary runtime mutations (reverted) that log the bearer header in the async request hook, put the secret in the async memoized 401, or log it through a stdlib logger each fail the new tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): format logged exceptions and narrow the token exemption The stdlib collector read record.exc_text, which stays None until a formatter has run, so a credential in a logged exception passed unless another handler happened to format the record first. Use the handler's format(), which renders the exception and stack whatever the handler order. The issued-token check exempted every file under the cache directory. Exempt only the access_token field of oauth-token-*.json files directly in it, and keep inspecting every other field, every other file and every nested directory. A file that is not a JSON object is not exempt at all. Both are red-first: a record handed straight to the collector, and a stray file, a nested cache file and extra cache fields holding the token, each failed before the change. Temporary runtime mutations (reverted) that write the token to a diagnostics file, copy it into an extra cache field, or log it in an exception each fail the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render logged messages and exc_info as a sink prints them The capturing logger kept only repr() of the raw arguments. A stdlib style sink prints msg % args, which applies str() to each argument, and prints the whole traceback chain for exc_info, so a credential visible only through str() or through the cause of a logged exception passed the non-disclosure assertions. Record the formatted message and, for exc_info given as True, an exception instance or a tuple, the formatted traceback with its chain. A bad format string is recorded as passed rather than raising, as a sink reports it rather than crashing the caller. Red-first: a collector self-test logs a value whose str() leaks but whose repr() does not, and a secret in the cause of an exc_info exception in all three forms, and it failed before the change. With a temporary runtime mutation (reverted) that logs such an exception, the old collector passes and the new one fails five tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the client secret alias and render brace and structured logs The non-disclosure suite declared CAMUNDA_CLIENT_AUTH_CLIENTSECRET as driven but no test set it. Every OAuth test now runs once per name the secret is accepted under, a guard ties the declared set to the fields the tests are parametrised over, and the alias is also driven from the environment. The capturing logger recorded repr of the raw arguments only. It now also renders the message as a brace-style sink would (positional, indexed and keyword placeholders) and a single mapping argument for percent-style, and records str of every structured field (keyword arguments, extra, nested containers). The stdlib collector records the attributes added by extra, which the default formatter never prints. Self-tests plant a value whose repr is opaque and whose str carries the sentinel in each shape; all of them were missed before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): do not quote credential values in alias conflict errors When both names of an alias pair were set to different values, the resolver raised a ValueError that quoted both with repr. For CAMUNDA_CLIENT_SECRET and CAMUNDA_CLIENT_AUTH_CLIENTSECRET that put the client secret in the exception text, which reaches the operator's terminal and crash reports. The message still names both settings and says they conflict, but the value of a credential-shaped setting (name containing SECRET, PASSWORD, PASSPHRASE or KEY) is shown as <redacted>. Non-secret pairs such as the REST address keep quoting both values, which is what makes the conflict actionable. Found by driving CAMUNDA_CLIENT_AUTH_CLIENTSECRET in the sentinel non-disclosure suite; the conflict test fails before this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(gen): regenerate for redacted alias conflict errors The generated runtime copy of configuration_resolver.py and its stub now carry the credential redaction added to the alias conflict messages. The runtime file is copied and formatted exactly as the generation step does, and the stub is produced by the stub hook. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: leave alias conflict redaction to the fix PR The previous two commits redacted credential values in the alias conflict errors, but that leak is already fixed by the configuration error redaction in #431, with a shared set of credential keys. Carrying a second implementation here would conflict with it when both land, and this PR is test-only. This reverts the redaction, its generated copy and stub, and the two tests that needed it. The sentinel suite still drives the client secret alias end to end; the alias conflict error is asserted by the stacked suite, which includes that fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda --------- Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 2f2900e)
jwulf
added a commit
that referenced
this pull request
Nov 30, 2026
#437) (#532) * fix(config): keep credentials out of repr() and str() CamundaSdkConfiguration is a plain pydantic model, so its generated repr printed every value it held: the OAuth client secret and its alias, the basic-auth password, the inline mTLS key and its passphrase. ResolvedCamundaSdkConfiguration is a dataclass whose generated repr nested the unfiltered environment and explicit partials on top of that, and _OAuthToken's printed the bearer token. Any print(client.configuration), %r in an f-string, or traceback renderer that shows locals wrote them out. The five credential-bearing configuration fields are now declared repr=False, _OAuthToken.access_token likewise, and ResolvedCamundaSdkConfiguration renders the shape of the two raw partials rather than their contents. Nothing else changes: the values are still readable by attribute and still present in model_dump(), so no caller breaks. The regression test derives the credential set from the model's own field names rather than listing the fields that leaked, so a credential field added later fails here without anyone remembering to extend the test. Closes #422 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for credential repr redaction Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): stop configuration errors echoing credentials Two configuration error paths put credential values verbatim into their message, and both fire at client construction -- process start-up -- where the traceback lands in application logs or a crash reporter. The alias-conflict error interpolated both sides with !r, and CAMUNDA_CLIENT_SECRET / CAMUNDA_CLIENT_AUTH_CLIENTSECRET is one of the alias pairs. It now renders a placeholder for the keys in the credential set and keeps the real values for the others, so a REST-address conflict is still diagnosable. A pydantic ValidationError records the input it was handed on every error, so a required-when failure repeated the whole merged configuration, credentials included. The resolver now validates a redacted copy to obtain the same diagnosis without them -- the model's validators test for presence, not content, so a placeholder is rejected exactly where the real value was -- and raises that, with the original suppressed so a chained traceback cannot print it. The exception type is unchanged. In the one case where the rejected value is itself a credential, the redacted copy validates and the errors are rendered without their input instead; that is a ValueError, which ValidationError already is. Closes #423 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for redacted configuration errors Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): add the sentinel-secret regression test The shared policy requires one in every SDK and this repo had none: searching the test tree for a sentinel value, or for any assertion that a credential is absent from logs, exceptions or telemetry, returned nothing. The auth tests exercise the credential paths but never assert non-disclosure, and they use client_secret="secret", a value too common to assert against. Configures a recognisable sentinel as the OAuth client secret and as the basic auth password, drives the auth success and failure paths with it -- token fetch and authenticated call, a 401 and its memoized repeat, a non-401, a failing API call with trace-level body logging, and the async equivalents -- and asserts the sentinel reaches none of: the records of a capturing logger installed at trace, str() and repr() of every exception raised (including a pydantic ValidationError's errors()), the rendered client and auth provider, or the name or contents of any file the SDK wrote into the token cache directory. For basic auth the encoded Authorization header is checked as well as the password itself. A guard test fails if a credential-shaped configuration field appears that the file neither drives nor explicitly excludes, so extending it is not left to memory. The mTLS key and its passphrase are the current exclusions: they must be real PEM material or no TLS context can be built. Checked that it bites: logging the client secret from the token request fails four of the tests, and writing it into the token cache file fails three. Refs #425 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): type the redaction helpers with object, not Any CI's escape-hatch guard failed: the three new helpers raised the `any` count in runtime/ from 371 to 375. None of them needs Any. _render_config_value only reprs its value, and the redaction pair only copies a mapping and compares it, so object expresses all three exactly and keeps the baseline where it was. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the redaction helper signatures Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): leave empty credentials unredacted From Copilot's review: the placeholder is non-empty, so redacting an empty credential let the redacted copy pass a presence check the real configuration failed. BASIC auth with a username and CAMUNDA_BASIC_AUTH_PASSWORD="" therefore raised a plain ValueError rather than the ValidationError naming the missing password, and an empty credential alongside another error lost its diagnosis entirely. An empty value is not a secret, so it is now left alone. Two tests cover it; the first fails against the previous redaction. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the empty-credential redaction fix Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): close four gaps in the sentinel test From Copilot's review. The SaaS 401 tarpit was never driven: every OAuth case used auth.local, and the tarpit file is written only for login.cloud.camunda.io. It is keyed on a hash of the client secret, so its name is exactly the kind of place a regression would put one. Sync and async cases now drive it and assert the file exists before inspecting its name and contents; putting the raw secret in that filename fails both. The surface collector recorded only repr(), so a __str__ that discloses what __repr__ hides would have passed. It now records both. The cache sweep visited only immediate children, so the async failure client's nested cache directory was never read. It is recursive now. The async success request was allowed to raise and still satisfy the test's "something raised" assertion. It now has to return 200 and leave a cached token, and the 401 has to raise. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): fold repr and invalid-config errors into the sentinel test The sentinel-secret test drove the auth success and failure paths but did not cover two surfaces the audit named: repr()/str() of the configuration objects and the errors raised for an invalid configuration. Both are now asserted, for every credential field (driven and undriven alike), for both client flavours, for resolver alias conflicts in explicit and environment configuration, and for a credential rejected for its type. The client's effective configuration is also rendered by every existing driven test through the shared surface collector. Stacked on #430, #431 and #435: against main without them the new assertions fail, with them they pass. Refs #425 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: address review comments - check exception chains and require the success paths Walk the visible cause/context chain of every raised error (honouring raise-from-None), require the sync OAuth success request and the first basic-auth request to succeed, and require the basic-auth 401 to raise UnauthorizedError (its mock body was malformed, so the client raised a parse error instead). Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): keep a rejected credential's error when another field is also invalid The redacted copy accepts the placeholder for a non-string credential, so its own type error vanishes from the copy. When another field was also invalid the copy still failed, and that failure was returned as the whole diagnosis, silently dropping the credential's error. Return the redacted copy's error only when its locations, types and messages match the original's; otherwise render the original's errors without their input. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the mixed-invalid-fields redaction fix Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): tighten the sentinel test per review Inspect exception chains and formatted tracebacks, require the intended SDK exceptions (complete problem-detail fixtures, strict success status), and add async coverage for basic auth and the async tarpit rejection. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): assert credential suppression across the visible exception chain Render the formatted traceback and every visible cause or context, and assert that the validation error suppresses the credential-bearing original, so removing `from None` fails the tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): require the expected errors in the sync OAuth failure tests Assert HTTPStatusError with the mocked status for each token endpoint failure, that the non-SaaS repeat reuses the memoized 401, and that the SaaS repeat raises the tarpit RuntimeError, so none can pass on an unrelated exception. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: require the expected errors in the configuration-rejection sentinel tests Use drive_expecting for the construction, alias-conflict and rejected-type cases so none can pass on an unrelated exception, and require the diagnostic to name the credential field. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the memoized-401 sentinel test with a manual clock The memoized error only holds for a cooldown measured on the clock, so a live clock made the repeat race runner pauses and wall-clock adjustments. Inject ManualClock so the branch is exercised deterministically. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render client and provider again after requests The non-disclosure tests rendered the client and auth provider only at construction, so state a provider acquires while serving a request (a cached token, a memoized failure) was never checked. Render both again after the requests are driven, in the sync and async tests. A collector self-test shows a leak that exists only after a request is missed by the pre-request snapshot and caught by the new one. A temporary runtime mutation that put the secret in the provider repr once a token was held fails three tests with this change and none without it. Decision record: #444 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): widen the sentinel test per review Capture stdlib logging at DEBUG as well as the injected logger, since httpx and httpcore log there. Check the access token the endpoint issued on every OAuth success path, excluding only the token cache file contents where it is meant to live. Add async equivalents of the memoized 401, the non-401 token endpoint failure and the failing API call with trace-level body logging, which run separate async code. Collector self-tests cover the new checks, and temporary runtime mutations (reverted) that log the bearer header in the async request hook, put the secret in the async memoized 401, or log it through a stdlib logger each fail the new tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): format logged exceptions and narrow the token exemption The stdlib collector read record.exc_text, which stays None until a formatter has run, so a credential in a logged exception passed unless another handler happened to format the record first. Use the handler's format(), which renders the exception and stack whatever the handler order. The issued-token check exempted every file under the cache directory. Exempt only the access_token field of oauth-token-*.json files directly in it, and keep inspecting every other field, every other file and every nested directory. A file that is not a JSON object is not exempt at all. Both are red-first: a record handed straight to the collector, and a stray file, a nested cache file and extra cache fields holding the token, each failed before the change. Temporary runtime mutations (reverted) that write the token to a diagnostics file, copy it into an extra cache field, or log it in an exception each fail the tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render logged messages and exc_info as a sink prints them The capturing logger kept only repr() of the raw arguments. A stdlib style sink prints msg % args, which applies str() to each argument, and prints the whole traceback chain for exc_info, so a credential visible only through str() or through the cause of a logged exception passed the non-disclosure assertions. Record the formatted message and, for exc_info given as True, an exception instance or a tuple, the formatted traceback with its chain. A bad format string is recorded as passed rather than raising, as a sink reports it rather than crashing the caller. Red-first: a collector self-test logs a value whose str() leaks but whose repr() does not, and a secret in the cause of an exc_info exception in all three forms, and it failed before the change. With a temporary runtime mutation (reverted) that logs such an exception, the old collector passes and the new one fails five tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the client secret alias and render brace and structured logs The non-disclosure suite declared CAMUNDA_CLIENT_AUTH_CLIENTSECRET as driven but no test set it. Every OAuth test now runs once per name the secret is accepted under, a guard ties the declared set to the fields the tests are parametrised over, and the alias is also driven from the environment. The capturing logger recorded repr of the raw arguments only. It now also renders the message as a brace-style sink would (positional, indexed and keyword placeholders) and a single mapping argument for percent-style, and records str of every structured field (keyword arguments, extra, nested containers). The stdlib collector records the attributes added by extra, which the default formatter never prints. Self-tests plant a value whose repr is opaque and whose str carries the sentinel in each shape; all of them were missed before this change. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): do not quote credential values in alias conflict errors When both names of an alias pair were set to different values, the resolver raised a ValueError that quoted both with repr. For CAMUNDA_CLIENT_SECRET and CAMUNDA_CLIENT_AUTH_CLIENTSECRET that put the client secret in the exception text, which reaches the operator's terminal and crash reports. The message still names both settings and says they conflict, but the value of a credential-shaped setting (name containing SECRET, PASSWORD, PASSPHRASE or KEY) is shown as <redacted>. Non-secret pairs such as the REST address keep quoting both values, which is what makes the conflict actionable. Found by driving CAMUNDA_CLIENT_AUTH_CLIENTSECRET in the sentinel non-disclosure suite; the conflict test fails before this change. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(gen): regenerate for redacted alias conflict errors The generated runtime copy of configuration_resolver.py and its stub now carry the credential redaction added to the alias conflict messages. The runtime file is copied and formatted exactly as the generation step does, and the stub is produced by the stub hook. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: leave alias conflict redaction to the fix PR The previous two commits redacted credential values in the alias conflict errors, but that leak is already fixed by the configuration error redaction in #431, with a shared set of credential keys. Carrying a second implementation here would conflict with it when both land, and this PR is test-only. This reverts the redaction, its generated copy and stub, and the two tests that needed it. The sentinel suite still drives the client secret alias end to end; the alias conflict error is asserted by the stacked suite, which includes that fix. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda --------- (cherry picked from commit 2f2900e) Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
jwulf
pushed a commit
that referenced
this pull request
Nov 30, 2026
#437) (#530) * fix(config): keep credentials out of repr() and str() CamundaSdkConfiguration is a plain pydantic model, so its generated repr printed every value it held: the OAuth client secret and its alias, the basic-auth password, the inline mTLS key and its passphrase. ResolvedCamundaSdkConfiguration is a dataclass whose generated repr nested the unfiltered environment and explicit partials on top of that, and _OAuthToken's printed the bearer token. Any print(client.configuration), %r in an f-string, or traceback renderer that shows locals wrote them out. The five credential-bearing configuration fields are now declared repr=False, _OAuthToken.access_token likewise, and ResolvedCamundaSdkConfiguration renders the shape of the two raw partials rather than their contents. Nothing else changes: the values are still readable by attribute and still present in model_dump(), so no caller breaks. The regression test derives the credential set from the model's own field names rather than listing the fields that leaked, so a credential field added later fails here without anyone remembering to extend the test. Closes #422 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for credential repr redaction Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): stop configuration errors echoing credentials Two configuration error paths put credential values verbatim into their message, and both fire at client construction -- process start-up -- where the traceback lands in application logs or a crash reporter. The alias-conflict error interpolated both sides with !r, and CAMUNDA_CLIENT_SECRET / CAMUNDA_CLIENT_AUTH_CLIENTSECRET is one of the alias pairs. It now renders a placeholder for the keys in the credential set and keeps the real values for the others, so a REST-address conflict is still diagnosable. A pydantic ValidationError records the input it was handed on every error, so a required-when failure repeated the whole merged configuration, credentials included. The resolver now validates a redacted copy to obtain the same diagnosis without them -- the model's validators test for presence, not content, so a placeholder is rejected exactly where the real value was -- and raises that, with the original suppressed so a chained traceback cannot print it. The exception type is unchanged. In the one case where the rejected value is itself a credential, the redacted copy validates and the errors are rendered without their input instead; that is a ValueError, which ValidationError already is. Closes #423 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for redacted configuration errors Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): add the sentinel-secret regression test The shared policy requires one in every SDK and this repo had none: searching the test tree for a sentinel value, or for any assertion that a credential is absent from logs, exceptions or telemetry, returned nothing. The auth tests exercise the credential paths but never assert non-disclosure, and they use client_secret="secret", a value too common to assert against. Configures a recognisable sentinel as the OAuth client secret and as the basic auth password, drives the auth success and failure paths with it -- token fetch and authenticated call, a 401 and its memoized repeat, a non-401, a failing API call with trace-level body logging, and the async equivalents -- and asserts the sentinel reaches none of: the records of a capturing logger installed at trace, str() and repr() of every exception raised (including a pydantic ValidationError's errors()), the rendered client and auth provider, or the name or contents of any file the SDK wrote into the token cache directory. For basic auth the encoded Authorization header is checked as well as the password itself. A guard test fails if a credential-shaped configuration field appears that the file neither drives nor explicitly excludes, so extending it is not left to memory. The mTLS key and its passphrase are the current exclusions: they must be real PEM material or no TLS context can be built. Checked that it bites: logging the client secret from the token request fails four of the tests, and writing it into the token cache file fails three. Refs #425 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): type the redaction helpers with object, not Any CI's escape-hatch guard failed: the three new helpers raised the `any` count in runtime/ from 371 to 375. None of them needs Any. _render_config_value only reprs its value, and the redaction pair only copies a mapping and compares it, so object expresses all three exactly and keeps the baseline where it was. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the redaction helper signatures Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): leave empty credentials unredacted From Copilot's review: the placeholder is non-empty, so redacting an empty credential let the redacted copy pass a presence check the real configuration failed. BASIC auth with a username and CAMUNDA_BASIC_AUTH_PASSWORD="" therefore raised a plain ValueError rather than the ValidationError naming the missing password, and an empty credential alongside another error lost its diagnosis entirely. An empty value is not a secret, so it is now left alone. Two tests cover it; the first fails against the previous redaction. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the empty-credential redaction fix Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): close four gaps in the sentinel test From Copilot's review. The SaaS 401 tarpit was never driven: every OAuth case used auth.local, and the tarpit file is written only for login.cloud.camunda.io. It is keyed on a hash of the client secret, so its name is exactly the kind of place a regression would put one. Sync and async cases now drive it and assert the file exists before inspecting its name and contents; putting the raw secret in that filename fails both. The surface collector recorded only repr(), so a __str__ that discloses what __repr__ hides would have passed. It now records both. The cache sweep visited only immediate children, so the async failure client's nested cache directory was never read. It is recursive now. The async success request was allowed to raise and still satisfy the test's "something raised" assertion. It now has to return 200 and leave a cached token, and the 401 has to raise. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * test(auth): fold repr and invalid-config errors into the sentinel test The sentinel-secret test drove the auth success and failure paths but did not cover two surfaces the audit named: repr()/str() of the configuration objects and the errors raised for an invalid configuration. Both are now asserted, for every credential field (driven and undriven alike), for both client flavours, for resolver alias conflicts in explicit and environment configuration, and for a credential rejected for its type. The client's effective configuration is also rendered by every existing driven test through the shared surface collector. Stacked on #430, #431 and #435: against main without them the new assertions fail, with them they pass. Refs #425 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: address review comments - check exception chains and require the success paths Walk the visible cause/context chain of every raised error (honouring raise- from-None), require the sync OAuth success request and the first basic-auth request to succeed, and require the basic-auth 401 to raise UnauthorizedError (its mock body was malformed, so the client raised a parse error instead). Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): keep a rejected credential's error when another field is also invalid The redacted copy accepts the placeholder for a non-string credential, so its own type error vanishes from the copy. When another field was also invalid the copy still failed, and that failure was returned as the whole diagnosis, silently dropping the credential's error. Return the redacted copy's error only when its locations, types and messages match the original's; otherwise render the original's errors without their input. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(generation): regenerate SDK for the mixed-invalid-fields redaction fix Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): tighten the sentinel test per review Inspect exception chains and formatted tracebacks, require the intended SDK exceptions (complete problem-detail fixtures, strict success status), and add async coverage for basic auth and the async tarpit rejection. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(config): assert credential suppression across the visible exception chain Render the formatted traceback and every visible cause or context, and assert that the validation error suppresses the credential-bearing original, so removing `from None` fails the tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): require the expected errors in the sync OAuth failure tests Assert HTTPStatusError with the mocked status for each token endpoint failure, that the non-SaaS repeat reuses the memoized 401, and that the SaaS repeat raises the tarpit RuntimeError, so none can pass on an unrelated exception. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: require the expected errors in the configuration-rejection sentinel tests Use drive_expecting for the construction, alias-conflict and rejected-type cases so none can pass on an unrelated exception, and require the diagnostic to name the credential field. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the memoized-401 sentinel test with a manual clock The memoized error only holds for a cooldown measured on the clock, so a live clock made the repeat race runner pauses and wall-clock adjustments. Inject ManualClock so the branch is exercised deterministically. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render client and provider again after requests The non-disclosure tests rendered the client and auth provider only at construction, so state a provider acquires while serving a request (a cached token, a memoized failure) was never checked. Render both again after the requests are driven, in the sync and async tests. A collector self-test shows a leak that exists only after a request is missed by the pre-request snapshot and caught by the new one. A temporary runtime mutation that put the secret in the provider repr once a token was held fails three tests with this change and none without it. Decision record: #444 Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): widen the sentinel test per review Capture stdlib logging at DEBUG as well as the injected logger, since httpx and httpcore log there. Check the access token the endpoint issued on every OAuth success path, excluding only the token cache file contents where it is meant to live. Add async equivalents of the memoized 401, the non-401 token endpoint failure and the failing API call with trace-level body logging, which run separate async code. Collector self-tests cover the new checks, and temporary runtime mutations (reverted) that log the bearer header in the async request hook, put the secret in the async memoized 401, or log it through a stdlib logger each fail the new tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): format logged exceptions and narrow the token exemption The stdlib collector read record.exc_text, which stays None until a formatter has run, so a credential in a logged exception passed unless another handler happened to format the record first. Use the handler's format(), which renders the exception and stack whatever the handler order. The issued-token check exempted every file under the cache directory. Exempt only the access_token field of oauth-token-*.json files directly in it, and keep inspecting every other field, every other file and every nested directory. A file that is not a JSON object is not exempt at all. Both are red-first: a record handed straight to the collector, and a stray file, a nested cache file and extra cache fields holding the token, each failed before the change. Temporary runtime mutations (reverted) that write the token to a diagnostics file, copy it into an extra cache field, or log it in an exception each fail the tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): render logged messages and exc_info as a sink prints them The capturing logger kept only repr() of the raw arguments. A stdlib style sink prints msg % args, which applies str() to each argument, and prints the whole traceback chain for exc_info, so a credential visible only through str() or through the cause of a logged exception passed the non-disclosure assertions. Record the formatted message and, for exc_info given as True, an exception instance or a tuple, the formatted traceback with its chain. A bad format string is recorded as passed rather than raising, as a sink reports it rather than crashing the caller. Red-first: a collector self-test logs a value whose str() leaks but whose repr() does not, and a secret in the cause of an exc_info exception in all three forms, and it failed before the change. With a temporary runtime mutation (reverted) that logs such an exception, the old collector passes and the new one fails five tests. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(auth): drive the client secret alias and render brace and structured logs The non-disclosure suite declared CAMUNDA_CLIENT_AUTH_CLIENTSECRET as driven but no test set it. Every OAuth test now runs once per name the secret is accepted under, a guard ties the declared set to the fields the tests are parametrised over, and the alias is also driven from the environment. The capturing logger recorded repr of the raw arguments only. It now also renders the message as a brace-style sink would (positional, indexed and keyword placeholders) and a single mapping argument for percent-style, and records str of every structured field (keyword arguments, extra, nested containers). The stdlib collector records the attributes added by extra, which the default formatter never prints. Self-tests plant a value whose repr is opaque and whose str carries the sentinel in each shape; all of them were missed before this change. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * fix(config): do not quote credential values in alias conflict errors When both names of an alias pair were set to different values, the resolver raised a ValueError that quoted both with repr. For CAMUNDA_CLIENT_SECRET and CAMUNDA_CLIENT_AUTH_CLIENTSECRET that put the client secret in the exception text, which reaches the operator's terminal and crash reports. The message still names both settings and says they conflict, but the value of a credential-shaped setting (name containing SECRET, PASSWORD, PASSPHRASE or KEY) is shown as <redacted>. Non-secret pairs such as the REST address keep quoting both values, which is what makes the conflict actionable. Found by driving CAMUNDA_CLIENT_AUTH_CLIENTSECRET in the sentinel non-disclosure suite; the conflict test fails before this change. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore(gen): regenerate for redacted alias conflict errors The generated runtime copy of configuration_resolver.py and its stub now carry the credential redaction added to the alias conflict messages. The runtime file is copied and formatted exactly as the generation step does, and the stub is produced by the stub hook. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda * chore: leave alias conflict redaction to the fix PR The previous two commits redacted credential values in the alias conflict errors, but that leak is already fixed by the configuration error redaction in #431, with a shared set of credential keys. Carrying a second implementation here would conflict with it when both land, and this PR is test-only. This reverts the redaction, its generated copy and stub, and the two tests that needed it. The sentinel suite still drives the client secret alias end to end; the alias conflict error is asserted by the stacked suite, which includes that fix. Claude-Session: https://claude.ai/code/session_01RcVhnekJQeXnMfPhs9pYda --------- (cherry picked from commit 2f2900e) Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Before: The sentinel-secret test from #435 drives the auth success and failure paths and checks logs, exceptions and files, but two surfaces the audit named were not asserted: what
repr()/str()of the configuration objects print, and what the errors for an invalid configuration say. Those were the leaks #430 and #431 fix, so nothing in the sentinel test would have caught them coming back.After: The sentinel test also asserts that the sentinel never appears in
repr()/str()of the effective configuration, the resolved configuration (including the raw copies of the values it keeps) and the OAuth token object, and never appears in any error raised for an invalid configuration: a validation failure at client construction (sync and async), alias conflicts in explicit and environment configuration, and a credential rejected for its type. The sweep is driven from the credential field set, including the mTLS key and passphrase that cannot be driven end to end, so a new credential field is covered without editing it. The existing driven tests now also render the client's effective configuration. Againstmainwithout the fixes 14 of the 15 tests in the file fail; with them all pass.How: Test-only change to
tests/acceptance/test_secret_non_disclosure.py; no runtime or generated files are touched by this PR's own commit.Stacked. This branch was created from
mainwith the heads of #430, #431 and #435 merged in, because its assertions are red onmainuntil they land. Those three PRs must merge first; their commits then drop out of this diff and only the final test commit remains. I did not push to any of their branches.Refs #425
Generated by Claude Code