feat(kon): add cloud-providers crate — BYOK stubs, keystore
- Keystore stub using environment variables (keyring integration deferred) - Minimal crate ready for cloud STT provider implementations post-Stage 1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
crates/cloud-providers/src/keystore.rs
Normal file
14
crates/cloud-providers/src/keystore.rs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/// Store an API key in the OS keychain.
|
||||||
|
/// Stub implementation using environment variables until keyring crate is added.
|
||||||
|
pub fn store_api_key(provider: &str, key: &str) {
|
||||||
|
std::env::set_var(
|
||||||
|
format!("KON_API_KEY_{}", provider.to_uppercase()),
|
||||||
|
key,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Retrieve an API key from the OS keychain.
|
||||||
|
/// Stub implementation using environment variables until keyring crate is added.
|
||||||
|
pub fn retrieve_api_key(provider: &str) -> Option<String> {
|
||||||
|
std::env::var(format!("KON_API_KEY_{}", provider.to_uppercase())).ok()
|
||||||
|
}
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
// kon-cloud-providers: BYOK cloud STT provider implementations
|
pub mod keystore;
|
||||||
// and OS keychain API key storage.
|
|
||||||
|
pub use keystore::{retrieve_api_key, store_api_key};
|
||||||
|
|||||||
Reference in New Issue
Block a user