Skip to repository content35 lines · 974 B · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T02:56:14.320Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
credentials_provider.rs
1use std::future::Future;
2use std::pin::Pin;
3
4use anyhow::Result;
5use gpui::AsyncApp;
6
7/// A provider for credentials.
8///
9/// Used to abstract over reading and writing credentials to some form of
10/// persistence (like the system keychain).
11pub trait CredentialsProvider: Send + Sync {
12 /// Reads the credentials from the provider.
13 fn read_credentials<'a>(
14 &'a self,
15 url: &'a str,
16 cx: &'a AsyncApp,
17 ) -> Pin<Box<dyn Future<Output = Result<Option<(String, Vec<u8>)>>> + 'a>>;
18
19 /// Writes the credentials to the provider.
20 fn write_credentials<'a>(
21 &'a self,
22 url: &'a str,
23 username: &'a str,
24 password: &'a [u8],
25 cx: &'a AsyncApp,
26 ) -> Pin<Box<dyn Future<Output = Result<()>> + 'a>>;
27
28 /// Deletes the credentials from the provider.
29 fn delete_credentials<'a>(
30 &'a self,
31 url: &'a str,
32 cx: &'a AsyncApp,
33 ) -> Pin<Box<dyn Future<Output = Result<()>> + 'a>>;
34}
35