Skip to content

Conversation

@omertuc
Copy link
Member

@omertuc omertuc commented Jul 25, 2025

Update lightspeed-stack to the latest version which includes this PR:

lightspeed-core/lightspeed-stack#243

Modify our configuration to use the new jwk-token authentication module, with the JWK URL pointing to the Red Hat SSO server and using the user ID / username fields that can be found in a typical JWT issued by Red Hat SSO.

Summary by CodeRabbit

  • New Features

    • Updated authentication to use JWT-based authentication with JSON Web Key (JWK) certificates from an OpenID Connect endpoint.
    • User identification now leverages specific JWT claims for improved security.
  • Chores

    • Updated internal subproject reference and base image tag for improved compatibility.

@openshift-ci openshift-ci bot requested review from carbonin and eranco74 July 25, 2025 17:40
@openshift-ci
Copy link

openshift-ci bot commented Jul 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omertuc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Walkthrough

The authentication configuration in both lightspeed-stack.template.yaml and template.yaml was updated from a no-op token module to a JWT-based authentication using a JWK endpoint. The lightspeed-stack subproject reference and the base image tag in Containerfile.assisted-chat were updated to newer commits. No changes to code logic or exported entities were made.

Changes

File(s) Change Summary
Authentication Configurations
lightspeed-stack.template.yaml, template.yaml
Switched authentication from "noop-with-token" to "jwk-token" with JWK config and JWT claim mappings.
Subproject Reference
lightspeed-stack
Updated subproject commit reference from 0cb49fca7... to f6cc2038....
Container Image
Containerfile.assisted-chat
Updated base image tag from dev-20250718-0cb49fc to dev-20250728-f6cc203.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • eranco74

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f1ec92d and af4432a.

📒 Files selected for processing (4)
  • Containerfile.assisted-chat (1 hunks)
  • lightspeed-stack (1 hunks)
  • lightspeed-stack.template.yaml (1 hunks)
  • template.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Containerfile.assisted-chat
🚧 Files skipped from review as they are similar to previous changes (3)
  • template.yaml
  • lightspeed-stack
  • lightspeed-stack.template.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Red Hat Konflux / assisted-chat-saas-main-on-pull-request
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

@omertuc omertuc marked this pull request as draft July 25, 2025 17:44
Copy link

@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

🧹 Nitpick comments (1)
lightspeed-stack.template.yaml (1)

21-23: Hard-coding the JWK URL hurts flexibility & non-prod deployments
Consider following the template.yaml approach and let callers inject ${SSO_BASE_URL} (or similar) instead of baking the Red Hat production URL into the image-level config.

-    url: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs
+    # Keep prod as the default but allow override via env / Helm / Kustomize
+    url: ${SSO_BASE_URL:-https://sso.redhat.com}/auth/realms/redhat-external/protocol/openid-connect/certs

This preserves current behaviour while allowing staging / offline environments to substitute their own IdP.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a080a8 and f1ec92d.

📒 Files selected for processing (3)
  • lightspeed-stack (1 hunks)
  • lightspeed-stack.template.yaml (1 hunks)
  • template.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Red Hat Konflux / assisted-chat-saas-main-on-pull-request
🔇 Additional comments (2)
lightspeed-stack (1)

1-1: Submodule commit validated; confirm CI orchestration & integration coverage

✅ Verified that commit e534d930b58fadd8d9d89ebc0f6c070cc665ef82 exists on https://github.com/lightspeed-core/lightspeed-stack.git

Next steps—please ensure:

  • Every pipeline stage that builds or tests this repo invokes
    git submodule update --init --recursive
    so the new SHA is checked out.
  • Any breaking changes from lightspeed-stack PR #243 (JWK auth) are exercised by integration tests in this repo.
lightspeed-stack.template.yaml (1)

24-26: Verify claim names match Red Hat SSO tokens
You’ve overridden the defaults (subuser_id, preferred_usernameusername) in lightspeed-stack.template.yaml (lines 24–26). Unless your SSO realm emits those exact claims, every request will be unauthenticated.

Run this check with a real RH SSO access token:

TOKEN=<your_RHSso_access_token>
payload=$(echo "$TOKEN" | cut -d'.' -f2 | base64 -d 2>/dev/null)
echo "$payload" | jq '{sub, preferred_username, user_id, username}'

• If user_id/username aren’t present, remove the override or use the actual claim names.
• Confirm before merging to prevent auth failures.

Comment on lines +119 to +124
module: jwk-token
jwk_config:
url: ${SSO_BASE_URL}/protocol/openid-connect/certs
jwt_configuration:
user_id_claim: user_id
username_claim: username
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing SSO_BASE_URL parameter breaks oc process / helm template
${SSO_BASE_URL} is referenced here but no matching entry exists under the parameters: list (lines 2-66). Processing this template will fail with “unresolved parameter”.

Add the parameter with a sensible default:

- name: SSO_BASE_URL
+  description: "Base URL of the SSO realm that issues JWTs"
+  name: SSO_BASE_URL
+  value: "https://sso.redhat.com/auth/realms/redhat-external"

Place it near the other service-level parameters for consistency.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In template.yaml around lines 119 to 124, the parameter SSO_BASE_URL is used but
not defined in the parameters section (lines 2-66), causing template processing
errors. Add a new parameter entry for SSO_BASE_URL with a sensible default value
near the other service-level parameters to ensure it is resolved correctly
during oc process or helm template commands.

@omertuc
Copy link
Member Author

omertuc commented Jul 25, 2025

Draft until quay.io comes back up and lightspeed-stack pushes a dev image (quay.io/lightspeed-core/lightspeed-stack:dev-*) that contains at-least lightspeed-core/lightspeed-stack#293 (lightspeed-core/lightspeed-stack#243 is not enough because lightspeed-core/lightspeed-stack#293 contains a critical fix to lightspeed-stack in general)

Update lightspeed-stack to the latest version which includes this PR:

lightspeed-core/lightspeed-stack#243

Modify our configuration to use the new jwk-token authentication module,
with the JWK URL pointing to the Red Hat SSO server and using the user
ID / username fields that can be found in a typical JWT issued by Red
Hat SSO.
@omertuc omertuc marked this pull request as ready for review July 28, 2025 09:12
module: "noop-with-token"
module: jwk-token
jwk_config:
url: ${SSO_BASE_URL}/protocol/openid-connect/certs
Copy link
Collaborator

Choose a reason for hiding this comment

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

SSO_BASE_URL ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's fine, this is how Assisted does it as well

@eranco74
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 28, 2025
@omertuc omertuc merged commit c3c123d into rh-ecosystem-edge:main Jul 28, 2025
5 checks passed
@maorfr maorfr mentioned this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants