Skip to content

import tokenbroker#460

Merged
huang195 merged 1 commit into
rossoctl:mainfrom
davidhadas:authbridge_cmd
Jun 1, 2026
Merged

import tokenbroker#460
huang195 merged 1 commit into
rossoctl:mainfrom
davidhadas:authbridge_cmd

Conversation

@davidhadas

@davidhadas davidhadas commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

add import tokenbroker to authbridge

Related issue(s)

(Optional) Testing Instructions

Fixes # #459

Summary by CodeRabbit

  • Chores
    • Token broker functionality is now compiled into multiple authentication components, enabling consistent plugin support across the platform.

Signed-off-by: David Hadas <david.hadas@gmail.com>
@davidhadas
davidhadas requested a review from huang195 June 1, 2026 17:44
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Three authbridge binary entry points now import the tokenbroker plugin via blank imports to ensure its factory and registration code are compiled and initialized at startup. Each binary (envoy, lite, proxy) adds one blank import line.

Changes

Token Broker Plugin Registration

Layer / File(s) Summary
Register tokenbroker plugin in all binaries
authbridge/cmd/authbridge-envoy/main.go, authbridge/cmd/authbridge-lite/main.go, authbridge/cmd/authbridge-proxy/main.go
Blank imports for the tokenbroker plugin are added to three binary entry points to compile its factory/initialization code into each binary's plugin catalog.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Poem

🐰 Three imports hop along the line,
Each binary now serves token fine,
Registry warmed at startup's call,
The broker's plugged in, ready for all! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'import tokenbroker' accurately summarizes the main change: adding tokenbroker plugin imports across three binary files in the authbridge project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@authbridge/cmd/authbridge-lite/main.go`:
- Around line 41-44: The inline comment claiming "Only two plugins: drop the
parsers and token-broker." is stale because main.go imports jwtvalidation,
tokenbroker and tokenexchange; update that comment and the package header (lines
1-3) to accurately list the compiled plugins (e.g., "jwtvalidation, tokenbroker,
tokenexchange" or the intended subset) so the package doc and the comment above
the blank imports reflect the actual set; search for the blank-imports _
"github.com/kagenti/.../plugins/jwtvalidation", _
"github.com/kagenti/.../plugins/tokenbroker", and _
"github.com/kagenti/.../plugins/tokenexchange" to place the corrected wording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 50bae63f-f162-40aa-aa6c-52009b9c8f23

📥 Commits

Reviewing files that changed from the base of the PR and between 0a8dfbb and 9ad0893.

📒 Files selected for processing (3)
  • authbridge/cmd/authbridge-envoy/main.go
  • authbridge/cmd/authbridge-lite/main.go
  • authbridge/cmd/authbridge-proxy/main.go

Comment on lines 41 to 44
// Only two plugins: drop the parsers and token-broker.
_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/jwtvalidation"
_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/tokenbroker"
_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/tokenexchange"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Comment now contradicts the code: token-broker is no longer dropped.

Line 41 still says "drop the parsers and token-broker," but Line 43 compiles tokenbroker in. This is misleading for anyone auditing the lite binary's surface. Update both this comment and the package doc (Lines 1-3, "jwt-validation + token-exchange as the only plugins compiled in").

📝 Suggested fix
-	// Only two plugins: drop the parsers and token-broker.
+	// Drop the parsers; keep the auth/token plugins.
 	_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/jwtvalidation"
 	_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/tokenbroker"
 	_ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/tokenexchange"

And the package header:

-// Package main is the "lite" authbridge binary: proxy-sidecar mode
-// only (no Envoy), with jwt-validation + token-exchange as the only
-// plugins compiled in. Optimizes for binary size by dropping the
+// Package main is the "lite" authbridge binary: proxy-sidecar mode
+// only (no Envoy), with jwt-validation, token-exchange, and
+// token-broker as the only plugins compiled in. Optimizes for binary
+// size by dropping the
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@authbridge/cmd/authbridge-lite/main.go` around lines 41 - 44, The inline
comment claiming "Only two plugins: drop the parsers and token-broker." is stale
because main.go imports jwtvalidation, tokenbroker and tokenexchange; update
that comment and the package header (lines 1-3) to accurately list the compiled
plugins (e.g., "jwtvalidation, tokenbroker, tokenexchange" or the intended
subset) so the package doc and the comment above the blank imports reflect the
actual set; search for the blank-imports _
"github.com/kagenti/.../plugins/jwtvalidation", _
"github.com/kagenti/.../plugins/tokenbroker", and _
"github.com/kagenti/.../plugins/tokenexchange" to place the corrected wording.

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minimal, correct change — one blank _ import added to each of the three authbridge entrypoints using a consistent, alphabetically-ordered import path. Builds and all CI checks pass.

Areas reviewed: Go
Commits: 1 commit, signed-off ✓
CI status: All passing

PR title note: "import tokenbroker" doesn't follow the required prefix format (Feat: / Chore:) from the repo's enforced ruleset — worth fixing to avoid future enforcement issues.

@@ -40,6 +40,7 @@ import (

// Only two plugins: drop the parsers and token-broker.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment now directly contradicts the code — it says token-broker is dropped, but this PR adds it. CodeRabbit flagged the same. Suggest updating to reflect the actual plugin set, e.g.:

// Three plugins: jwtvalidation, tokenbroker, tokenexchange (parsers dropped).

@huang195
huang195 merged commit bd1bb3b into rossoctl:main Jun 1, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from New /:ToDo to Done in Kagenti Issue Prioritization Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants