Skip to content

Conversation

sago2k8
Copy link
Contributor

@sago2k8 sago2k8 commented Aug 11, 2025

Description

Update the authentication documentation to better explain how OIDC principals should be formatted in superusers configuration and ACL rules. The changes make it clear that the sub claim value is used directly without prefixes, unlike SASL users.

Resolves https://redpandadata.atlassian.net/browse/
Review deadline:

Page previews

Checks

  • New feature
  • Content gap
  • Support Follow-up
  • Small fix (typos, links, copyedits, etc)

@sago2k8 sago2k8 requested a review from a team as a code owner August 11, 2025 10:29
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for redpanda-docs-preview ready!

Name Link
🔨 Latest commit c1e986b
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-docs-preview/deploys/6899c76825459500081ac1a7
😎 Deploy Preview https://deploy-preview-1302--redpanda-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

The PR updates the OIDC guidance in modules/manage/partials/authentication.adoc. It changes instructions to use the exact JWT sub claim value for superusers and ACL rules, removing prior examples that used equality checks and the user:OIDC: prefix. It clarifies that OIDC principals are derived from token claims via configured principal mapping and do not require a prefix. No code or exported entities are modified; this is a documentation-only change focused on principal mapping and representation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Suggested reviewers

  • weeco
  • micheleRP
  • JakeSCahill
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sj/attempt-to-fix-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sago2k8 sago2k8 requested review from Copilot and BenPope August 11, 2025 10:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the authentication documentation to clarify how OIDC principals should be formatted in different contexts. The documentation was previously unclear about the format differences between OIDC and SASL authentication methods.

  • Clarifies that OIDC principals use the sub claim value directly without prefixes
  • Provides clearer examples for both superusers configuration and ACL rules
  • Distinguishes OIDC principal formatting from SASL user formatting

@sago2k8 sago2k8 force-pushed the sj/attempt-to-fix-docs branch from dd3c9a5 to 363a18b Compare August 11, 2025 10:30
Update the authentication documentation to better explain how OIDC
principals should be formatted in superusers configuration and ACL
rules. The changes make it clear that the sub claim value is used
directly without prefixes, unlike SASL users.

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
@sago2k8 sago2k8 force-pushed the sj/attempt-to-fix-docs branch from 363a18b to c1e986b Compare August 11, 2025 10:35
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
modules/manage/partials/authentication.adoc (1)

69-69: Use an admonition and scope the “User:” prefix note to ACLs; add ending period

Convert to a [NOTE] block for consistency and clarify that the “User:” prefix applies to SASL principals in ACLs only, while OIDC principals never use a prefix. Also add the missing period.

-Note: Unlike SASL users which require the User: prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix
+[NOTE]
+====
+In ACLs, SASL principals require the `User:` prefix (for example, `User:myuser`). OIDC principals do not use any prefix; use the value extracted from the token's claims according to the configured principal mapping (default `$.sub`).
+====
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47f1c1d and c1e986b.

📒 Files selected for processing (1)
  • modules/manage/partials/authentication.adoc (1 hunks)

