Skip to content

Add key access controls#16

Merged
keenanjohnson merged 3 commits into
mainfrom
access-keys
May 14, 2026
Merged

Add key access controls#16
keenanjohnson merged 3 commits into
mainfrom
access-keys

Conversation

@keenanjohnson
Copy link
Copy Markdown
Member

To address #14

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/auth store, middleware, and tests for issuing, revoking, listing, and verifying API keys.
  • Wires /data through API key middleware and adds a keygen subcommand.
  • 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.

Comment thread internal/auth/middleware.go Outdated
Comment thread README.md Outdated
keenanjohnson and others added 2 commits May 14, 2026 01:09
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@keenanjohnson keenanjohnson merged commit b443407 into main May 14, 2026
4 checks passed
@keenanjohnson keenanjohnson deleted the access-keys branch May 14, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants