Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T01:51:37.462Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

credentials_provider.rs

35 lines · 974 B · rust
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
Served at tenant.openagents/omega Member data and write actions are omitted.