remove localhost bypass for API checks#4944
Merged
vladak merged 3 commits intooracle:masterfrom May 7, 2026
Merged
Conversation
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.
The time has come (AI assisted vulnerability research, zero trust, and all that) to remove the capability to allow API calls to the sensitive endpoints solely on the basis of the request coming from
localhost.This means whoever uses the Python tooling or running the indexer with the
-Uoption will have to configure and supply bearer token from now on. For the former it means using the pre-existing-Hoption to supply theAuthorizationHTTP header, for the latter using either the pre-existing--tokenoption or setting theindexerAuthenticationTokenoption in the read-only configuration. Speaking of which, the read-only configuration has to be used to configure the set of allowed tokens anyway. Combining these two the read-only configuration file contents can look like so:In the Docker image this is done automatically. There, any pre-existing bearer tokens will stop working as they will be replaced by the automatically generated ones. Due to the nature of the image I don't consider this scenario to be ever used.
While there, I did a cleanup of the
/fileendpoints handling.Will update
opengrok-syncconfiguration documentation, HTTP headers documentation with the newly addedheaders_filedirective and the Apiary blueprint once this is in.