Add key access controls#16
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds API key enforcement for the /data endpoint to limit public access, with SQLite-backed key storage and CLI key management.
Changes:
- Adds
internal/authstore, middleware, and tests for issuing, revoking, listing, and verifying API keys. - Wires
/datathrough API key middleware and adds akeygensubcommand. - Updates deployment/configuration docs, Fly volume/env setup, Docker/Go versions, and dependency files.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
TODO.md |
Marks Go version and API key access-control tasks as completed/partially completed. |
README.md |
Documents API key usage, key management commands, and updated prerequisites/configuration. |
main.go |
Initializes the key store and protects /data with auth middleware. |
keygen.go |
Adds CLI commands for issuing, listing, and revoking API keys. |
internal/auth/middleware.go |
Adds HTTP middleware for API key extraction and verification. |
internal/auth/auth.go |
Adds SQLite-backed API key storage and hashing logic. |
internal/auth/auth_test.go |
Adds auth store and middleware tests. |
go.mod |
Updates Go/tooling requirements and adds SQLite/test dependencies. |
go.sum |
Adds dependency checksums. |
fly.toml |
Configures persistent storage and API key DB path for Fly.io. |
Dockerfile |
Updates the Go builder image. |
.env.example |
Adds local API key database path configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
To address #14