Skip to content

changefeedccl: add file-based OAuth client assertion support#171223

Closed
KeithCh wants to merge 3 commits into
cockroachdb:masterfrom
KeithCh:kafka-file-based-oauth-secret
Closed

changefeedccl: add file-based OAuth client assertion support#171223
KeithCh wants to merge 3 commits into
cockroachdb:masterfrom
KeithCh:kafka-file-based-oauth-secret

Conversation

@KeithCh

@KeithCh KeithCh commented May 29, 2026

Copy link
Copy Markdown
Contributor

security/secretdir: add jailed credential reader and --secret-directory flag
Add infrastructure for node-local subsystems to read credential
files from a single operator-bounded directory.

Example:
cockroach start --secret-directory=/etc/cockroach/secrets ...


changefeedccl: thread BuildContext through saslMechanismBuilder
BuildContext is an extension point on saslMechanismBuilder for
passing resources beyond URI params, letting individual mechanisms
pull their own dependencies without dispatcher-level special-casing.
Today it carries a *secretdir.Reader, which exposes credential
files from the directory configured by the --secret-directory node
flag.


changefeedccl: add file-based OAuth client assertion support

Add sasl_proprietary_client_assertion_location URI parameter for Kafka changefeeds to reference a file-based OAuth client assertion.

e.g.

CREATE CHANGEFEED FOR t INTO 'kafka://.../?sasl_proprietary_client_assertion_location=/path/to/jwt'

The path needs to be an absolute path.

All nodes should have the --secret-directory flag set to the same directory. Users need the EXTERNALIOIMPLICITACCESS privilege to use create changefeeds that use file-based OAuth client assertions. Exactly one of sasl_proprietary_client_assertion_location or sasl_proprietary_client_assertion should be set when using PROPRIETARY_OAUTH.

Release note: None
Epic: CRDB-62004

@trunk-io

trunk-io Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity

Copy link
Copy Markdown
Member

This change is Reviewable

@blathers-crl

blathers-crl Bot commented May 29, 2026

Copy link
Copy Markdown

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch 8 times, most recently from 7924262 to 19a275a Compare June 1, 2026 21:44
@blathers-crl

blathers-crl Bot commented Jun 1, 2026

Copy link
Copy Markdown

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from 19a275a to 1abad9d Compare June 1, 2026 22:43
@KeithCh KeithCh marked this pull request as ready for review June 1, 2026 22:51
@KeithCh KeithCh requested review from a team as code owners June 1, 2026 22:51
@KeithCh KeithCh requested review from DrewKimball, cpj2195, herkolategan and rharding6373 and removed request for a team June 1, 2026 22:51
@KeithCh KeithCh changed the title changefeedccl: add file-based OAuth client secret support changefeedccl: add file-based OAuth client assertion support Jun 1, 2026
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from 1abad9d to eabd669 Compare June 1, 2026 22:53
@KeithCh KeithCh requested a review from jeffswenson June 1, 2026 22:54
@KeithCh KeithCh marked this pull request as draft June 1, 2026 23:05
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from eabd669 to d9bc921 Compare June 1, 2026 23:26
@KeithCh KeithCh marked this pull request as ready for review June 1, 2026 23:27
Comment thread pkg/server/server_sql.go
Comment thread pkg/server/server_sql.go
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

AI Review: Potential Issue(s) Detected

Inline comments have been added to the relevant lines in pkg/server/server_sql.go.

Summary: The PR accidentally deletes the ResourceGroupCache initialization (resourcegroupcache.New()) and its import in pkg/server/server_sql.go. These two lines are unrelated to the PR's purpose (file-based OAuth client assertion support for changefeeds) and appear to have been lost during rebase or merge conflict resolution. The field declaration (exec_util.go:1993) and usage (vars.go:1466) remain intact, but without initialization SET resource_group is silently broken for all users — it always returns "unknown resource group".

View full analysis


If helpful: add O-AI-Review-Real-Issue-Found label.
If not helpful: add O-AI-Review-Not-Helpful label.

@github-actions github-actions Bot added the o-AI-Review-Potential-Issue-Detected AI reviewer found potential issue. Never assign manually—auto-applied by GH action only. label Jun 1, 2026
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch 7 times, most recently from bae5f70 to b37afc9 Compare June 2, 2026 15:28
…ry flag

Add infrastructure for node-local subsystems to read credential
files from a single operator-bounded directory.

Example:
  cockroach start --secret-directory=/etc/cockroach/secrets ...

Release note: None
Epic: CRDB-62004

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from b37afc9 to a67c7e8 Compare June 2, 2026 15:42
BuildContext is an extension point on saslMechanismBuilder for
passing resources beyond URI params, letting individual mechanisms
pull their own dependencies without dispatcher-level special-casing.
Today it carries a *secretdir.Reader, which exposes credential
files from the directory configured by the --secret-directory node
flag.

Release note: None
Epic: CRDB-62004

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from a67c7e8 to 5a2160f Compare June 2, 2026 16:00
Add sasl_proprietary_client_assertion_location URI parameter for Kafka
changefeeds to reference a file-based OAuth client assertion.

e.g.
```
CREATE CHANGEFEED FOR t INTO 'kafka://.../?sasl_proprietary_client_assertion_location=/path/to/jwt'
```
The path needs to be an absolute path.

All nodes should have the --secret-directory flag set to the same
directory. Users need the EXTERNALIOIMPLICITACCESS privilege to use
create changefeeds that use file-based OAuth client assertions.
Exactly one of sasl_proprietary_client_assertion_location or
sasl_proprietary_client_assertion should be set when using
PROPRIETARY_OAUTH.

Release note: None
Epic: CRDB-62004

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@KeithCh KeithCh force-pushed the kafka-file-based-oauth-secret branch from 5a2160f to 94589c6 Compare June 2, 2026 16:54
@KeithCh KeithCh closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

o-AI-Review-Potential-Issue-Detected AI reviewer found potential issue. Never assign manually—auto-applied by GH action only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants