Repository navigation
Conversation
Adds an optional --api-key (default: FREETOKEN_API_KEY env) that gates every non-health route behind Authorization: Bearer <key>. Unset keeps today's no-auth behavior; /health stays open either way so supervisors can poll readiness. The gate runs before request accounting, so rejected probes never reach the request ring. Implements FlashML-org#557.
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
… authentication Conflict in server/args.py: main's --allowed-local-media-path check and the PR's FREETOKEN_API_KEY fallback sit in the same spot; kept both. Pulled forward from the queue as the more complete of the two API-key PRs (FlashML-org#558 lacks tests, CORS preflight and the shell client's key). Assisted-by: Claude Opus 5.5
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
Logs FlashML-org#565 (reimplemented), FlashML-org#564, FlashML-org#562, FlashML-org#559 (with fixups), FlashML-org#558 (superseded by FlashML-org#305) and FlashML-org#305 (pulled forward, adopted). Assisted-by: Claude Opus 5.5
This branch has not been deployed
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
--api-keyflag (default:FREETOKEN_API_KEYenv, flag wins) that requiresAuthorization: Bearer <key>on every non-health route.GET /healthstays open so supervisors/orchestrators can poll readiness without the token.invalid_request_error/invalid_api_key).Implements #557.
Testing
py_compileclean on both touched files; diff is contained toserver/args.py(flag + field) andserver/api_server.py(module key + middleware + wiring)./healthalways open.