Skip to content

feat: store API Keys in the store#225

Open
TomasArrachea wants to merge 2 commits intonextfrom
tomasarrachea-store-api-keys
Open

feat: store API Keys in the store#225
TomasArrachea wants to merge 2 commits intonextfrom
tomasarrachea-store-api-keys

Conversation

@TomasArrachea
Copy link
Collaborator

@TomasArrachea TomasArrachea commented Feb 12, 2026

Closes #120

This PR:

  • Updates the create-api-key command so that it persists the created API key in the store
  • Adds list-api-keys and remove-api-key commands

The keys are stored in the settings table as a single setting value. Each time the list gets updated, the whole list of keys is loaded and updated in the store.

@TomasArrachea TomasArrachea force-pushed the tomasarrachea-store-api-keys branch from 608a390 to c97864a Compare February 12, 2026 22:00
@TomasArrachea TomasArrachea marked this pull request as ready for review February 12, 2026 22:00
Copy link
Collaborator

@SantiagoPittella SantiagoPittella left a comment

Choose a reason for hiding this comment

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

LGTM, added some nits

CHANGELOG.md Outdated

## 0.14.0 (TBD)

- Removed `--api-key` param from the `start` command, API keys are now persisted in the store and automatically loaded on startup. ([#225](https://github.com/0xMiden/miden-faucet/pull/225)).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mark this as breaking

Comment on lines +131 to +138
#[arg(long = "store", value_name = "FILE", default_value = "faucet_client_store.sqlite3", env = ENV_STORE)]
store_path: PathBuf,
},

/// Remove an API key from the store.
RemoveApiKey {
/// Path to the `SQLite` store.
#[arg(long = "store", value_name = "FILE", default_value = "faucet_client_store.sqlite3", env = ENV_STORE)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably move "faucet_client_store.sqlite3" to a constant

Comment on lines +370 to +372
for key in keys {
println!("{}", key.encode());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the vector is empty lets print something like "No API keys found"

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.

Save MIDEN_FAUCET_API_KEYS into the settings table; add a command to remove keys

2 participants