Skip to content

docs: Make doc and code consistent - #72

Merged
mrsabath merged 2 commits into
rossoctl:mainfrom
huang195:fix_authproxy_doc
Jan 22, 2026
Merged

mrsabath merged 2 commits into
rossoctl:mainfrom
huang195:fix_authproxy_doc

Conversation

@huang195

Copy link
Copy Markdown
Member

This PR is to bring the doc and code consistent again.

@huang195
huang195 requested a review from mrsabath January 21, 2026 15:08
@huang195 huang195 changed the title make doc and code consistent docs: make doc and code consistent Jan 21, 2026
@huang195 huang195 changed the title docs: make doc and code consistent docs: Make doc and code consistent Jan 21, 2026
@mrsabath
mrsabath requested a review from Copilot January 22, 2026 00:19

Copilot AI left a comment

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.

Pull request overview

This PR updates the AuthProxy README to reposition the documentation focus from JWT validation to token exchange functionality. The changes attempt to simplify the architecture description by presenting AuthProxy as a "token exchange sidecar" and repositioning main.go as an "example application."

Changes:

  • Removed JWT validation terminology from the main description and flow diagrams
  • Restructured the Components section to emphasize Envoy + Ext Proc as the core sidecar
  • Repositioned main.go as an example application rather than a core component
  • Simplified configuration documentation to focus on token exchange parameters
  • Updated terminology throughout (e.g., "Standalone Quickstart" to "Quickstart")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# AuthProxy

AuthProxy is a **JWT validation and token exchange proxy** for Kubernetes workloads. It enables secure service-to-service communication by intercepting outgoing requests, validating tokens, and transparently exchanging them for tokens with the correct audience for downstream services.
AuthProxy is a **token exchange sidecar** for Kubernetes workloads. It enables secure service-to-service communication by intercepting outgoing requests and transparently exchanging tokens for ones with the correct audience for downstream services.

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

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

The updated description removes mention of "JWT validation" functionality, but the codebase still includes JWT validation logic in main.go (lines 71-122). The main.go file validates JWT tokens using JWKS, checks issuer, audience, and scope claims. Removing this from the description makes the documentation inconsistent with the actual implementation.

Copilot uses AI. Check for mistakes.
### The Solution

AuthProxy intercepts outgoing requests, validates the caller's token, and exchanges it for a new token with the correct audience:
AuthProxy intercepts outgoing requests and exchanges the token for a new one with the correct audience:

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

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

The updated solution description removes "validates the caller's token" but the actual implementation in main.go includes comprehensive JWT validation (signature, issuer, audience, scope). This creates a mismatch between the documentation and the actual behavior of the system.

Copilot uses AI. Check for mistakes.
┌─────────────┐ ┌──────────────────────────┐ ┌─────────────┐
│ Caller │ ── Token A ──►│ AuthProxy │─ Token B ──► │ Target │ ✅ AUTHORIZED
│ │ │ 1. Validate token │ │ │
│ │ │ 1. Intercept request │ │ │

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

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

The diagram step "1. Intercept request" replaces "1. Validate token" but this is misleading. Based on the main.go implementation, the system does validate tokens (JWT signature, issuer, and optionally audience) before performing token exchange. The updated text undersells the security features actually implemented in the code.

Suggested change
│ │ │ 1. Intercept request │ │ │
│ │ │ 1. Validate & intercept │ │ │

Copilot uses AI. Check for mistakes.
Comment on lines 58 to +59

```
┌─────────────────────────────────────────────────────────────────┐
│ POD │
│ ┌──────────────┐ ┌─────────────────────────────────────┐ │
│ │ │ │ AuthProxy Sidecar │ │
│ │ Application │ │ ┌───────────┐ ┌──────────────┐ │ │
│ │ │───►│ │ Envoy │───►│ Ext Proc │ │ │
│ │ │ │ │ :15123 │ │ :9090 │ │ │
│ └──────────────┘ │ └───────────┘ └──────────────┘ │ │
│ │ │ │ │ │ │
│ │ │ ▼ ▼ │ │
│ ┌──────┴───────┐ │ ┌───────────┐ ┌──────────────┐ │ │
│ │ proxy-init │ │ │AuthProxy │ │ Keycloak │ │ │
│ │ (iptables) │ │ │ :8080 │ │ (exchange) │ │ │
│ └──────────────┘ │ └───────────┘ └──────────────┘ │ │
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
```
The `main.go` file in this directory is **not** a core component of AuthProxy. It is an **example application** that demonstrates how to use the AuthProxy sidecar. Any application can benefit from AuthProxy simply by being deployed alongside the sidecar—no code changes required.

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

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

The documentation now describes main.go as "not a core component" and just an "example application," but main.go contains the JWT validation proxy logic that runs on port 8080. This is a functional component, not just an example. The file includes production-grade JWT validation using JWKS, token caching, and proper error handling. Characterizing it as merely an example is misleading about the system's architecture.

Copilot uses AI. Check for mistakes.
Comment thread AuthBridge/AuthProxy/README.md Resolved
Signed-off-by: Mariusz Sabath <[email protected]>

Co-authored-by: Copilot <[email protected]>
@huang195

Copy link
Copy Markdown
Member Author

@mrsabath all of these comments by co-pilot is due to not understanding that main.go is actually an example app, which is not supposed to be a part of the authproxy sidecar.

@mrsabath mrsabath 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.

LGTM

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.

3 participants