Don't autogenerate access token on homepage. #8
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.
What's Here
This PR updates the homepage (aka test console) to require a valid token for API usage, building on the UX introduced in the prior PRs:
Here's a screenshot of the token entry widget:
Tokens may be saved to local storage, in which case they'll be pre-loaded for future sessions.
The prior behavior (where API access via the homepage was provided by short-lived token passed from the server) is preserved and can be enabled via the
-public-home
flag. This mode is useful for development and may also be useful in production environments where route authentication is handled upstream from this service.Steps to Test
Building this release
Without Go on your machine
In the branch root:
make docker-build
With Go 1.22.x on your machine
In the branch root:
make
Running the Server
You'll need a signing key to start the server, and a corresponding token to access functionality from the test console.
Here's a signing key for testing:
With Go
With Docker
scrape-bookworm-slim
image you just built. If it's running, stop it.Optional Settings
8080
SCRAPE_SIGNING_KEY
Testing Functionality