pub struct OnePasswordResolver { /* private fields */ }Expand description
Resolves secrets from 1Password
Mode is auto-negotiated based on environment:
- If
OP_SERVICE_ACCOUNT_TOKENis set AND WASM SDK is installed → HTTP mode - Otherwise → CLI mode (uses
opCLI)
To enable HTTP mode, run: cuenv secrets setup onepassword
The source field in SecretSpec can be:
- A JSON-encoded
OnePasswordConfig - A simple reference string (e.g.,
op://vault/item/field)
Implementations§
Source§impl OnePasswordResolver
impl OnePasswordResolver
Sourcepub fn new() -> Result<Self, SecretError>
pub fn new() -> Result<Self, SecretError>
Create a new 1Password resolver with auto-detected mode
If 1Password service account token is available AND the WASM SDK is installed, uses HTTP mode. Otherwise, CLI mode will be used.
§Errors
Returns an error if HTTP mode is detected (WASM + token) but WASM initialization fails. This prevents silent fallback to CLI mode which masks configuration errors.
Trait Implementations§
Source§impl Debug for OnePasswordResolver
impl Debug for OnePasswordResolver
Source§impl Drop for OnePasswordResolver
impl Drop for OnePasswordResolver
Source§impl SecretResolver for OnePasswordResolver
impl SecretResolver for OnePasswordResolver
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider name for this resolver. Read more
Source§fn supports_native_batch(&self) -> bool
fn supports_native_batch(&self) -> bool
Check if this resolver supports native batch resolution. Read more
Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<String, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<String, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve a single secret by name and spec. Read more
Source§fn resolve_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecureSecret>, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecureSecret>, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve multiple secrets in batch with concurrent execution. Read more
Source§fn resolve_secure<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<SecureSecret, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn resolve_secure<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<SecureSecret, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Resolve a single secret returning a secure value. Read more
Auto Trait Implementations§
impl Freeze for OnePasswordResolver
impl RefUnwindSafe for OnePasswordResolver
impl Send for OnePasswordResolver
impl Sync for OnePasswordResolver
impl Unpin for OnePasswordResolver
impl UnwindSafe for OnePasswordResolver
Blanket Implementations§
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more