Repository navigation
Description
Summary
Implement an environment-level ch-oauth-ldap service that lets ClickHouse 24.8 authenticate otherwise-undefined users with an OAuth/OIDC JWT and derive dynamic ClickHouse roles from token claims through ClickHouse's existing LDAP external user directory.
This is the implementation issue for ADR #16 and is consistent with ADR #17. It also aligns the helper's OAuth/role configuration vocabulary with Project Antalya's token authentication model where practical.
The helper is LDAP-only. It is not an HTTP verification service, proxy, OAuth login service, MCP-specific service, or ClickHouse provisioning service.
Target flow
Direct client / proxy / MCP
|
| ClickHouse username + JWT as password
v
ClickHouse 24.8
|
| LDAP simple bind
v
ch-oauth-ldap
|
| validate JWT, bind username to token identity,
| derive token groups/roles
|
| LDAP role-mapping search on the SAME connection
v
ClickHouse local roles / grants / RBAC
MCP follows the same path as every other ClickHouse client. MCP does not call this helper directly.
Compatibility target
Baseline integration target:
- Altinity Stable ClickHouse
v24.8.11.51285.altinitystableor later 24.8 Altinity Stable. - This build contains ClickHouse #70332 (the
push_external_roles_in_interserver_queriesmechanism), so distributed-query role behavior can be exercised on 24.8. It does not contain ClickHouse #79099 ("Fix passing of external roles in interserver query", merged 2025-06-09): on 24.8 and 25.3 a pushed external role is stored incurrent_rolesand filtered against the ephemeral user's (empty) local grants, so the remote node logsexternal_roles appliedyet the query is denied (ClickHouse #78791). No 24.8 Altinity Stable release through 24.8.14.10547 carries #79099.
Compatibility is therefore split (verified by integration/clickhouse/run-all-builds.sh):
- 24.8 Altinity Stable (baseline): ephemeral-user authentication,
currentUser(), dynamiccurrentRoles(), role refresh, local-user precedence — supported and verified. Distributed external-role authorization is a documented expected-failure. - 25.8 Altinity Stable or later (verified on 25.8.28.10001; also 26.3): all of the above plus distributed external-role authorization — for
Distributedtables over base tables only. Every current ClickHouse version (through 26.3) loses pushedexternal_roleswhen the remote table is a normalVIEW(Pushed external roles (push_external_roles_in_interserver_queries) are lost when the remote query reads through a normal VIEW ClickHouse/ClickHouse#116840); the fixture tracks this as an expected-fail canary.
If 24.8 must support distributed external roles, Altinity needs to backport #79099.
ClickHouse 24.8 already provides the external-user lifecycle we need:
- local users take precedence over LDAP users;
- otherwise-undefined LDAP users are materialized in memory;
- external roles are refreshed on authentication;
- LDAP bind and role-mapping search use the same LDAP connection.
This helper is therefore a compatibility bridge for 24.8, not a replacement for ClickHouse authorization. ClickHouse remains the source of truth for roles, grants, settings profiles, row policies, quotas, and other RBAC objects.
Scope
In scope
- New
cmd/ch-oauth-ldapbinary. - JWT/JWKS verification using the existing shared OAuth SDK rather than duplicating generic token-validation code.
- Exact issuer validation.
- Multiple accepted audiences.
- Configurable
username_claimandgroups_claim, aligned with Antalya terminology. - Binding the requested ClickHouse/LDAP username to a verified token identity.
- Email verification/domain policy already supported by the helper where configured.
- Reserved/local username protection.
- Token group extraction.
- Antalya-aligned role pipeline:
roles_mapping->roles_filter->roles_transform. - Minimal LDAPv3 simple Bind + Search behavior required by ClickHouse LDAP external user directories.
- Connection-local authenticated state between Bind and Search.
- Synthetic LDAP group entries consumed by ClickHouse
role_mapping. - Environment-level Kubernetes Deployment + ClusterIP Service.
- ClickHouse 24.8 configuration example/template.
- Unit, protocol, integration, distributed-query, HA, cache-expiry, and redaction tests.
- Refactoring the current verifier code enough to reuse helper-specific identity/token policy safely.
Explicitly out of scope
- Shared verification HTTP API or
/verifyendpoint for this service. - MCP-to-helper API calls or MCP-specific integration.
- Proxy implementation or changes.
- OAuth browser/device/token acquisition flows.
- OAuth token exchange.
- TLS, LDAPS, or StartTLS for the MVP.
- Public Ingress or LoadBalancer exposure.
- SQL connections from the helper.
- Creating ClickHouse users or roles.
- Grant management.
- Persistent external users.
- Provider-specific group lookup APIs or token introspection in the MVP.
- Cluster-specific role/group mappings in the environment-level helper.
- Native ClickHouse client protocol implementation in the helper.
- Revoking an already-established ClickHouse native session when its token expires. Token validation occurs during ClickHouse authentication; a new/reconnected authentication must use a currently valid token.
Configuration contract
Use Project Antalya terminology where the concepts are equivalent.
Example:
oauth:
expected_issuer: https://example.auth0.com/
# Required. MVP extension over Antalya's singular expected_audience.
expected_audiences:
- clickhouse
- mcp
username_claim: email
groups_claim: roles
verifier_leeway: 60s
jwks_cache_lifetime: 1h
token_cache_lifetime: 30s
identity:
username_match: lowercase_equal
require_email_verified: true
allowed_email_domains: []
denied_usernames:
- default
- admin
- operator
roles:
roles_mapping:
idp-readers: ch_readonly
idp-engineers: ch_engineer
# Full-match semantics. This should normally make the mapping fail closed.
roles_filter: '^ch_[A-Za-z0-9_]+$'
# Optional, applied last. Sed-style syntax matching Antalya semantics.
roles_transform: ''
ldap:
listen: ':389'
user_base_dn: 'ou=users,dc=altinity,dc=internal'
group_base_dn: 'ou=groups,dc=altinity,dc=internal'
user_rdn_attribute: uid
role_cn_prefix: 'clickhouse_'Exact YAML structure can follow existing repository conventions, but the external concepts and names above should remain stable unless implementation constraints require a documented change.
Audience semantics
expected_audiences is required and must contain at least one non-empty value.
A JWT is accepted when:
- the token contains
audas a string or array according to JWT rules; and - at least one token audience exactly equals one configured
expected_audiencesentry.
No wildcard or substring matching.
If a singular expected_audience compatibility alias is added, reject configuration that specifies both singular and plural forms.
MCP gets no special audience bypass. Tokens passed by MCP must satisfy the same environment policy as tokens passed by other clients.
Issuer and token validity
expected_issueris exact-match.- Signature must validate against configured JWKS.
expis required.nbfis enforced when present.- Clock skew uses configured
verifier_leeway. - Do not add provider-specific
/userinfo, Graph, or introspection calls in this issue.
Identity contract
A successful LDAP bind must prove that the requested username and the JWT refer to the same principal.
Required behavior:
- Parse the username from the configured LDAP bind DN shape.
- Validate the JWT.
- Read
username_claimfrom verified claims. - Compare the bind username to that claim using the configured match mode; default deployment policy is
lowercase_equal. - Apply email verification/domain policy when configured.
- Reject reserved usernames even when the token itself is valid.
- Treat
(iss, sub)as the stable internal principal identity for logs/diagnostics/correlation where needed; the visible ClickHouse username can come fromusername_claim.
Authentication failures should not disclose whether failure was caused by signature, issuer, audience, username mismatch, reserved username, email policy, or token expiry. LDAP clients should receive invalidCredentials for authentication failures.
Never log the JWT or LDAP password value.
Group and role contract
Align with Antalya's role pipeline:
groups_claim
-> roles_mapping
-> roles_filter
-> roles_transform
-> ClickHouse role name
-> LDAP synthetic cn representation
-> ClickHouse LDAP role_mapping
-> existing local ClickHouse role
groups_claim
- Configurable claim name; default can remain compatible with existing deployment policy, but documentation should note Antalya defaults to
groupsand commonly usesrolesfor Entra App Roles. - MVP input type is a JSON array of strings.
- Missing claim is not an authentication failure; it yields zero external roles.
- Deduplicate values.
- Malformed/non-array group claims must fail closed for role derivation and must never become arbitrary role names. Define whether this is authentication failure or zero roles and cover the choice with tests; prefer authentication failure for malformed configured claims.
roles_mapping
Match Antalya semantics:
- explicit mapping from incoming group identifier to a candidate ClickHouse role name;
- mapping happens first;
- an unmapped group passes through unchanged.
roles_filter
Match Antalya semantics:
- regex is evaluated against the value after
roles_mapping; - use full-match semantics, not substring search;
- groups that do not match are discarded;
- invalid regex must prevent startup/config activation rather than falling into permissive behavior.
Deployment examples must use a restrictive filter so arbitrary IdP groups do not automatically become ClickHouse roles.
roles_transform
Match Antalya's ordering and sed-style transform semantics where practical:
- applied after mapping and filtering;
- optional;
- malformed configuration fails startup/config activation.
LDAP representation
The role pipeline produces a ClickHouse role name, e.g. ch_engineer.
The LDAP server exposes it using a transport prefix, e.g.:
cn=clickhouse_ch_engineer,ou=groups,dc=altinity,dc=internal
with attribute:
cn: clickhouse_ch_engineer
ClickHouse strips the transport prefix using LDAP role_mapping:
<role_mapping>
<base_dn>ou=groups,dc=altinity,dc=internal</base_dn>
<scope>subtree</scope>
<search_filter>(&(objectClass=groupOfNames)(member={bind_dn}))</search_filter>
<attribute>cn</attribute>
<prefix>clickhouse_</prefix>
</role_mapping>The helper does not know whether a given cluster has created every emitted role. Clusters own their local role definitions and grants.
LDAP protocol contract
Use github.com/vjeantet/ldapserver for protocol handling unless an initial ClickHouse interoperability test finds a blocking issue. Do not implement LDAP BER manually.
MVP supports only the LDAP operations ClickHouse needs:
- LDAPv3 simple Bind;
- Search used by configured ClickHouse
role_mapping; - Unbind/connection close.
Not supported:
- anonymous role search;
- SASL bind;
- Add/Modify/Delete/Compare;
- password modification;
- generic directory browsing;
- StartTLS;
- LDAPS.
Unsupported operations fail closed.
Bind DN
Recommended deployment shape:
uid={user_name},ou=users,dc=altinity,dc=internal
The helper must parse DNs using an LDAP/DN parser and proper escaping rules. Do not recover usernames through unsafe string concatenation/splitting that permits DN injection.
Reject anonymous/empty bind credentials.
The LDAP simple-bind password is the JWT.
Connection-local state
This is normative because ClickHouse performs Bind and subsequent role Search on the same LDAP connection.
After a successful Bind, store only on that connection:
- canonical visible username;
- stable
(iss, sub)identity; - exact bound DN;
- token expiration;
- mapped role snapshot.
Rules:
- Search before successful Bind fails closed.
- State is never shared between LDAP connections.
- Clear previous authenticated state before processing every re-Bind attempt.
- A failed re-Bind leaves the connection unauthenticated.
- A successful re-Bind replaces the previous state completely.
- Disconnect destroys the state.
- Multiple valid searches after one successful Bind use the role snapshot established by that Bind.
Do not revalidate/reinterpret the JWT during Search.
Search behavior
Accept the narrow role lookup performed by the documented ClickHouse configuration.
For an authenticated connection:
- require the configured group base DN;
- require the expected scope;
- require the expected membership query shape or equivalent safely parsed LDAP filter;
- ensure any referenced member DN equals the current connection's bound DN;
- return one synthetic group entry per mapped role;
- return successful empty results for an authenticated user with zero roles.
Example entry:
dn: cn=clickhouse_ch_engineer,ou=groups,dc=altinity,dc=internal
objectClass: groupOfNames
cn: clickhouse_ch_engineer
member: uid=user@example.com,ou=users,dc=altinity,dc=internal
Do not let Search become an oracle for arbitrary usernames or token group membership.
Cache correctness
Before or as part of this implementation, fix the existing positive verification cache invariant in the shared verifier path.
Today the helper's positive cache can use now + positive_ttl without capping the entry at JWT expiration. That can temporarily treat an expired token as valid if it was cached shortly before exp.
Required invariant for every positive token-validation cache entry:
cache_expiration <= JWT.exp
Concretely:
cache_expiration = min(now + token_cache_lifetime, JWT.exp)
No cache in this helper may extend authentication validity beyond credential expiration.
Keep the cache key bound to both requested username and token so a token cached for one requested username cannot authenticate another.
Code organization
Do not duplicate generic JWT/JWKS/OIDC parsing that belongs in github.com/altinity/go-mcp-oauth-sdk.
Suggested split in this repository:
cmd/ch-oauth-ldap/
main.go
config.go
internal/identity/
username binding and reserved-user policy
internal/roles/
groups_claim extraction adapter
roles_mapping
roles_filter
roles_transform
internal/ldap/
per-connection session
bind handler
search handler
LDAP entry rendering
Refactor/reuse the current ch-jwt-verify verifier/identity logic rather than maintaining two security-sensitive implementations. If a capability is generic across consumers, extend the SDK instead of copying it into altinity-oauth-helper.
Existing ch-jwt-verify behavior must not regress as a side effect of this refactor.
ClickHouse 24.8 configuration
The working configuration, copied verbatim from the integration fixture integration/clickhouse/clickhouse/common/config.d/ldap.xml (verified against 24.8 and 25.8; role_mapping sits directly under <ldap>, enable_tls=no makes the MVP's plain-LDAP scope explicit, search_limit is ClickHouse's default made explicit — see the operator guide for the measured overflow consequence):
<clickhouse>
<ldap_servers>
<oauth_helper>
<host>ch-oauth-ldap</host>
<port>389</port>
<bind_dn>uid={user_name},ou=users,dc=altinity,dc=internal</bind_dn>
<verification_cooldown>0</verification_cooldown>
<enable_tls>no</enable_tls>
<search_limit>256</search_limit>
</oauth_helper>
</ldap_servers>
<user_directories>
<ldap>
<server>oauth_helper</server>
<role_mapping>
<base_dn>ou=groups,dc=altinity,dc=internal</base_dn>
<scope>subtree</scope>
<search_filter>(&(objectClass=groupOfNames)(member={bind_dn}))</search_filter>
<attribute>cn</attribute>
<prefix>clickhouse_</prefix>
</role_mapping>
</ldap>
</user_directories>
</clickhouse>Validate the exact 24.8 XML structure against the target build during implementation; the committed example must be copied from a working integration test, not documentation-only assumptions.
Keep verification_cooldown=0 so each ClickHouse authentication reaches the helper and sees current token-derived roles.
Kubernetes deployment
This service is environment-level, not a ClickHouse sidecar.
Add a new Helm/deployment path; do not silently change the existing ch-jwt-verify sidecar chart's behavior.
Expected topology:
- Deployment;
- ClusterIP Service;
- LDAP port 389 only;
- no HTTP API;
- no Ingress;
- no LoadBalancer;
- no TLS/LDAPS/StartTLS in MVP;
- two stateless replicas for production by default/recommended configuration;
- one replica allowed for dev/test;
tcpSocketliveness/readiness probes on the LDAP listener;- resource requests/limits;
- PodDisruptionBudget for multi-replica production configuration where appropriate.
All authenticated state remains connection-local, so Kubernetes Service load balancing requires no shared session store or sticky-session configuration.
Plain LDAP is acceptable only on the trusted internal Kubernetes network described by the architecture. Documentation must make the bearer-token implication explicit: the JWT travels as the LDAP simple-bind password. The Service must therefore remain internal-only. Recommend NetworkPolicy restriction where the deployment platform supports it.
Decision (2026-08-28): this plaintext-in-cluster posture is accepted for the MVP by the named risk owner (Boris Tyshkevich, @BorisTyshkevich) recorded in the ship log and in ADR #16's amendment; the chart renders a ClusterIP-only Service plus a default-on source-restricting NetworkPolicy (reachability control, not transport confidentiality) and documents the exposure explicitly.
Logging and observability
Provide useful structured logs without credential leakage.
Allowed examples:
- bind success/failure count;
- normalized username on success where current project logging policy allows it;
- stable hashed/correlated principal identifier if useful;
- issuer/processor name;
- number of mapped roles;
- LDAP operation/result code;
- validation/cache timing at debug/trace level.
Never log:
- JWT contents;
- Authorization headers;
- LDAP password values;
- full raw bind requests containing credentials.
Error messages returned to LDAP clients must not contain token contents or internal verifier errors.
Tests
Unit: verification and identity
- Valid signature/issuer/audience succeeds.
- Any configured audience can satisfy a string/array
audclaim by exact equality. - No audience intersection fails.
- Empty/missing configured audience list fails startup.
- Invalid signature fails.
- Wrong issuer fails.
- Expired token fails.
- Missing
expfails. - Future
nbfoutside configured leeway fails. - Bind username /
username_claimmismatch fails. -
lowercase_equalbehaves as documented. - Required
email_verifiedis enforced. - Allowed-domain policy is enforced.
- Reserved usernames fail even with otherwise-valid tokens.
- Cache key remains bound to requested username + token.
- Positive cache entries never survive JWT
exp. - JWT/password never appears in logs or returned errors. (first-party sinks proven by
internal/securitytest; the SDKkidsink closed by go-mcp-oauth-sdk v0.2.1 —SDK_REDACTION_AUTHORIZATION_GATEresolved)
Unit: groups and roles
- Configurable
groups_claimreads JSON string arrays. - Missing group claim yields zero roles.
- Duplicate groups deduplicate.
- Malformed configured group claim fails closed.
-
roles_mappingis applied first. - Unmapped groups pass through before filtering, matching Antalya semantics.
-
roles_filteruses full-match semantics. - Non-matching values are dropped.
- Invalid role-filter regex fails config activation/startup.
-
roles_transformruns after mapping/filtering. - Invalid transform fails config activation/startup.
- Dangerous/unexpected IdP group values cannot become roles under the documented fail-closed deployment config.
Unit/protocol: LDAP
- Valid simple Bind creates authenticated connection state.
- Invalid token returns
invalidCredentials. - Anonymous/empty bind rejected.
- Malformed/unexpected bind DN rejected safely.
- Search before Bind rejected.
- Search state is isolated between connections.
- Successful re-Bind replaces principal and roles.
- Failed re-Bind clears previous authentication state.
- Expected ClickHouse role search returns correct synthetic
cnvalues. - Authenticated user with no roles receives successful empty search.
- Search for another member DN is rejected.
- Wrong base DN/scope/filter cannot expose arbitrary group membership.
- Unsupported LDAP operations fail closed.
- Disconnect removes connection state.
- Malformed requests do not panic the process.
Integration: real ClickHouse
Run against v24.8.11.51285.altinitystable or a later explicitly documented 24.8 Altinity Stable build.
- Precreate local test roles/grants; do not
CREATE USERfor OAuth test principal. - Undefined user authenticates using ClickHouse username + JWT through LDAP.
-
currentUser()is the configured visible username. -
currentRoles()reflects mapped local ClickHouse roles. - Username/token mismatch is rejected.
- Invalid/expired token is rejected.
- Change token groups and reconnect: roles refresh on the new authentication.
- Local reserved/admin user definition takes precedence and is not replaced by an external user.
- Distributed query preserves the externally assigned roles on remote nodes (≥25.8, base tables only — see Compatibility target; expected-failure on 24.8, VIEW canary tracks #116840).
- No JWT appears in ClickHouse/helper integration logs.
HA
- Run two helper replicas behind one ClusterIP Service. (proven behind a Docker TCP load balancer; ClusterIP form not verified in the build environment — see the operator guide's runbook)
- New ClickHouse authentications work regardless of which replica receives the LDAP connection.
- No correctness dependency exists on shared in-memory state between replicas.
- Kill one helper pod; new authentications recover through the remaining Service endpoint after normal Kubernetes routing convergence. (Docker equivalent proven; Kubernetes convergence delegated to the runbook)
- Existing LDAP connections to a killed pod may fail; no transparent cross-pod session migration is required.
Implementation sequence
Phase 1: shared correctness/refactor
- Extract/reuse security-sensitive verifier and identity code needed by both binaries.
- Fix positive cache expiry so cached validation cannot outlive JWT
exp. - Add multiple-audience validation.
- Add Antalya-aligned group/role pipeline.
- Preserve
ch-jwt-verifybehavior and tests.
Phase 2: LDAP server
- Add
cmd/ch-oauth-ldap. - Add LDAP dependency and server lifecycle.
- Implement per-connection session state.
- Implement simple Bind.
- Implement restricted role Search.
- Implement safe LDAP DN/filter/value handling.
- Add protocol-focused unit tests.
Phase 3: ClickHouse integration
- Add real ClickHouse 24.8 integration fixture/config.
- Verify ephemeral user creation and
currentUser(). - Verify dynamic
currentRoles(). - Verify role refresh on reconnect.
- Verify local-user precedence.
- Verify distributed-role propagation.
Phase 4: deployment
- Add environment-level Helm/deployment assets.
- Deployment + ClusterIP port 389.
- Two-replica production example/default and one-replica dev override.
- TCP probes, resources, and disruption behavior.
- No public exposure and no HTTP service.
Phase 5: docs/security verification
- Document ClickHouse configuration copied from the working integration fixture.
- Document Auth0/OIDC/JWKS and multiple-audience configuration.
- Document
username_claim,groups_claim, and Antalya-aligned role pipeline. - Document plain-LDAP/internal-network trust boundary.
- Verify token redaction across error and debug paths.
- Complete HA and malformed-input tests.
Definition of done
This issue is complete when a user who does not exist persistently in ClickHouse 24.8 can connect with a valid OAuth/OIDC JWT, ClickHouse authenticates that user through ch-oauth-ldap, the helper binds the requested username to the verified token identity, ClickHouse receives the token-derived dynamic role set through LDAP role mapping, local ClickHouse RBAC remains authoritative, distributed queries retain the external roles, refreshed token groups take effect on the next authentication, two helper replicas work without shared state, and neither cache behavior nor logs can extend or leak bearer credentials.
Delivery was phased (state of record: the <!-- ship-log --> comment on this issue):
- Phases 1–5 are merged (feat(#19): phase 1 shared correctness/refactor for ch-jwt-verify #20, feat(#19): phase 2 LDAP server (cmd/ch-oauth-ldap) #21, feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22, feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 + hotfix fix(ci): remove literal expression text that invalidated build-ch-oauth-ldap.yml; gate workflows with actionlint #27, feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28). Everything above is proven against real ClickHouse 24.8 and 25.8 by
integration/clickhouse/, with these qualifications: - "distributed queries retain the external roles" — proven on ≥25.8 for base tables; impossible on 24.8 without #79099 (see Compatibility target); VIEWs lose external roles on every version (ClickHouse #116840).
- "two helper replicas work without shared state" — proven with the Docker HA fixture (
integration/clickhouse/run-ha.sh: two helpers behind a TCP load balancer, kill/readmit, no session migration); Kubernetes Service/endpoint convergence is documented as not verified in the build environment, with the operator runbook indocs/ch-oauth-ldap-operator-guide.md. - "neither cache behavior nor logs can extend or leak bearer credentials" — cache half proven since phase 1; logs half proven for all first-party code by
internal/securitytest; the one externally-owned sink (go-mcp-oauth-sdk v0.2.0logging the JWT headerkidon JWKS rotation) was closed by go-mcp-oauth-sdk v0.2.1 (SDK_REDACTION_AUTHORIZATION_GATE, resolution (a) chosen 2026-08-29; helper PR fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUTHORIZATION_GATE #29 →5628f6b). - Transport confidentiality of the bearer on the ClickHouse→helper LDAP hop is not provided by this MVP (plain LDAP) — an accepted, owner-named deviation from ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 (see Kubernetes deployment and ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 Amendments).
Activity
BorisTyshkevich commentedon Aug 27, 2026
Ship log — #19
Phase 1 — handoff
internal/identity(username-claim binding, reserved-usernamepolicy),
internal/roles(Antalya-aligned map→full-match-filter→transform pipeline),and
internal/verification(composes the SDK's strict verifier + identity policy,owns the cache) packages;
cmd/ch-jwt-verifyrefactored to a thin HTTP adapter overinternal/verification; positive-cache expiry nowmin(now+token_cache_lifetime, JWT.exp); multiple-audience validation (expected_audiences, byte-exact, legacysingular
oauth.audiencestill supported, mutually exclusive after YAML+envlayering);
/verifycollapses every distinct validation failure into one generic403 "authentication failed"body (never discloses which check failed), with thereal reason only in the debug log line — verified live end-to-end against a running
sidecar + synthetic IdP, including a log-content check confirming the raw JWT never
appears in any log line.
Altinity/go-mcp-oauth-sdkrepo (
StrictJWTPolicy/ValidateStrictJWT,IdentityPolicy/ValidateIdentityClaims) that didn't exist at the pinnedv0.1.0. Per/ship's ownrepo-scope rule, this was not silently absorbed into this unit — it ran as its
own preliminary unit (plan already covered by phase 1's approved plan; separate
branch/PR/review loop in that repo) before phase 1's helper-side code could be
written. Shipped as
Altinity/go-mcp-oauth-sdkPR build(deps): bump github.com/urfave/cli/v3 from 3.8.0 to 3.10.1 #8, taggedv0.2.0(additive-only,zero behavior change to any pre-existing exported function — confirmed by review and
by that repo's full pre-existing test suite passing unchanged).
altinity-oauth- helpernow pinsv0.2.0.ValidateStrictJWTreturns several internally-distinguishable errorvariants (issuer mismatch, audience mismatch, missing/malformed
exp, etc., allwrapping
ErrInvalidToken).internal/verification/cmd/ch-jwt-verifycollapse allof these into the single generic HTTP response per the issue's identity contract —
this collapsing happens at the sidecar's HTTP boundary, not inside the SDK itself,
since the SDK is generic infrastructure other consumers may want typed errors from.
Fable/high, 2 passes) already reconciled the issue text with implementation reality
before code was written.
Definition of Done directly (by design — see the approved plan's "Delivery boundary").
It is foundational:
ch-jwt-verifyremains fully operational and unregressed, andphase 2's
cmd/ch-oauth-ldapcan now reuseinternal/identity/internal/roles/internal/verificationwithout a second security-sensitive implementation.as separate issues yet (low priority, pre-existing):
oauth.jwks_refresh_aheadincmd/ch-jwt-verify's config was already a no-op knob before this phase (notintroduced or fixed here); the pre-existing 401 "missing or malformed Authorization"
path is intentionally distinct from the generic 403 non-disclosure response (documented
in code, not a defect).
https://chatgpt.com/c/6a90518a-caa8-83eb-947b-f04cf8a4ecc9, session
d64eda2f-72ec-462e-ac78-f62c926a0a5b.certified-pending-proofs, no findings,reviewed SHA
593910fmatched the PR head exactly at merge time). Conversation(same thread as the plan review) https://chatgpt.com/c/6a90518a-caa8-83eb-947b-f04cf8a4ecc9,
session
ca4edf43-c37b-4177-9a11-286ac3de9da5. Findings across all 3 passes:Claims.Extra's nested map/array valuesthat could let one caller's mutation poison a later cache hit for a different
caller (fixed: recursive deep clone); the raw, unvalidated Basic-auth username
reaching debug logs/error text before identity was established, which could carry
an attacker-supplied credential-shaped string (fixed:
identity.RedactUsernameheuristic guard applied at every interpolation site); a present-but-
nullgroups_claimbeing treated as absent (zero roles) instead of malformed (hardauth failure) — reversed the coordinator's own pass-1 rejection of this same
finding on reconsideration, since the issue text explicitly says to "prefer
authentication failure for malformed configured claims" when the choice is
ambiguous, which the coordinator's original rebuttal had underweighted.
null-groups finding, on its FIRST appearancein pass 1 — rejected then on the grounds that it matched a sibling function's
behavior and the upstream SDK's own precedent; superseded by the acceptance above
once re-raised in pass 2 with the issue-text citation.
2b938f6132e6e57f3c9fec0c7536ad199d21691aonorigin/main, localmainconfirmed non-diverged after merge.
Phase 2 — handoff
cmd/ch-oauth-ldapLDAPv3 server + newinternal/ldappackage: connection lifecycle over
github.com/vjeantet/ldapserver(pinned pseudo-version, commit
663e6b9910fb), per-connection authenticated state viaHandlerSource/GetHandler(no global connection map), simple Bind (JWT as thebind password) that calls the phase-1
internal/verification.Verifier.Verify+internal/roles.Pipeline.Rolesexactly once each and snapshots the result on theconnection, restricted role-mapping Search reusing that snapshot (never re-calling
Verify/Roles), safe RFC-4514 DN parsing/comparison (
go-ldap/ldap/v3, no stringsplitting), structural (AST-based, not text-based) Search-filter authorization, and
every unsupported LDAP operation (Add/Modify/Delete/Compare/Extended/SASL/anonymous)
failing closed. Classified High risk + Large by its own plan; implemented via the
decompose-and-implement loop (5 sub-tasks, one concurrent wave). This phase claims
none of issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's global Definition of Done — it's a standalone protocol server
phase 3 will point a real ClickHouse 24.8 instance at.
vjeantet/ldapserverdependency's default logger writes everyinbound LDAP packet in hex — including the JWT carried as the simple-bind
password.
internal/ldap.Newunconditionally setsldapserver.Logger = ldapserver.DiscardingLoggerbefore ever returning aServer, and this orderingis structural (the only construction site), not caller discipline.
unsynchronized
Server.Listenerfield racingServe()'s write againstStop()'sread, and a related
Server.wg/Loggerwindow) — not forked/patched (per theplan's explicit preference to use the dependency as-is); instead worked around at
the call site (close our own listener reference first, synchronize via the error
channel, then call
Stop()) and documented as an explicit "at most oneinternal/ldap.Serverper process" invariant inserver.go's own doc comments,since
ldapserver.Loggeris a package-level global the dependency doesn't scopeper-instance.
before reaching this package's fail-closed Extended-operation handler; verified
(and now tested) that the dependency's own same-connection-only, no-Bind/no-Abandon
restriction makes this a benign carve-out, documented alongside the existing
Abandon exception rather than silently left unhandled.
Fable/high, 3 passes) already reconciled the issue text with the actual dependency's
API surface (verified independently by the coordinator against the real vendored
source) before code was written.
by design, foundational only (see Phase 1's row above for the same rationale). Real
ClickHouse 24.8 interoperability, distributed-role propagation, and HA are phase 3/5.
architecture consultation (below) raised 5 issue-level recommendations worth
tracking before/during later phases, none judged a phase-2 blocker:
LDAPS/StartTLS from the MVP (plain LDAP on a "trusted internal network"), but
ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 expects tokens to have transport protection. This is a tension in the
issue's own already-recorded scope decision, not a phase-2 defect — flagged
for a human decision at whichever point the deployment topology is finalized
(phase 4), not resolved here.
become documented, deliberate capacity contracts (expected concurrency, JWT
size ceiling, monitoring for saturation) rather than only inline code
comments — good phase-4 deployment-doc material.
vjeantet/ldapserver/vjeantet/goldap(both projects had real July 2026activity, so this is plausible) and a repeatable re-sync procedure defined.
(
CLAUDE.md), not something introduced or worsened by this phase.role refresh, local-user precedence, distributed external roles, concurrent
load, and helper-unavailability behavior should gate calling the whole
issue done — already how phase 3 is scoped, reaffirmed here.
The consultation also suggested comparing the current environment-level
ClusterIP topology against a per-pod sidecar alternative at phase 4 (keeps the
bearer-token LDAP hop on loopback) — worth a deliberate phase-4 comparison, not
a phase-2 rework.
running
ch-oauth-ldap+ synthetic IdP using independent, real LDAP client tooling(
ldapwhoami/ldapsearch, not the Go test suite's client library) — confirmed avalid bind succeeds, wrong-username/garbage-token/anonymous-bind all converge on the
identical
invalidCredentials (49)response, an unsupported extended operation(WhoAmI) fails closed with the correct result code after a successful bind, a
zero-role token produces a successful empty search, and the debug log shows only a
generic per-category reason (never the raw token) — confirmed by a definitive
substring search.
conversation https://chatgpt.com/c/6a9098f3-a038-83eb-b5e2-852a4f1cd2bc, session
1c250939-ebdd-479c-862c-562ded31d408.VERDICT: SHIP— merged on anexplicit human ruling after a
VERDICT: REVISEpost-cap architectureconsultation, whose concerns were judged issue-level (see Follow-ups above), not
phase-2 code defects. 6 formal review passes across 2 ChatGPT sessions (the
human explicitly extended the normal 3-pass cap to 6 for this unit), all 6
finding and fixing real issues: a
goldapBER-encoding correctness bugcorrupting response correlation past message ID 127; a silently-dropped
ModifyDNRequest; an unauthenticated pre-auth ~2 GiB memory-allocation DoS inthe pinned
ldapserver; a slowloris-style stall with no read/write timeout; anunbounded per-connection goroutine/blocked-writer bug that also blocked graceful
shutdown; an unbounded aggregate-connection DoS gap; and a control-operation
(Abandon/Cancel) starvation bug introduced by the previous fix. Two issues were
coordinator-found and fixed proactively beyond what a review pass flagged: a
related TCP-fragmentation data-corruption bug (rejected by one pass on a scope
technicality since obsoleted by an earlier fix forking the same file) and an RFC
4511 §4.5.1.8 non-conformance in attribute-selection projection. One flaky test
(introduced alongside the control-op fix) was root-caused as a test-
orchestration flaw, not a production bug, and fixed — verified with 81 combined
-raceiterations. Two local dependency forks now exist,third_party/goldap/(2 patches) andthird_party/ldapserver/(5 patches),each with a
PATCHES.mddocumenting upstream provenance and exact rationale,wired via
go.modreplacedirectives. Conversation (same thread as the planreview) https://chatgpt.com/c/6a9098f3-a038-83eb-b5e2-852a4f1cd2bc, sessions
c16ce96d-caee-48ae-894b-7a77c59b0670(passes 1-3),dd05fae0-8a2c-4c26-bce1-9f481fd10b46(passes 4-6, seeded from the first), post-cap consultation session
78da2e6a-eacb-4424-b63d-3927bda94923(seeded from the second). A tooling issuewas observed and reported:
chatgpt-review prtwice restated stale,already-fixed findings with an outdated self-reported
reviewed_sha,apparently answering from conversation memory rather than re-fetching the live
PR diff — resolved each time by an explicit instruction to re-navigate and
confirm the live head SHA.
faef331a3f73c5c6d9102ebc9d94be9541aa29cfonorigin/main, localmainconfirmed non-diverged after merge, on explicit human ruling (see Reviewoutcome above).
Phase 3 — handoff
integration/clickhouse/— a real-ClickHouse acceptance fixture(Docker Compose: synthetic IdP, the production
ch-oauth-ldapbinary built from thebranch, two Altinity Stable ClickHouse nodes on deliberately separate networks so the
remote node can only be reached via the secret-authenticated interserver protocol),
driven by
run.sh(single build, default = the issue's 24.8 baseline) andrun-all-builds.sh(24.8 + 25.8). Scenarios A–I: infrastructure preflight (12points), ephemeral undefined-user auth +
currentUser(), dynamiccurrentRoles()/local-RBAC authority, username/token mismatch rejection, invalid+expired JWT
rejection, role refresh on reconnect, local-user precedence, distributed external-role
propagation (base-table oracle +
system.query_logremote-identity assertion + helperBind-delta proof that the remote never re-authenticates the JWT), an expected-fail
view-oracle canary, and a fixed-string JWT leak scan over compose logs, both nodes'
on-disk logs, the runner transcript, and captured auth-failure bodies (with a
self-test). Also
cmd/synthetic-idpgained a repeatablerolequery param emittinga
rolesclaim (omitted when absent), with tests. Verified live: A–I exit 0 on both24.8.11.51285.altinitystableand25.8.28.10001.altinitystable.says the 24.8 baseline "contains the backport" needed for distributed external
roles. It contains ClickHouse #70332 (the push feature) but NOT #79099 ("Fix passing
of external roles in interserver query", merged 2025-06-09): on 24.8 (and 25.3)
setExternalRolesWithLockstores pushed roles incurrent_roles, which arefiltered against the ephemeral user's empty local grants — the remote log says
external_roles appliedyet the query is ACCESS_DENIED (#78791). No 24.8 AltinityStable release through 24.8.14.10547 has #79099. Verified in Altinity/ClickHouse
source and live. Distributed external-role propagation therefore works on
25.8+/26.3, not 24.8; the fixture encodes this as a per-build expectation
(
lib/expectations.sh:H_base_table_propagationexpected_fail on 24.8/25.3,must_pass on 25.8/26.3), asserting the specific ACCESS_DENIED shape and dying
loudly on an unexpected success ("BEHAVIOR CHANGED"). Recommended issue-body edit:
state the DoD's distributed-roles clause requires ≥25.8 Altinity Stable (or a 24.8
build with #79099 backported).
Pushed external roles (push_external_roles_in_interserver_queries) are lost when the remote query reads through a normal VIEW ClickHouse/ClickHouse#116840 — a normal VIEW on the remote
side loses pushed
external_rolesbecauseContextData's copy constructor omitsthat field and
StorageViewrecalculates access after cloning. Reproduces on everyLTS line through current 26.3 (upstream and Altinity Stable). Scenario H was
therefore reshaped from the plan's view-based oracle to a base-table oracle
(which is what the DoD actually requires) with remote identity asserted separately
via
system.query_log(initial_user/user), and the original view probe kept asscenarios/75-distributed-propagation-view.sh, an expected-fail canary that flipsto must-pass when ClickHouse fixes #116840. Human-directed (option "reshape H to
base table, test against both builds, research + file the view bug, keep a view
scenario").
integration/clickhouse/(test-only tree), notexamples/_platform, per the plan; it is a manual/local gate — no CI workflowadded (the repo still has no PR-time CI, a pre-existing condition).
run.shthatregenerates its own compose file; it is kept service-for-service in sync with
compose.ymland parameterized by the samePHASE3_CH_IMAGE(an earlierexperiment silently kept running the old image because the fallback had the image
hardcoded — fixed and documented). A normal Docker host never takes the fallback.
ldap.xml'srole_mappingsits directly under<ldap>, not nested under<roles>as the issue's illustrative XML showed — the real 24.8/25.8 parser readsit there; the committed example is copied from the working fixture as the issue
demands.
compatibility target (24.8-only → 24.8 baseline with expected-fail + 25.8 must-pass),
both human-approved and both forced by upstream ClickHouse defects, not by this
repo's code. Everything else per the approved plan.
ch-oauth-ldap; username↔token binding; token-derived roles reaching ClickHouse viaLDAP role mapping; local RBAC authoritative; local-user precedence; role refresh on
next authentication; no JWT in integration logs — all proven on both builds.
Distributed queries retain external roles — proven on 25.8, and shown to be
impossible on 24.8 without #79099 (documented limitation, not a fixture defect).
Deferred to phase 5: two-replica HA; broader security/redaction pass.
Altinity to backport ClickHouse #79099 to 24.8 Stable if 24.8 remains a supported
target for this feature; amend issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's compatibility paragraph (see above).
conversation https://chatgpt.com/c/6a910d15-c1a0-83eb-aa16-d926786d07ad, session
3d792471-0cb1-48fd-b9ce-4d8f98d9a057. Ad hoc root-cause consultation (sameconversation,
issuemode, uncapped): correctly predicted both bugs and thedecisive base-table-vs-view experiment before it was run.
over the complete branch diff found 1 HIGH / 4 MEDIUM / ~10 LOW, all accepted and
fixed before the PR: the HIGH was that scenario H's negative control (and the 24.8
expected-fail arm) accepted any non-200 / any ACCESS_DENIED, so on the default 24.8
build an origin-side denial would have let H pass while proving nothing about
propagation — fixed by requiring the denial to originate on the remote node
(
Received from clickhouse-remote:9000) plus an origin-side positive role checkbefore the distributed queries; MEDIUMs: transient-retry helper vs the exact-2-Binds
proof, raw JWTs on
grepargv in the leak scanner (→ pattern file), leak-scanartifacts not verified non-empty, remote grant exclusivity not asserted live.
VERDICT: SHIP— merged on an explicithuman ruling after 6 formal passes (human-extended cap) plus a post-cap architecture
consultation whose
REVISEconcerned issue/spec-level items, not the code (details inthe pass-by-pass record below). Totals: 11 findings accepted and fixed across passes
1/3/4/5/6 (0 rejected in those; pass 2 was a stale-snapshot tooling artifact, 4
rejected as already-fixed), plus 1 HIGH / 4 MEDIUM / ~10 LOW from the coordinator's
pre-PR review and 2 additional coordinator-found gaps. Every fix re-verified with
run-all-builds.sh(24.8 PASS, 25.8 PASS) before pushing. Pass-by-pass: Pass 1 (head8f3e303, session55cd505c-ece3-4547-9942-c614259682dd, seeded from the plansession; comment feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
→
fixed-await-push, 4 accepted / 0 rejected: P1 assertion failures interpolated rawHTTP bodies into the tee'd transcript (→
oauth_body_diagnostics: length/sha256/private artifact path only; coordinator caught 2 missed sites in scenario G and had
them fixed); P1 leak scan snapshotted logs before firing its own probes (→ probes
first, then collect, gate, scan); P2 probe ignored HTTP status (→ requires non-200);
P2 compose v1/v2 naming inconsistency. Both builds re-verified PASS after the fixes.
Pass 2 (head
e577d06) →no-accepted-findings: ChatGPT restated pass 1's fourfindings verbatim with a stale self-reported
reviewed_sha(8f3e303, pre-fix) — thesame stale-snapshot tooling behavior seen on PR feat(#19): phase 2 LDAP server (cmd/ch-oauth-ldap) #21, now filed as
chatgpt-review: pr mode returns a stale-head review after a push (restates prior findings, reports the old SHA) in long conversations altinity-sql-browser#680 (the skill's owning repo); the independent fact-check
rejected all four as already fixed at the live head (0 accepted / 4 rejected). Pass 3
in this session →
session-cap-exhaustedbefore reaching ChatGPT: pass 1's runner hadneeded 3 real CLI attempts, which the tool counts against the session's hard 3-call
cap (expected tooling behavior per review-loops.md, not a failed proof). Continued
under the human-extended 6-pass allowance in a second
pr-mode session seeded fromthe first (same conversation), with an explicit live-head re-fetch instruction.
Second session (
b9338cd4-ddc2-42d3-8f48-44b0aa1faad1) pass 1 (reviewed the livehead
e577d06; comment feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))→
fixed-await-push, 2 accepted / 0 rejected: scenario G parsed the response intoshell vars and interpolated those into
die()(credential-echo path aroundoauth_body_diagnostics) and only checked the first line → whole-body exact match;run.shinstalled its EXIT trap after image validation so an earlydieleaked theprivate run dir → trap moved before the tee/validation. Both fixed in
e2916eb, bothbuilds re-verified PASS,
tests/lib-tests.sh19/19.Second session pass 2 (reviewed
e2916eb; commentfeat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
→
fixed-await-push, 3 accepted / 0 rejected: the prior fix's trap now fired beforeENV_FILEexisted (SIGINT in that window →set -uabort inside cleanup, run dirleaked) →
ENV_FILEset before the trap + SIGINT regression test; the new cleanup testhad a guaranteed false negative (checked after its own
rm -rf) → flag recorded first;README staleness (TMPDIR default, 14-point preflight,
2 + retriesBind delta). Fixed inb043171, both builds re-verified PASS,lib-tests.sh20/20.Second session pass 3 (reviewed
b043171; commentfeat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
→ 1 accepted / 0 rejected (a pre-trap SIGINT window: RUN_TMP_DIR/ENV_FILE created
before
trap cleanup EXITis registered); the workflow's own fix stage returnedfix-failedfor an environmental reason, not a gate failure — the pass's read-onlyverify agent ran
git checkout mainin the main tree after reproducing the finding(the repo-footguns.md hazard), so the fix agent correctly refused to edit on the wrong
branch. Coordinator restored the branch (nothing lost;
b043171== origin) and appliedthe finding via a bounded fix agent (
0876f6b: state-safecleanup()andtrap cleanup EXITnow precedemktemp/ENV_FILE; SIGINT-after-mktemp regressiontest, sabotage-checked;
lib-tests.sh21/21; both builds re-verified PASS). Thisexhausts the second session's 3 passes
(5 real passes total); the 6th and final human-authorized pass ran in a third seeded
session (
ca9a9470-a96d-430f-b7f9-477eed16debe; reviewed0876f6b; commentfeat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment)) →
fixed-await-push, 1 accepted / 0 rejected: an even narrower teardown race (SIGINTbetween mktemp's mkdir and the RUN_TMP_DIR assignment) → fixed structurally in
c70f170by pre-computing the path andmkdir -m 700with collision retry, socleanup always knows the path;
lib-tests.sh22/22; both builds re-verified PASS.6 authorized passes spent without
VERDICT: SHIP→ mandatory post-cap architectureconsultation (issue mode, seeded from the third session, session
a6075b81-6319-45e5-8ab2-67abe2258f3d) at headc70f170→VERDICT: REVISE, butexplicitly NOT about the code: "the architecture is sound", no Go-orchestrator rewrite
warranted, and the final teardown form is "the right structural endpoint". Its five
concerns are issue/spec-level: (1) split issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's compatibility promise (24.8 =
ephemeral auth + dynamic local roles; distributed external roles need ≥25.8 or a
#79099 backport); (2) resolve plaintext-bearer vs ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16's TLS requirement in phase 4
(TLS on the LDAP hop, or a per-pod loopback sidecar vs the environment-level Service);
(3) document that the fixture is single-instance per Docker daemon (fixed
ch-phase3project/network names); (4) add PR CI for the Go gate + daemon-free
lib-tests.sh(keep the Docker matrix manual/scheduled); (5) make the issue body reflect the phase
decomposition and deferred DoD clauses. FULL STOP for human ruling per protocol.
Human ruling: add the single-instance note (item 3, doc-only), then merge phase 3 as
scoped; carry the rest forward — (1)+(5) as proposed issue-Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 body edits handed to the
human (
$TMPDIR/issue-19-proposed-edits.md; the coordinator does not edit issue bodies),(2) as an explicit decision requirement in phase 4's plan context, (4) filed as ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23
(daemon-free PR CI: Go gate +
lib-tests.sh; Docker matrix stays manual/scheduled).Single-instance note landed as
82aa109(comment/doc-only, verified;lib-tests.sh22/22).
751a120337738cffc9d1f49df0e2578b0a7e861aonorigin/main(PR feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22, head82aa109; reviewed-vs-merged SHA confirmed equal), localmainconfirmed non-divergedafter merge, on explicit human ruling (see Review outcome above).
Phase 4 — note (not started)
loop (ChatGPT-author / Fable-high; session
54f05f13-9f20-4cb3-889c-4468d4fd8b17,conversation https://chatgpt.com/c/6a916a93-dc34-83eb-9f83-a224773d058a) as
PLAN_STATUS: BLOCKEDon pass 1, exactly as the plan context instructed it to do ratherthan guess: issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 specifies an environment-level plaintext LDAP ClusterIP and
excludes TLS/LDAPS/StartTLS, while accepted ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 requires the OAuth token (which is
the LDAP simple-bind password) to be protected in transit; a NetworkPolicy is not
transport confidentiality. Flagged by both post-cap consultations (phases 2 and 3).
Options put to the human: (a) per-ClickHouse-pod loopback sidecar (satisfies ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16,
deviates from the issue's topology text), (b) environment-level plaintext Service with
a named risk owner accepting bearer exposure in-cluster (contradicts ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 unless
amended), (c) LDAPS/StartTLS on the LDAP hop (reopens phase-2 code, expands MVP scope),
(d) defer and skip phases 4–5.
thereby the named risk owner): option (b) — deploy
ch-oauth-ldapas anenvironment-level Deployment + ClusterIP Service on plain LDAP :389, exactly as
issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 specifies, with explicit, documented acceptance of the risk that the OAuth
bearer token travels in clear text as the LDAP simple-bind password on the trusted
in-cluster network. Compensating controls required by this decision: the Service is
ClusterIP-only (no Ingress/LoadBalancer/NodePort knobs offered), a NetworkPolicy
restricting ingress to the ClickHouse pods is rendered by the chart (recommended-on),
and the chart README + repo README state the plaintext-bearer risk and its owner
prominently. This is a deliberate deviation from accepted ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16's "tokens must be
protected with TLS" requirement for the MVP; a proposed ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 amendment (scope the
TLS requirement to hops outside the trusted cluster network, or record this MVP
exception with its owner and revisit criteria) has been handed to the human. TLS on the
LDAP hop and a per-pod sidecar topology remain documented alternatives, not MVP scope.
no
APPROVED→needs_human(conversationhttps://chatgpt.com/c/6a916da2-3294-83eb-ac2d-d572e7f27ade, session
1d67aa60-af7a-4782-baf0-ca966fe21cbc). Final-pass findings are specification polish(probe-vs-NetworkPolicy caveat wording, image-script per-arch pull/inspect parity with
scripts/build-image.sh, per-wave gate ownership for sabotage checks, pinned kubeconformschema revision,
go runmodule cwd, decoupletest.shfrom the skill doc, workflowconcurrency/dispatch parity); Fable recorded the substantive content (constants,
saturation behavior, binary defaults/validation, recorded decision, checklist coverage)
as verified-correct. Human ruling: approve the latest plan with the 7 findings folded
in as binding amendments (recorded in the plan file, section "Human-approved
amendments", A1–A7). Risk: High + Large per the plan → implementation via the
decompose-and-implement loop on
wip/phase4-deployment.build-ch-jwt-verify.ymlpath filtersomit
internal/**(sidecar image goes stale after shared-code fixes); flagged by theplan's out-of-scope section, deliberately not folded into phase 4 whose non-goals leave
that workflow untouched.
Phase 5 — note (in progress)
ed0c83e8-c85c-4d78-8fd2-79e5c8c29f8b, conversation https://chatgpt.com/c/6a91c7d2-a2ec-83eb-818e-c8fe990a6811). Not formally APPROVED after pass 5, but the final verdict's own summary says "no missing architecture decision blocks the plan; the remaining items are revisions". Coordinator decision (2026-08-28, human asleep, standing authorization to proceed): applied the human's phase-4 ruling — approved the latest plan with the final round's 7 findings folded in as binding amendments (plan-19p5.md§ "Coordinator-approved amendments"). Human may confirm or reverse; nothing merges without the code-review loop.handleSearchignores LDAP sizeLimit/timeLimit; no guard rejects unsupported critical controls; SDK v0.2.0 logs the raw JWTkidheader on JWKS rotation). Implemented via the decompose-and-implement loop.SDK_REDACTION_AUTHORIZATION_GATE: pinnedgo-mcp-oauth-sdk v0.2.0logs the unverified JWT headerkidon successful key rotation (oauth/jwt.go:117). Whether that violates the issue's "never log JWT contents" (strict reading) or is allowed metadata like issuer name (lenient reading) is not a recorded decision. This run will NOT touch the SDK repo. Options for the human: (a) authorize an SDK fix + release (then one follow-up helper PR: bump, re-audit, flip the manifest row, release gate green), or (b) recordkidas allowed non-credential metadata (then the row flips tosafeciting that decision). Until decided, phase 5's row staysmerged — blocked on SDK_REDACTION_AUTHORIZATION_GATErather thanshipped, and the Phase 5 checkbox stays unticked.search_limit+ scenario G', T10 chart third copy, T11 shell-lib hardening, T12a session probe, T13a strict operator YAML) merged intowip/phase5-verification. The wave-4 post-merge gate then failed correctly: T8's new redaction inventory test flagged 5 sinks added by T1/T2 with no manifest row and 2 stale rows — exactly the drift it exists to catch across concurrent sub-tasks. Reconciled in168d1bf(each sink classified from code — fixed constants / validated identity / numeric telemetry — and marker-tested at default and trace level; coordinator re-verified). T5 (filter resource probe) merged indca7461— it found a real defect: the goldap fork'sreadFilterAnd/Or/Notrecursed without a depth bound and re-wrapped the error at every level on unwind (O(N²) allocation; a depth-1000 malformed filter well inside the 64 KiB body cap measured ≈150 MB heap delta) — fixed with an explicit nesting cap of 32 (the only authorized filter needs depth 1), a goldap regression test, a thirdPATCHES.mdentry, and staged deep/wide probes proving linear, bounded behavior with a fresh Bind/Search succeeding after every stage. T12b (Docker HA fixture) merged in7b7bf60after a live green run: HAProxy (haproxy:lts-alpinepinned by digest) in front of two helpers; both served Binds; an A-bound persistent session died within bound when A was killed while B's Bind count stayed unchanged (no migration); a token minted after the kill authenticated via B; recreated A was readmitted via runtime DNS and served again; leak scan clean over 9 artifacts. Two sandbox footguns fixed on the way (HAProxy stale DNS cache before the network reshape;docker compose --force-recreateuses arenameAPI this isolator blocks →rm -fthenup), plus a realset -ebug (read <<< "$(fn)"swallows adiein the subshell). Coordinator independently re-ranrun-ha.sh(green: A=UP/B=UP → kill A → B's Bind count unchanged, newly minted token authenticates via B → A recreated, readmitted and serving; leak scan clean over 9 artifacts) andrun-all-builds.sh(24.8.11.51285 PASS, 25.8.28.10001 PASS, scenario G' meetingauth_fails_on_size_limit_exceeded— HTTP 403 — on both; scenarios H/H-view still reporting the two tracked upstream ClickHouse limitations as expected). One gate defect surfaced: the phase-4 chart gate's committeduntouched-pathsset includedcmd/**/internal/**/… — right for the phase-4 PR, wrong as a standing gate (phase 5 legitimately addscmd/ch-jwt-verify/verify_test.go); being narrowed to the sidecar surface (helm/ch-jwt-verify, sidecar workflow,Dockerfile,scripts/build-image.sh,examples). T13b merged ine5dab76:docs/ch-oauth-ldap-operator-guide.md(working ClickHouse XML incl.search_limit, OIDC/Auth0/JWKS reference, identity + role pipeline, cache invariant, measured Search-limit consequence, trust boundary, HA claim boundary + Kubernetes runbook, capacity, goldap nesting cap) withinternal/securitytest/docs_contract_test.gokeeping every config fence an exact excerpt of its source and enforcing required/forbidden wording; README/CLAUDE/integration-README/chart-README/PATCHES synced. The phase-4 chart gate'suntouched-pathsset was narrowed to the sidecar surface (7958482). Coordinator's full independent verification one5dab76: Go gate, tagged vet,-race, goldap tests, helm gate PASS, actionlint, non-goal paths empty, SDK pin unchanged; thephase5releasegate fails on exactly the one expected SDK row. Coordinator-run high-risk review of the complete diff: no P1; 5 P2 + 9 P3, all accepted — HA leak scan missed the killed replica's original log; the narrowed chart gate had dropped sidecar production Go; "three identical XML copies" overstated; integration README implied G' works on 25.3/26.3 (it fails closed); a stale manifest exemption let proof tests rot; plus inventory-fingerprint rigor, assertion pinning, and doc precision. The review also positively verified the protocol core (controls guard, Search limits fail-closed incl. RFC 4511sizeLimit 0, goldap cap vs the authorized filter, exact-256 cap, fd-level logger suppression) and that every redaction proof is non-vacuous. All fixed in8762c18(22 files). Coordinator re-verified on that head: Go gate, tagged vet,-race, goldap tests, helm gate PASS with the sidecar proof shown to bite on a production-Go touch, actionlint, 56/56 shell-lib tests, non-goal paths empty, SDK pin unchanged; Docker fixtures (HA + both ClickHouse builds) re-run on the same head — results recorded in the PR body. PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28 opened at heade4833c5; ChatGPT code-review loop: 2 passes in a fresh conversation, see the handoff.Phase 5 — handoff
Human decisions (2026-08-29 morning):
SDK_REDACTION_AUTHORIZATION_GATE→ resolution (a) (authorize the SDK fix + release, then one follow-up helper PR); the human also asked the coordinator to apply the proposed issue-body edits and tick the Phase 1–4 checkboxes. Done: issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 body edited (compatibility split 24.8 vs ≥25.8 with the base-table/VIEW qualification; illustrative XML replaced by the working fixture element incl.enable_tls/search_limit; Kubernetes-deployment section records the transport decision; Definition-of-done gained the phased-delivery note; all Phase 1–4 items and every proven## Testsitem ticked — the two Kubernetes-only HA items and the SDK-dependent redaction item stay open with notes); ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 gained an## Amendmentssection (MVP transport exception; distributed-query criterion qualified). Pre-edit bodies are backed up under the coordinator's$TMPDIR. SDK fix opened asAltinity/go-mcp-oauth-sdkPR build(deps): bump grafana/grafana from 11.4.0 to 13.1.0 in /examples/grafana/docker/grafana #9 (7afb092: fixed rotation message with amatched_keyscount only;TestJWKSRotationDoesNotLogKid— non-parallel, trace-level capture, two markers, non-vacuous); coordinator-reviewed; ChatGPT review in a fresh conversation, 3 passes: pass 1 REVISE (2 findings on the legacyValidateTokenpath — accepted:kidremoved from the error text with structural detection, legacy failure log classified instead ofErr(err), token-derivedgotaudience/scope lists replaced by counts; kept numericexp/nbf/iatby coordinator decision — fixed in3607f8e), pass 2 REVISE (double-%wbroke one-steperrors.UnwraptoErrTransient— fixed with a typed error in996c020), pass 3 SHIP. Merged as53b4399, taggedv0.2.1(also carries the dependabot go-sdk 1.7.0 bump). Helper follow-up PR fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUTHORIZATION_GATE #29 (841358c):go-mcp-oauth-sdk v0.2.1,auditedSDKVersionbumped, all fourexternal-pinnedrows re-audited against the v0.2.1 source (the rotation-log row flipped tosafe; zeroblocked_externalrows), the rotation test reshaped to assertkidabsence, docs/comments no longer describe the gate as open; coordinator verifiedgo test -tags phase5release ./internal/securitytest→ ok plus the full gate set. ChatGPT review running in a fresh conversation.Landed (PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28): LDAP protocol hardening — Search honors
sizeLimit(emit up to N, then result 4sizeLimitExceeded; 0 = unlimited per RFC 4511),timeLimit(result 3) andtypesOnly; a first-party pre-dispatch guard rejects unknown critical controls withunavailableCriticalExtension(criticality flag only, never OID/value), intercepting Abandon/Cancel before the vendored router; an explicitly encodedcriticality FALSEis malformed per the goldap fork. Remaining malformed-input matrix: hostile Bind-DN encodings (invalid UTF-8, embedded NUL, 65 525-byte DN under the 64 KiB cap), Unbind/abrupt close mid-Search, the exact 256-connection cap (257th gets EOF, freed slot re-Binds), and staged deep/wide malformed-filter resource probes — which found and fixed a real defect in the goldap fork (unbounded AND/OR/NOT recursion with per-level error re-wrapping → ≈150 MB heap for one 64 KiB message; now a nesting cap of 32, thirdPATCHES.mdentry, regression at exactly the limit and one over). Systematic redaction proof:internal/securitytestAST inventory of every log/error/response-construction sink acrosscmd/ch-oauth-ldap,cmd/ch-jwt-verify,internal/*and the vendoredldapserverlogger, keyed by stable fingerprints (zerolog fingerprint includes the field chain), cross-checked againsttestdata/redaction-sites.tsv(unmapped or stale rows failgo test), every credential-reachable row mapped to a real marker test at default AND trace level (serialized global-logger capture), SDK version/entrypoint audit that cannot pass vacuously, and aphase5release-tagged release gate. Docker HA fixture (integration/clickhouse/run-ha.sh: HAProxylts-alpinepinned by digest in front of two helpers, rootless :389 preflight,show statpolling, ANSI-stripped delta Bind counts, persistent A-bound session probe,docker killA → probe fails / B unchanged / new token authenticates via B → A recreated and readmitted via runtime DNS, HA leak scan incl. the killed replica's pre-kill log) plustests/cases/ha-fallback-parity.sh. Scenario G' (<search_limit>256</search_limit>made explicit in the fixture, README and chart in lockstep; 257 mapped roles → per-build measured consequenceauth_fails_on_size_limit_exceeded, HTTP 403, on 24.8 and 25.8; other lines fail closed). Operator guidedocs/ch-oauth-ldap-operator-guide.md(ClickHouse XML copied from the fixture, OIDC/Auth0/JWKS, identity + Antalya-aligned role pipeline, cache invariant, measured Search-limit consequence, trust boundary with the recorded risk owner, HA claim boundary + Kubernetes runbook, capacity, nesting cap) withdocs_contract_test.gokeeping every marked fence an exact excerpt of an allow-listed source and enforcing required/forbidden wording; README/CLAUDE/integration-README/chart-README/PATCHES synced. Chart gate's untouched-path proof rescoped to the sidecar surface (production Go, tests excluded).Decisions taken (not in the issue): the coordinator approved the plan under the human's standing authorization (see the Phase 5 note);
SDK_REDACTION_AUTHORIZATION_GATEleft for the human (both resolutions below); Kubernetes-only HA behavior explicitly not claimed — proven in Docker, runbook for a real cluster.Deviations from the spec: none in scope; the issue's HA tests are satisfied in Docker terms with the Kubernetes convergence step documented as unverified here.
Definition of done: "two helper replicas work without shared state" — closed (Docker; Kubernetes convergence delegated to the runbook). "neither cache behavior nor logs can extend or leak bearer credentials" — cache half closed since phase 1; logs half closed for all first-party code, open for one externally-owned sink (the SDK
kidrow). Everything else was closed in phases 1–4 with the recorded ≥25.8 distributed-role qualification.Open gate for the human —
SDK_REDACTION_AUTHORIZATION_GATE:go-mcp-oauth-sdk v0.2.0logs the unverified JWT headerkidon successful JWKS rotation (oauth/jwt.go:117). Resolutions: (a) authorize an SDK fix + release, then one follow-up helper PR (bumpgo.mod, updateauditedSDKVersion, re-audit everyexternal-pinnedrow, flip the row tosafe, reshape the rotation test to assertkidabsence,phase5releasegate green); (b) recordkidas allowed non-credential metadata (row flips tosafeciting the decision; rotation test asserts bearer/payload/signature absence only). Until one lands: row statusmerged — blocked on SDK_REDACTION_AUTHORIZATION_GATE, Phase 5 checkbox NOT ticked, andgo test -tags phase5release ./internal/securitytestfails on exactly that one row by design.Follow-ups filed: ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23 (PR CI), ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale #24 (sidecar workflow path filters), ch-jwt-verify image publication: refuse tag re-push and build from an exported HEAD tree (parity with ch-oauth-ldap, #25) #26 (sidecar image publication parity), Pushed external roles (push_external_roles_in_interserver_queries) are lost when the remote query reads through a normal VIEW ClickHouse/ClickHouse#116840, altinity-sql-browser#680, ClickHouse version compatibility: track upstream external-role fixes (#79099, #116840) and restore full 24.8 Altinity Stable support #30 (ClickHouse version compatibility tracker — restoring full 24.8 Altinity Stable support once a bugfix release backports #79099), LDAPS/TLS auth-proxy deployment mode: standalone ch-oauth-ldap on customer premises for any ClickHouse's native LDAP auth #31 (LDAPS/TLS auth-proxy deployment mode for on-premises ClickHouse — the ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 amendment's exit (a)).
Plan review: ChatGPT-authored, 5 Fable/high passes (session
ed0c83e8-c85c-4d78-8fd2-79e5c8c29f8b); approved by the coordinator with 7 binding amendments under the human's standing authorization.Review outcome: coordinator-run high-risk review (5 P2 + 9 P3, no P1, all fixed in
8762c18); ChatGPT pass 1 (e4833c5, fresh conversationhttps://chatgpt.com/c/6a92103d-8ed8-83ed-9293-5e1d7f19af04, session183d9799-cbcc-44ec-8970-040cbfcaec1c): 1 P3 accepted and fixed in64f4ba3(docs-contract source allowlist enforced), 2 P2 rejected with reproduction. Pass 2 (64f4ba3): 1 finding, rejected on the facts (conflated two tests; no Debug/Trace log calls exist ininternal/ldapproduction code; the vendored-logger check is a stdliblogpath). No accepted findings on the final head → merged per the human's standing authorization.Merged:
cb46895onorigin/main(merge commit of PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28 at head64f4ba3, 2026-08-29). Gate closed: PR fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUTHORIZATION_GATE #29 merged as5628f6b(2026-08-29) —go-mcp-oauth-sdk v0.2.1, zeroblocked_externalrows,go test -tags phase5release ./internal/securitytestgreen; Phase 5 checkbox and the redaction test item ticked in the issue. Both push-to-main image workflows oncb46895completed success (ch-oauth-ldapviainternal/**;ch-jwt-verifyvia its new test file). Row staysmerged — blocked on SDK_REDACTION_AUTHORIZATION_GATEand the Phase 5 checkbox stays unticked until the human resolves the gate (see above).Phase 4 — handoff
Human decision (2026-08-28, evening): after 5 real ChatGPT passes (every accepted finding fixed and coordinator-verified; the security-relevant chart surface clean since pass 1, passes 2–5 confined to the manual publish script / workflow guards) the human waived the remainder of the 6-pass budget, authorized merging feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 as verified, and authorized proceeding to phase 5 unattended.
Landed: standalone Helm chart
helm/ch-oauth-ldap/(Deployment default 2 replicas +values-dev.yaml1-replica override; ClusterIP Service 389→3389; rootless UID/GID 65532,read-only root FS, drop ALL, process listens on 3389 so no privileged bind;
tcpSocketprobes; requests 50m/64Mi, limits 500m/128Mi; rollout
maxUnavailable: 0; soft podanti-affinity; preStop
/bin/sleep 5; config-checksum rollout annotation; PDBminAvailable: 1when replicas > 1; default-on source-restricting NetworkPolicy;ConfigMaps for the helper YAML (exact
cmd/ch-oauth-ldap/config.goshape) and theClickHouse LDAP XML derived from the phase-3 working fixture with the Service DNS built
from release namespace +
clusterDomain); one central fail-closedvalidatehelper(required inputs, forbidden
ldap.listen, reserved chart labels/annotation, allow-allselector shapes); image publication path (
Dockerfile.ch-oauth-ldap, manual multi-archscripts/build-ch-oauth-ldap-image.shmirroringscripts/build-image.sh, and.github/workflows/build-ch-oauth-ldap.yml— push-to-main only, path filters includeinternal/**/third_party/**, immutableldap-<7-sha>tags, concurrency group,tag_prefixdispatch); committed gatehelm/ch-oauth-ldap/test.sh+ci/lib/*.sh(helm lint/template permutations, negative matrix, kubeconform pinned
v0.8.0+ schemacommit
14355cdd…, embedded YAML/XML Go verifier, docs assertions, cross-compile botharches, old-chart smoke, untouched-path proof, packaging, self-SIGINT cleanup); docs
synced in
README.md,CLAUDE.md,helm/ch-oauth-ldap/README.md,repo-footguns.md.High + Large → decompose-and-implement loop (11 sub-tasks in 4 waves). Verified by the
coordinator: gate PASS (0 failures), Go gate green, non-goal paths untouched,
helm/ch-jwt-verifyrenders byte-identically to a pre-phase baseline.Decisions taken (not in the issue): the recorded transport-security decision above
(environment-level plaintext ClusterIP with named risk acceptance) and its binding
consequences; process port 3389 + Service 389 instead of a privileged bind; NetworkPolicy
default-ON (the issue said "recommend"; the recorded decision made it a compensating
control) with
enabled=falseas the documented CNI escape hatch (A1: probe reachabilityunder the policy is CNI-dependent and unverified without a cluster); image publication
built in this phase rather than left as a prerequisite (the chart is not honestly
deployable without an image); kubeconform tool + schema pinned for reproducible schema
validation.
Deviations from the spec: none from the issue's phase-4 checklist; the plan itself
was approved by the human WITH seven amendments (A1–A7) after the plan loop ended
needs_human— all implemented.Deferred acceptance criteria: none of the global DoD claimed; "two helper replicas
work without shared state" is enabled here and proven in phase 5. No live-cluster
verification was possible (kind blocked by the sandbox's privileged-container
isolator): probe-vs-NetworkPolicy behavior per CNI and real HA remain unverified here.
Follow-ups filed: ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale #24 (sidecar workflow path filters omit
internal/**); ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23 (PR CI)already filed in phase 3. Proposed ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 amendment + issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 edits handed to the human.
Plan review: ChatGPT-author / Fable-high; first run
BLOCKEDon the transportdecision (correctly), second run
needs_humanafter 5 passes with substanceverified-correct; human approved with amendments. Conversations
https://chatgpt.com/c/6a916a93-dc34-83eb-9f83-a224773d058a (blocked run) and
https://chatgpt.com/c/6a916da2-3294-83eb-ac2d-d572e7f27ade (session
1d67aa60-af7a-4782-baf0-ca966fe21cbc).Internal pre-PR review (High-risk + Large → mandatory): Fable/high read-only pass over
the complete branch diff found 4 HIGH / 1 MEDIUM / ~8 LOW, all accepted and fixed before
the PR. The HIGHs: (a) a newline in any XML-bound value (e.g.
group_base_dn) escaped theClickHouse ConfigMap's block scalar and rendered an arbitrary extra resource — reproduced
as a
LoadBalancerService selecting the helper pods, defeating the "public exposurecannot be selected" invariant → newline guard in
validate+ XML emitted via a quotedvariable; (b) unquoted scalar interpolations in the Deployment let
priorityClassNameinject
hostNetwork: true(node-IP exposure of the plaintext LDAP port) → every scalarquoted, ints coerced, names/keys regex-validated; (c) the manual image script's
umask 077produced a 0700 root-owned binary that UID 65532 cannot execute (CI-builtimages unaffected) → explicit
chmod 0755+ static gate assertion; (d) kubeconform/renderfailures in the positive matrix ran inside
$(…)subshells soGATE RESULT: PASSwasprinted regardless — reproduced with a stub kubeconform → renders written to deterministic
paths, failures counted in the parent. MEDIUM: a
DoesNotExist-only selector passedvalidation yet matched all pods/namespaces → rejected + claims reworded. Every category
else (exposure knobs, NetworkPolicy AND-peer semantics, YAML/XML escaping round-trips,
rootless 3389 end to end, image path parity/immutability, docs vs constants) verified clean.
Review outcome: in progress — PR feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 opened at head
972504f(2026-08-28); ChatGPTcode-review loop running (up to 6 passes per the human's standing instruction). Pass 1
(
972504f): 2 findings fixed inc1f40c5. Pass 2 (c1f40c5): 2 MAJOR — publish scriptnow builds from a
git archive HEADexport; script+workflow refuse to re-push an existingtag; README states the real guarantee; sidecar-path parity filed as ch-jwt-verify image publication: refuse tag re-push and build from an exported HEAD tree (parity with ch-oauth-ldap, #25) #26; fixed in
4c4d3a0. Pass 3 (4c4d3a0): 3 MAJOR + 1 MINOR fixed in61d5a08(per-arch republishguard, script self-re-exec from HEAD, digest-form
image.tag, dirty-tree flag); thecoordinator then found the self-re-exec broken in the realistic invocation and had it fixed
in
01e8164with a no-env gate case. Pass 4 (01e8164): 2 MAJOR fixed ina72a021(fail-closed tag existence checks re-checked before every registry mutation; PID-bound
self-re-exec markers). Pass 5 on
a72a021: first attempt 2026-08-28 ~16:55Z hit a ChatGPT rate limit before any review was submitted (no pass consumed, no comment); retried per the human's instruction in a brand-new ChatGPT conversation: revieweda72a021, 1 MAJOR confirmed (the workflow's tag-existence guards were not errexit-safe under the runner'sbash -e, so every first publication would have failed; the manual script was unaffected) — fixed in23e0192with a gate case that executes the extracted step bodies underbash -eo pipefail; pass 6 (23e0192, fresh conversation): 1 finding — the per-arch TOCTOU window between the pre-build tag check anddocker/build-push-action's push — rejected as the explicitly documented, accepted limitation (no registry-side conditional create/lock; the workflow header and both READMEs already scope the guarantee to check-time refusal). No accepted findings. Six passes total, five real reviews; every accepted finding fixed and coordinator-verified; final head23e0192.Merged:
9a5ebc7onorigin/main(merge commit of PR feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 at head23e0192, 2026-08-28), per the human's explicit authorization;feat/19-phase4-deploymentandwip/phase4-deploymentdeleted. Phase 5 branchfeat/19-phase5-verificationcut at9a5ebc7.Post-merge hotfix (2026-08-28): the first push-triggered runs of
.github/workflows/build-ch-oauth-ldap.ymlonmainfailed instantly with "workflow file issue": a bash comment inside the manifest job'srun:body (added by the pass-5 fix23e0192) contained the literal text${{ }}, which GitHub evaluates as an (empty, invalid) expression before bash runs. The gate's plain-YAML parse cannot see this; actionlint does (:218:686 unexpected end of input … [expression]). Hotfix on its own branch/PR (fix(ci): remove literal expression text that invalidated build-ch-oauth-ldap.yml; gate workflows with actionlint #27, merged ase01c2b4): reworded comment + actionlint (pinned v1.7.7, fail-closed) added tohelm/ch-oauth-ldap/test.shwith a negative case; ChatGPT review skipped for this one-line-cause hotfix under the human's standing merge authorization (Agent Chrome was occupied by the phase-5 plan loop); verified by the push-to-main run one01c2b4(run 33196520121: build amd64 + arm64 + manifest all green) — publishedghcr.io/altinity/ch-oauth-ldap:ldap-e01c2b4(amd64+arm64 manifest list confirmed withdocker manifest inspect; the two extraunknownentries are build-push-action provenance attestations).feat(#19): phase 1 shared correctness/refactor for ch-jwt-verify
docs(#19): correct overclaiming comment on generic /verify failure re…
Merge wip/phase1-shared-refactor: issue #19 phase 1 shared correctnes…
fix(##19 phase 1): address review pa 10BC8 ss 1 findings
fix(##19 phase 1): address review pass 2 findings
Merge pull request #20 from Altinity/feat/19-phase1-shared-refactor
feat(#19): pin LDAP deps and add internal/ldap primitives
feat(#19): implement LDAP server lifecycle, Bind/Search handlers, and…
feat(#19): add ch-oauth-ldap command config, defaults, and process li…
merge: t3-cmd-ch-oauth-ldap (#19)
merge: t4-adversarial-proofs (#19)
docs(#19): synchronize README/CLAUDE.md for ch-oauth-ldap
Merge wip/phase2-ldap-server: issue #19 phase 2 LDAP server
fix(##19 phase 2): address review pass 1 findings
61 remaining items
merge: T10 (#19)
merge: T11 (#19)
merge: T5 (#19)
feat(integration): add Docker HA fixture for ch-oauth-ldap (issue #19 …
merge: T12b (#19)
docs(ch-oauth-ldap): add operator guide; sync README/CLAUDE/integrati…
merge: T13b (#19)
fix(#19): close phase-5 pre-PR review findings (HA leak-scan coverage…
merge: wip/phase5-verification into feat/19-phase5-verification (#19 …
fix(#19): address review pass 1 findings
feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docke…
fix(#19): address review pass 1 findings
fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUT…
test(#23): revert teardown to the proven unbounded pattern; scope the…