Conversation
so people matching my intelligence quotient don't repeat my mistakes
There was a problem hiding this comment.
Pull request overview
This PR introduces API-key-based authentication (backed by an optional PostgreSQL database) for the PKG signing-key endpoint and adds corresponding CLI support, alongside a few related robustness and compatibility tweaks.
Changes:
- Add optional Postgres connection/pool wiring and API-key guard routing for
/v2/.../sign/keyin the PKG server. - Add API-key support to
pg-cli encfor retrieving signing keys without interactive auth; improve CLI JSON parsing error handling. - Update a few supporting pieces (sqlx/tokio deps, dev docker-compose + seed SQL, aes-gcm nonce API adjustments, unix-only file mode setting).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pg-pkg/src/server.rs | Adds optional DB pool setup + API-key guarded route for /sign/key. |
| pg-pkg/src/opts.rs | Adds database_url CLI/env option; updates default IRMA URL. |
| pg-pkg/src/middleware/irma.rs | Adds IrmaAuthType::Key that validates API keys via Postgres. |
| pg-pkg/src/handlers/start.rs | Removes an unused import. |
| pg-pkg/src/generate.rs | Makes unix-only permission setting conditional for portability. |
| pg-pkg/docker-compose.dev.yml | Adds a dev Postgres/Adminer compose setup for local API-key testing. |
| pg-pkg/api_keys.sql | Adds schema + seed data for api_keys table. |
| pg-pkg/Cargo.toml | Adds sqlx/tokio deps and enables clap env parsing. |
| pg-core/src/client/rust/mod.rs | Updates AES-GCM nonce usage to match API expectations. |
| pg-cli/src/opts.rs | Adds --api-key option for encryption flow. |
| pg-cli/src/encrypt.rs | Uses API-key flow for signing key retrieval; improves identity JSON parse errors. |
| pg-cli/src/client.rs | Fixes Client::new return type signature; removes unused struct. |
| Cargo.lock | Dependency lockfile updates for new crates/features. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: FayKn <61050421+FayKn@users.noreply.github.com>
w-ensink
approved these changes
Jan 29, 2026
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.
No description provided.