pub struct AuthsContextBuilder<R, K, C> { /* private fields */ }Expand description
Typestate builder for AuthsContext.
Call AuthsContext::builder() to obtain an instance. The build() method
is only available once registry, key_storage, and clock have all been
supplied.
Implementations§
Source§impl<K, C> AuthsContextBuilder<Missing, K, C>
impl<K, C> AuthsContextBuilder<Missing, K, C>
Sourcepub fn registry(
self,
registry: Arc<dyn RegistryBackend + Send + Sync>,
) -> AuthsContextBuilder<Set<Arc<dyn RegistryBackend + Send + Sync>>, K, C>
pub fn registry( self, registry: Arc<dyn RegistryBackend + Send + Sync>, ) -> AuthsContextBuilder<Set<Arc<dyn RegistryBackend + Send + Sync>>, K, C>
Set the registry storage backend.
Args:
registry: Pre-initialized registry backend.
Usage:
builder.registry(Arc::new(my_git_backend))Source§impl<R, C> AuthsContextBuilder<R, Missing, C>
impl<R, C> AuthsContextBuilder<R, Missing, C>
Sourcepub fn key_storage(
self,
key_storage: Arc<dyn KeyStorage + Send + Sync>,
) -> AuthsContextBuilder<R, Set<Arc<dyn KeyStorage + Send + Sync>>, C>
pub fn key_storage( self, key_storage: Arc<dyn KeyStorage + Send + Sync>, ) -> AuthsContextBuilder<R, Set<Arc<dyn KeyStorage + Send + Sync>>, C>
Set the key storage backend.
Args:
key_storage: Platform keychain or in-memory test fake.
Usage:
builder.key_storage(Arc::new(my_keychain))Source§impl<R, K> AuthsContextBuilder<R, K, Missing>
impl<R, K> AuthsContextBuilder<R, K, Missing>
Sourcepub fn clock(
self,
clock: Arc<dyn ClockProvider + Send + Sync>,
) -> AuthsContextBuilder<R, K, Set<Arc<dyn ClockProvider + Send + Sync>>>
pub fn clock( self, clock: Arc<dyn ClockProvider + Send + Sync>, ) -> AuthsContextBuilder<R, K, Set<Arc<dyn ClockProvider + Send + Sync>>>
Set the clock provider.
Args:
clock: Wall-clock implementation (SystemClockin production,MockClockin tests).
Usage:
builder.clock(Arc::new(SystemClock))Source§impl<R, K, C> AuthsContextBuilder<R, K, C>
impl<R, K, C> AuthsContextBuilder<R, K, C>
Sourcepub fn event_sink(
self,
sink: Arc<dyn EventSink>,
) -> AuthsContextBuilder<R, K, C>
pub fn event_sink( self, sink: Arc<dyn EventSink>, ) -> AuthsContextBuilder<R, K, C>
Sourcepub fn identity_storage(
self,
storage: Arc<dyn IdentityStorage + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn identity_storage( self, storage: Arc<dyn IdentityStorage + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the identity storage adapter.
Args:
storage: Pre-initialized identity storage implementation.
Usage:
builder.identity_storage(Arc::new(my_identity_storage))Sourcepub fn attestation_sink(
self,
sink: Arc<dyn AttestationSink + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn attestation_sink( self, sink: Arc<dyn AttestationSink + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the attestation sink adapter.
Args:
sink: Pre-initialized attestation sink implementation.
Usage:
builder.attestation_sink(Arc::new(my_attestation_store))Sourcepub fn attestation_source(
self,
source: Arc<dyn AttestationSource + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn attestation_source( self, source: Arc<dyn AttestationSource + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the attestation source adapter.
Args:
source: Pre-initialized attestation source implementation.
Usage:
builder.attestation_source(Arc::new(my_attestation_store))Sourcepub fn passphrase_provider(
self,
provider: Arc<dyn PassphraseProvider + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn passphrase_provider( self, provider: Arc<dyn PassphraseProvider + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the passphrase provider for key decryption during signing operations.
Defaults to a noop provider that returns an error. Set this when SDK workflow functions will perform signing with encrypted key material.
Args:
provider: Any type implementingPassphraseProvider.
Usage:
builder.passphrase_provider(Arc::new(PrefilledPassphraseProvider::new(passphrase)))Sourcepub fn uuid_provider(
self,
provider: Arc<dyn UuidProvider + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn uuid_provider( self, provider: Arc<dyn UuidProvider + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the UUID provider.
Defaults to SystemUuidProvider (random v4 UUIDs) when not called.
Override with a deterministic stub in tests.
Args:
provider: Any type implementingUuidProvider.
Usage:
builder.uuid_provider(Arc::new(my_uuid_stub))Sourcepub fn agent_signing(
self,
provider: Arc<dyn AgentSigningPort + Send + Sync>,
) -> AuthsContextBuilder<R, K, C>
pub fn agent_signing( self, provider: Arc<dyn AgentSigningPort + Send + Sync>, ) -> AuthsContextBuilder<R, K, C>
Set the agent signing port for delegating signing to a running agent process.
Defaults to NoopAgentProvider (all operations return Unavailable)
when not called. Set this on Unix platforms where the auths-agent daemon
is available.
Args:
provider: Any type implementingAgentSigningPort.
Usage:
builder.agent_signing(Arc::new(CliAgentAdapter::new(socket_path)))Source§impl AuthsContextBuilder<Set<Arc<dyn RegistryBackend + Send + Sync>>, Set<Arc<dyn KeyStorage + Send + Sync>>, Set<Arc<dyn ClockProvider + Send + Sync>>>
impl AuthsContextBuilder<Set<Arc<dyn RegistryBackend + Send + Sync>>, Set<Arc<dyn KeyStorage + Send + Sync>>, Set<Arc<dyn ClockProvider + Send + Sync>>>
Sourcepub fn build(self) -> Result<AuthsContext, BuilderError>
pub fn build(self) -> Result<AuthsContext, BuilderError>
Build the AuthsContext.
Only callable once registry, key_storage, and clock have been set.
Omitting any of these fields produces a compile-time error.
Usage:
let ctx = AuthsContext::builder()
.registry(Arc::new(my_registry))
.key_storage(Arc::new(my_keychain))
.clock(Arc::new(SystemClock))
.build();