Skip to content

Ignore this created by mistake - #3537

Closed
ravindra-tripathi wants to merge 4 commits into
ClickHouse:mainfrom
ravindra-tripathi:agent/keycloak-oidc
Closed

ravindra-tripathi wants to merge 4 commits into
ClickHouse:mainfrom
ravindra-tripathi:agent/keycloak-oidc

Conversation

@ravindra-tripathi

Copy link
Copy Markdown

Summary

Screenshots or video

Before After

How to reproduce

Starting point:

On main:

On this branch:

How to test on Vercel preview

Preview routes:

Steps:

References

  • Linear Issue:
  • Related PRs:

@ravindra-tripathi
ravindra-tripathi requested a review from a team as a code owner November 4, 2026 06:01
@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef9b2f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@hyperdx/app Minor
@hyperdx/api Minor
@hyperdx/common-utils Patch
@hyperdx/otel-collector Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

@ravindra-tripathi is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hi @ravindra-tripathi, thanks for the pull request!

Before we review code from a first-time contributor, a maintainer vouches for them, and you're not on our list yet. There's nothing else to file and this PR stays open — a maintainer will look at it, usually within a day or two, and vouch for you right here if it's a genuine attempt at the problem.

To make that quick, check the PR description has:

  • The issue it addresses (ideally one labelled Accepting PR) and why the change is needed
  • Steps to reproduce the problem and verify the fix, starting from https://play.hyperdx.io or yarn app:dev:local connected to the demo server
  • Before/after screenshots if anything in the UI changed

More detail in our contributing guide.

@github-actions github-actions Bot added the needs-vouch Author needs a maintainer to vouch for them label Nov 4, 2026
},
];
].filter(
tab =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 major — Only the settings tabs are hidden; other write controls still show for non-admins and now return 403

requireTeamSettingsWriteAccess blocks POST/PUT/DELETE on /webhooks, /sources and /connections, including POST /webhooks/test. The UI only filters the TeamPage tabs. These controls are still shown to restricted members and now fail with 403: the alert form's "Add New Incoming Webhook" button and WebhookForm modal (components/Alerts.tsx:133-159), the source create/edit modal on the search page (DBSearchPage.tsx:263/284 TableSourceForm), and source creation in OnboardingModal. Fix: gate those entry points on me.canManageTeamSettings.

Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond

subject: claims.sub,
// The ID token is validated at login. An explicitly configured app
// session has its own lifetime; this does not extend any OIDC token.
expiresAt: config.SESSION_MAX_AGE_SECONDS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 major — Without SESSION_MAX_AGE_SECONDS, Keycloak sessions end at ID-token expiry (Keycloak's default is 5 minutes) and are never refreshed

With no explicit max age, expiresAt = claims.exp * 1000, and isUserAuthenticated destroys the session once that time passes. No refresh token is kept. With Keycloak's default token lifespan, an operator who sets only the four KEYCLOAK_* variables (the docs/keycloak.md Configuration block) gets users logged out every ~5 minutes. Fix: when Keycloak is enabled, default the app session to the existing cookie/idle lifetime (or require SESSION_MAX_AGE_SECONDS) instead of tying it to the ID token's exp.

Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond

@@ -140,6 +154,7 @@ router.post(
);

router.get('/logout', (req, res, next) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — GET /logout stays a cross-site logout endpoint for password sessions even though the UI now uses POST

AppNav now submits a same-origin POST to /api/logout, and nothing else in the app calls GET /logout. The GET handler still logs out non-Keycloak sessions with no origin check, so any cross-site image or link can end a user's session. Fix: return 405 for all GET /logout requests, or remove the route, so password sessions get the same POST-only protection.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Comment thread README.md

This fork adds Keycloak OIDC login to HyperDX's existing Passport and MongoDB
sessions. It also adds configurable session limits and an optional team settings
allowlist for Members, Data, and Integrations, enforced by the API and MCP as

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Upstream README gains a fork-specific section

The new "Authentication changes in this fork" section says to "build images from this branch" and that "the upstream images below do not include this fork's additions". That is wrong once this is merged into hyperdxio/hyperdx. Fix: drop the fork framing and keep a short pointer to docs/keycloak.md.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

7 finding(s): 🔴 0 critical · 🟠 3 major · 🔵 4 minor

4 posted as inline comment(s) on the changed lines. 3 listed below.

Findings outside the changed lines

  • 🟠 packages/api/src/routers/api/__tests__/team.int.test.ts:182 — hasPasswordAuth change breaks the existing GET /team/members snapshot test → hasPasswordAuth now returns Boolean(this.get('hash')) (models/user.ts:69). The test creates user1 and user2 with User.create and no password, but its inline snapshot still expects "hasPasswordAuth": true for both, so this integration test will now fail. Fix: update the snapshot to false for those two users, or register them with a password. Also, the virtual silently returns false for any query that leaves out .select('+hash'). A $exists/projection-based flag would avoid loading password hashes just to list members.
2 minor
  • 🔵 docker-compose.yml:101 — Compose forwards the Keycloak variables but not the new session-limit variables → README and docs/keycloak.md tell operators to set SESSION_MAX_AGE_SECONDS and SESSION_IDLE_TIMEOUT_SECONDS on the API. The app service only forwards KEYCLOAK_*, so these values in .env are silently ignored. Fix: add SESSION_MAX_AGE_SECONDS: ${SESSION_MAX_AGE_SECONDS:-} and SESSION_IDLE_TIMEOUT_SECONDS: ${SESSION_IDLE_TIMEOUT_SECONDS:-}. Map the empty string to undefined in config.ts, because Number('') is 0 and currently fails startup.
  • 🔵 packages/app/src/AuthPage.tsx:2722 — Password form renders while installation is loading, even in required mode → !installation?.keycloakRequired is true while useInstallation is still pending. In required mode the email/password form shows first and then disappears, and a quick submit gets the raw 403 {error:'passwordAuthNotAllowed'} JSON. The same applies to JoinTeamPage's /api/team/setup form. Fix: render the password controls only once installation has loaded (e.g. installation && !installation.keycloakRequired).

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@ravindra-tripathi
ravindra-tripathi deleted the agent/keycloak-oidc branch November 4, 2026 06:05
@ravindra-tripathi ravindra-tripathi changed the title Agent/keycloak OIDC Ignore this created by mistake Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external needs-vouch Author needs a maintainer to vouch for them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant