Skip to content

Move lad_v2 Beacon auth to a single API Gateway authorizer - #410

Merged
OSPFNeighbour merged 1 commit into
master-devfrom
lad-v2-gateway-authorizer
Aug 14, 2026
Merged

Move lad_v2 Beacon auth to a single API Gateway authorizer#410
OSPFNeighbour merged 1 commit into
master-devfrom
lad-v2-gateway-authorizer

Conversation

@OSPFNeighbour

Copy link
Copy Markdown
Collaborator

Summary

  • Adds LH-BeaconAuthorizerV2, wrapping the existing verifyBeaconToken logic (same trusted-issuer allow-list, same beaconApi scope check) as an API Gateway Lambda authorizer
  • Attaches it to all 15 /lad_v2/... routes — invalid/missing tokens are now rejected at the gateway before any backend Lambda runs
  • The 5 backend Lambdas (route-v2, share-v2, geocode-v2, default-assets-v2, map-layers-v2) no longer verify the token themselves; they read the verified member id from the authorizer's context instead

Note

This PR is code-only. The AWS infra (authorizer Lambda, route auth type, unused env var cleanup, CloudWatch dashboard) is already deployed and live-verified against production — this PR catches the repo up to what's running.

Test plan

  • Verified in AWS: requests without/with invalid Authorization return 401/403 at the gateway without invoking the backend Lambdas
  • Verified end-to-end in the extension with a real Beacon login: map layers, routing, share, geocode, default-assets all working
  • Reviewer sanity-check of the diff

🤖 Generated with Claude Code

Adds LH-BeaconAuthorizerV2, a Lambda REQUEST authorizer wrapping the
existing verifyBeaconToken logic (same trusted-issuer allow-list, same
beaconApi scope check), and attaches it to all /lad_v2/... routes so
invalid/missing tokens are rejected at the gateway before any backend
Lambda runs. The five backend Lambdas now read the verified member id
from the authorizer's context instead of re-verifying the token
themselves, removing duplicated JWKS/JWT logic from each one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@OSPFNeighbour
OSPFNeighbour merged commit 04a6d17 into master-dev Aug 14, 2026
@OSPFNeighbour
OSPFNeighbour deleted the lad-v2-gateway-authorizer branch August 14, 2026 03:46
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.

1 participant