feat: add Bearer token auth for Anticapture API Gateway#225
Merged
Conversation
AntiCapture PR #1680 adds BLOCKFUL_API_TOKEN-based auth to the API Gateway. Wire the optional token into all three services (logic-system, dispatcher, consumers) so requests include the Authorization header when the env var is set.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LeonardoVieira1630
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BLOCKFUL_API_TOKENenv var to Logic System, Dispatcher, and Consumers so all Anticapture API requests include aAuthorization: Bearer <token>header when the token is configured.Changes
Env config schemas (3 files)
apps/logic-system/src/config/env.ts— addedBLOCKFUL_API_TOKEN: z.string().optional()apps/dispatcher/src/envConfig.ts— added to Zod schema + returned asblockfulApiTokenapps/consumers/src/config/env.ts— same patternAxios instances (3 files)
apps/logic-system/src/index.ts— spreadAuthorizationheader intoaxios.create()when token is setapps/dispatcher/src/app.ts— threadedblockfulApiTokenthrough constructor, added header to internalaxios.create()apps/consumers/src/index.ts— spreadAuthorizationheader intoaxios.create()Dispatcher wiring (2 files)
apps/dispatcher/src/index.ts— passesconfig.blockfulApiTokentoAppconstructorapps/dispatcher/src/app.ts— accepts optionalblockfulApiTokenparameterEnv examples + Docker Compose (3 files)
.env.example,apps/logic-system/.env.example,apps/consumers/example.env— addedBLOCKFUL_API_TOKEN=docker-compose.yml— addedBLOCKFUL_API_TOKEN: ${BLOCKFUL_API_TOKEN:-}to logic-system, dispatcher, and consumersTest plan
pnpm logic-system test— 44 passedpnpm dispatcher test— 80 passed (1 pre-existing failure innon-voting-handler)pnpm consumer test— 14 passedBLOCKFUL_API_TOKENin Railway env vars for all three services after anticapture PR #1680 is deployed