Commit c1d2b27
refactor: api router & new endpoint structure & auth logic (#668)
* fix: return 401 for malformed bearer token + add expired JWT tests
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>
* refactor: introduce AuthMode + TenantScoped, flatten route list
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>
* chore: update handlers to use mustTenantFromContext
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: remove dead code — ErrTenantIDNotFound, SetTenantIDMiddleware, 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>
* chore: gofmt
* refactor: rename AuthTenant -> AuthAuthenticated
* chore: rename AuthenticatedMiddleware
* refactor: simplify auth context between apikey & jwt
* test: remove old test files
* refactor: simplify router deps
* test: apirouter test setup
* test: tenant handlers
* test: destination handlers
* test: log handlers
* test: resource parent & authz
* fix: validate destination ownership in RetrieveAttempt
* test: comprehensive list & pagination tests
* test: list tenant not supported
* test: publish & retry api tests
* fix: consistent validation handling
* fix: clean up dead code and nil-check inconsistency in apirouter
* test: add missing apirouter test coverage for auth, tokens, portal, and destination types
* refactor: consolidate middleware into unified AuthMiddleware
* chore: rename path names to snake_case
* test: tenant metadata conversion
* test: clean up e2e tests
* test: comprehensive e2e suite
* test: topic matching
* chore: gofmt
* test: move e2e tests into apirouter
* fix: attempt response schema
* chore: upgrade Dockerfiles to Go 1.24
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: openapi.yaml
* fix: portal using new endpoints (#671)
* fix: use new endpoint structure
* fix: destination attempt queries
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 7d3b097 commit c1d2b27
File tree
50 files changed
+5693
-9390
lines changed- build
- dev
- cmd/e2e
- httpclient
- docs/apis
- internal
- apirouter
- portal/src
- common
- RetryDeliveryButton
- RetryEventButton
- scenes
- CreateDestination
- Destination/Events
- typings
- services
- util/testutil
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+5693
-9390
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
This file was deleted.
0 commit comments