OpenSecretClient

Struct OpenSecretClient 

Source
pub struct OpenSecretClient { /* private fields */ }

Implementations§

Source§

impl OpenSecretClient

Source

pub fn new(base_url: impl Into<String>) -> Result<Self>

Source

pub fn new_with_api_key( base_url: impl Into<String>, api_key: String, ) -> Result<Self>

Source

pub fn set_api_key(&self, api_key: String) -> Result<()>

Source

pub fn clear_api_key(&self) -> Result<()>

Source

pub async fn perform_attestation_handshake(&self) -> Result<()>

Source

pub fn get_session_id(&self) -> Result<Option<Uuid>>

Source

pub async fn test_connection(&self) -> Result<String>

Source

pub async fn login( &self, email: String, password: String, client_id: Uuid, ) -> Result<LoginResponse>

Source

pub async fn login_with_id( &self, id: Uuid, password: String, client_id: Uuid, ) -> Result<LoginResponse>

Source

pub async fn register( &self, email: String, password: String, client_id: Uuid, name: Option<String>, ) -> Result<LoginResponse>

Source

pub async fn register_guest( &self, password: String, client_id: Uuid, ) -> Result<LoginResponse>

Source

pub async fn refresh_token(&self) -> Result<()>

Source

pub async fn logout(&self) -> Result<()>

Source

pub fn get_access_token(&self) -> Result<Option<String>>

Source

pub fn get_refresh_token(&self) -> Result<Option<String>>

Source

pub async fn get_user(&self) -> Result<UserResponse>

Source

pub async fn create_api_key(&self, name: String) -> Result<ApiKeyCreateResponse>

Source

pub async fn list_api_keys(&self) -> Result<Vec<ApiKey>>

Source

pub async fn delete_api_key(&self, name: &str) -> Result<()>

Source

pub async fn kv_get(&self, key: &str) -> Result<String>

Source

pub async fn kv_put(&self, key: &str, value: String) -> Result<String>

Source

pub async fn kv_delete(&self, key: &str) -> Result<()>

Source

pub async fn kv_list(&self) -> Result<Vec<KVListItem>>

Source

pub async fn get_private_key( &self, options: Option<KeyOptions>, ) -> Result<PrivateKeyResponse>

Source

pub async fn get_private_key_bytes( &self, options: Option<KeyOptions>, ) -> Result<PrivateKeyBytesResponse>

Source

pub async fn sign_message( &self, message_bytes: &[u8], algorithm: SigningAlgorithm, key_options: Option<KeyOptions>, ) -> Result<SignMessageResponse>

Source

pub async fn get_public_key( &self, algorithm: SigningAlgorithm, key_options: Option<KeyOptions>, ) -> Result<PublicKeyResponse>

Source

pub async fn generate_third_party_token( &self, audience: Option<String>, ) -> Result<ThirdPartyTokenResponse>

Source

pub async fn encrypt_data( &self, data: String, key_options: Option<KeyOptions>, ) -> Result<EncryptDataResponse>

Source

pub async fn decrypt_data( &self, encrypted_data: String, key_options: Option<KeyOptions>, ) -> Result<String>

Source

pub async fn change_password( &self, current_password: String, new_password: String, ) -> Result<()>

Changes the password for the currently authenticated user

Source

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

Source

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

Source

pub async fn convert_guest_to_email( &self, email: String, password: String, name: Option<String>, ) -> Result<()>

Converts a guest account to an email account

Source

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

Source

pub async fn request_new_verification_code(&self) -> Result<()>

Requests a new email verification code

Source

pub async fn request_account_deletion( &self, hashed_secret: String, ) -> Result<()>

Initiates the account deletion process

Source

pub async fn confirm_account_deletion( &self, confirmation_code: String, plaintext_secret: String, ) -> Result<()>

Confirms account deletion with the code from email

Source

pub async fn get_models(&self) -> Result<ModelsResponse>

Fetches available AI models

Source

pub async fn create_chat_completion( &self, request: ChatCompletionRequest, ) -> Result<ChatCompletionResponse>

Creates a chat completion (non-streaming)

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,