Comment on lines +66 to +68
- If your OIDC token's sub (subject) claim contains [email protected], then:
* For superusers configuration: Use the exact sub claim value: [email protected]
* For ACL rules: Use the exact sub claim value: [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Clarify equality and tighten wording (“contains” → “equals”), and be precise about where to use the value

“contains” is ambiguous for a single-valued claim. Recommend stating that sub equals the value, and aligning the bullets with “superusers list” and ACL usage.

- - If your OIDC token's sub (subject) claim contains [email protected], then:
-* For superusers configuration: Use the exact sub claim value: [email protected]
-* For ACL rules: Use the exact sub claim value: [email protected]
+ - If your OIDC token's sub (subject) claim is [email protected], then:
+* For the superusers list (cluster configuration): use the exact sub claim value: [email protected]
+* For ACL rules: use the exact sub claim value: [email protected]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- If your OIDC token's sub (subject) claim contains [email protected], then:
* For superusers configuration: Use the exact sub claim value: [email protected]
* For ACL rules: Use the exact sub claim value: [email protected]
- If your OIDC token's sub (subject) claim is [email protected], then:
* For the superusers list (cluster configuration): use the exact sub claim value: [email protected]
* For ACL rules: use the exact sub claim value: [email protected]
🤖 Prompt for AI Agents
In modules/manage/partials/authentication.adoc around lines 66 to 68, the
wording is ambiguous — replace "contains" with "equals" and clarify the bullets
to state where to use the exact sub claim value: specify "For superusers list:
use the exact sub claim value ([email protected])" and "For ACL rules: use the
exact sub claim value ([email protected])" so both bullets consistently and
precisely indicate equality and the intended configuration target.

Comment on lines +66 to +69
- If your OIDC token's sub (subject) claim contains [email protected], then:
* For superusers configuration: Use the exact sub claim value: [email protected]
* For ACL rules: Use the exact sub claim value: [email protected]
Note: Unlike SASL users which require the User: prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix
Copy link
Contributor

@JakeSCahill JakeSCahill Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- If your OIDC token's sub (subject) claim contains [email protected], then:
* For superusers configuration: Use the exact sub claim value: [email protected]
* For ACL rules: Use the exact sub claim value: [email protected]
Note: Unlike SASL users which require the User: prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix
If your OIDC token's sub (subject) claim is [email protected], use that exact sub claim value for superusers configuration and ACL rules.
Unlike SASL users which require the `User:` prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix

- If your token's `sub` claim is `[email protected]`, then:
* In the `superusers` list, specify the principal as `[email protected]`
* In ACL rules, specify the principal as `user:OIDC:[email protected]`
- If your OIDC token's sub (subject) claim contains [email protected], then:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure "contains" is clearer than "is", to me, contains implies that there could be other characters preceding or following it.

- If your OIDC token's sub (subject) claim contains [email protected], then:
* For superusers configuration: Use the exact sub claim value: [email protected]
* For ACL rules: Use the exact sub claim value: [email protected]
Note: Unlike SASL users which require the User: prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know where this prefix comes in, or is displayed, or where the user specifies it.

I think it's pretty much in :8081/security/acls, and what's returned from rpk security acl list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you maybe help me here @r-vasquez , both are valid in my experience (User:, ), I am not sure what's preferable or which one should be in the documentation ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My 2c with this doc change is that the document talks about configuring principals, and then we mention that we can use sub claims, I think we should be more explicit, something like:

If your OIDC token's sub (subject) claim is [email protected], use that exact sub claim value as your principal for superusers configuration and ACL rules.
	
Unlike SASL users which require the `User:` principal type prefix, OIDC principals use the value extracted from the token's claims (according to the configured principal mapping) without any prefix

I think it's pretty much in :8081/security/acls, and what's returned from rpk security acl list?

Yes, also when creating, we have an example in this same page below

Grant the new user describe privileges for a topic called myfirsttopic:

rpk security acl create --allow-principal User:myuser \

Which is actually not needed, but it doesn't hurt. 😅

Copy link
Member

@BenPope BenPope Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grant the new user describe privileges for a topic called myfirsttopic:

rpk security acl create --allow-principal User:myuser \


_Which is actually not needed, but it doesn't hurt. 😅_

It's not needed, and shouldn't be in the docs.

Oh, I do not like this UX:

Without prefix:

rpk security acl create --allow-principal myuser ...
rpk security acl list
PRINCIPAL                   HOST  RESOURCE-TYPE  RESOURCE-NAME  RESOURCE-PATTERN-TYPE  OPERATION  PERMISSION  ERROR
User:myuser                 *     TOPIC          model-         PREFIXED               ALL        ALLOW

With prefix

rpk security acl create --allow-principal User:myuser ...
rpk security acl list
PRINCIPAL                   HOST  RESOURCE-TYPE  RESOURCE-NAME  RESOURCE-PATTERN-TYPE  OPERATION  PERMISSION  ERROR
User:myuser                 *     TOPIC          model-         PREFIXED               ALL        ALLOW

Principal that contains the User: prefix:

rpk security acl create --allow-principal User:User:myuser ...
rpk security acl list
PRINCIPAL                   HOST  RESOURCE-TYPE  RESOURCE-NAME  RESOURCE-PATTERN-TYPE  OPERATION  PERMISSION  ERROR
User:User:myuser            *     TOPIC          model-         PREFIXED               ALL        ALLOW

The prefix isn't needed because to get a role, you ask for a role:

rpk security acl create --allow-role myrole ...
rpk security acl list
PRINCIPAL                   HOST  RESOURCE-TYPE  RESOURCE-NAME  RESOURCE-PATTERN-TYPE  OPERATION  PERMISSION  ERROR
RedpandaRole:myrole         *     TOPIC          model-         PREFIXED               ALL        ALLOW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants