Skip to content

refactor: api router declaration & tenant auth scope#668

Merged
alexluong merged 34 commits into
mainfrom
refactor-auth
Feb 2, 2026
Merged

refactor: api router declaration & tenant auth scope#668
alexluong merged 34 commits into
mainfrom
refactor-auth

Conversation

@alexluong

Copy link
Copy Markdown
Collaborator

implements #643

@vercel

vercel Bot commented Jan 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Feb 2, 2026 2:16pm
outpost-website Ready Ready Preview, Comment Feb 2, 2026 2:16pm

Request Review

@alexluong alexluong changed the base branch from main to refactor-models January 30, 2026 08:48
@vercel vercel Bot temporarily deployed to Preview – outpost-website January 30, 2026 12:00 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-docs January 30, 2026 12:01 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website January 30, 2026 12:01 Inactive
Base automatically changed from refactor-models to main January 30, 2026 18:16
alexluong and others added 5 commits January 31, 2026 01:21
ErrInvalidBearerToken now returns 401 instead of 400 — a malformed
bearer token is an authentication failure, not a bad request.

Add expired JWT tests for Extract, TenantJWTAuthMiddleware, and
APIKeyOrTenantJWTAuthMiddleware.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace AuthScope/RouteMode with simpler AuthMode enum and TenantScoped
bool. Flatten 5 route slices into 2 (nonTenantRoutes + tenantRoutes)
with portal routes conditionally appended. Auto-apply
RequireTenantMiddleware via TenantScoped instead of manual Middlewares
arrays. Define narrow TenantRetriever interface to decouple middleware
from full TenantStore. Change mustTenantFromContext to panic on missing
tenant (programming bug, not user error).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… mustTenantIDFromContext

- Remove 3 dead symbols from auth_middleware.go
- Remove TestSetTenantIDMiddleware from auth_middleware_test.go
- RequireTenantMiddleware reads c.Param("tenantID") instead of c.Get
- Remove SetTenantIDMiddleware() from router global middleware
- Upsert handler uses c.Param("tenantID") directly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to Preview – outpost-docs January 30, 2026 18:22 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website January 30, 2026 18:22 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 1, 2026 11:02 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 1, 2026 11:02 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 1, 2026 11:24 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 1, 2026 11:25 Inactive
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 1, 2026 16:09 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 1, 2026 16:09 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 2, 2026 13:04 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 2, 2026 13:04 Inactive
* fix: use new endpoint structure

* fix: destination attempt queries
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 2, 2026 14:15 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 2, 2026 14:16 Inactive
@alexluong alexluong merged commit c1d2b27 into main Feb 2, 2026
4 checks passed
@alexluong alexluong deleted the refactor-auth branch February 2, 2026 14:16
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.

2 participants