pub struct OpenSecretClient { /* private fields */ }
Implementations§
Source§impl OpenSecretClient
impl OpenSecretClient
pub fn new(base_url: impl Into<String>) -> Result<Self>
pub fn new_with_api_key( base_url: impl Into<String>, api_key: String, ) -> Result<Self>
pub fn set_api_key(&self, api_key: String) -> Result<()>
pub fn clear_api_key(&self) -> Result<()>
pub async fn perform_attestation_handshake(&self) -> Result<()>
pub fn get_session_id(&self) -> Result<Option<Uuid>>
pub async fn test_connection(&self) -> Result<String>
pub async fn login( &self, email: String, password: String, client_id: Uuid, ) -> Result<LoginResponse>
pub async fn login_with_id( &self, id: Uuid, password: String, client_id: Uuid, ) -> Result<LoginResponse>
pub async fn register( &self, email: String, password: String, client_id: Uuid, name: Option<String>, ) -> Result<LoginResponse>
pub async fn register_guest( &self, password: String, client_id: Uuid, ) -> Result<LoginResponse>
pub async fn refresh_token(&self) -> Result<()>
pub async fn logout(&self) -> Result<()>
pub fn get_access_token(&self) -> Result<Option<String>>
pub fn get_refresh_token(&self) -> Result<Option<String>>
pub async fn get_user(&self) -> Result<UserResponse>
pub async fn create_api_key(&self, name: String) -> Result<ApiKeyCreateResponse>
pub async fn list_api_keys(&self) -> Result<Vec<ApiKey>>
pub async fn delete_api_key(&self, name: &str) -> Result<()>
pub async fn kv_get(&self, key: &str) -> Result<String>
pub async fn kv_put(&self, key: &str, value: String) -> Result<String>
pub async fn kv_delete(&self, key: &str) -> Result<()>
pub async fn kv_list(&self) -> Result<Vec<KVListItem>>
pub async fn get_private_key( &self, options: Option<KeyOptions>, ) -> Result<PrivateKeyResponse>
pub async fn get_private_key_bytes( &self, options: Option<KeyOptions>, ) -> Result<PrivateKeyBytesResponse>
pub async fn sign_message( &self, message_bytes: &[u8], algorithm: SigningAlgorithm, key_options: Option<KeyOptions>, ) -> Result<SignMessageResponse>
pub async fn get_public_key( &self, algorithm: SigningAlgorithm, key_options: Option<KeyOptions>, ) -> Result<PublicKeyResponse>
pub async fn generate_third_party_token( &self, audience: Option<String>, ) -> Result<ThirdPartyTokenResponse>
pub async fn encrypt_data( &self, data: String, key_options: Option<KeyOptions>, ) -> Result<EncryptDataResponse>
pub async fn decrypt_data( &self, encrypted_data: String, key_options: Option<KeyOptions>, ) -> Result<String>
Sourcepub async fn change_password(
&self,
current_password: String,
new_password: String,
) -> Result<()>
pub async fn change_password( &self, current_password: String, new_password: String, ) -> Result<()>
Changes the password for the currently authenticated user
Sourcepub async fn request_password_reset(
&self,
email: String,
hashed_secret: String,
client_id: Uuid,
) -> Result<()>
pub async fn request_password_reset( &self, email: String, hashed_secret: String, client_id: Uuid, ) -> Result<()>
Requests a password reset for the given email Note: This does not require authentication but still uses encryption
Sourcepub async fn confirm_password_reset(
&self,
email: String,
alphanumeric_code: String,
plaintext_secret: String,
new_password: String,
client_id: Uuid,
) -> Result<()>
pub async fn confirm_password_reset( &self, email: String, alphanumeric_code: String, plaintext_secret: String, new_password: String, client_id: Uuid, ) -> Result<()>
Confirms a password reset with the code from email Note: This does not require authentication but still uses encryption
Sourcepub async fn convert_guest_to_email(
&self,
email: String,
password: String,
name: Option<String>,
) -> Result<()>
pub async fn convert_guest_to_email( &self, email: String, password: String, name: Option<String>, ) -> Result<()>
Converts a guest account to an email account
Sourcepub async fn verify_email(&self, code: String) -> Result<()>
pub async fn verify_email(&self, code: String) -> Result<()>
Verifies an email address with the code from the verification email Note: This does not require authentication but still uses encryption
Sourcepub async fn request_new_verification_code(&self) -> Result<()>
pub async fn request_new_verification_code(&self) -> Result<()>
Requests a new email verification code
Sourcepub async fn request_account_deletion(
&self,
hashed_secret: String,
) -> Result<()>
pub async fn request_account_deletion( &self, hashed_secret: String, ) -> Result<()>
Initiates the account deletion process
Sourcepub async fn confirm_account_deletion(
&self,
confirmation_code: String,
plaintext_secret: String,
) -> Result<()>
pub async fn confirm_account_deletion( &self, confirmation_code: String, plaintext_secret: String, ) -> Result<()>
Confirms account deletion with the code from email
Sourcepub async fn get_models(&self) -> Result<ModelsResponse>
pub async fn get_models(&self) -> Result<ModelsResponse>
Fetches available AI models
Sourcepub async fn create_chat_completion(
&self,
request: ChatCompletionRequest,
) -> Result<ChatCompletionResponse>
pub async fn create_chat_completion( &self, request: ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
Creates a chat completion (non-streaming)
Sourcepub async fn create_chat_completion_stream(
&self,
request: ChatCompletionRequest,
) -> Result<Pin<Box<dyn Stream<Item = Result<ChatCompletionChunk>> + Send>>>
pub async fn create_chat_completion_stream( &self, request: ChatCompletionRequest, ) -> Result<Pin<Box<dyn Stream<Item = Result<ChatCompletionChunk>> + Send>>>
Creates a streaming chat completion
Auto Trait Implementations§
impl Freeze for OpenSecretClient
impl !RefUnwindSafe for OpenSecretClient
impl Send for OpenSecretClient
impl Sync for OpenSecretClient
impl Unpin for OpenSecretClient
impl !UnwindSafe for OpenSecretClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more