Skip to main content

IssuerConnector

Trait IssuerConnector 

Source
pub trait IssuerConnector {
    // Required methods
    fn capabilities(&self) -> Vec<Class>;
    fn verify(&mut self, credential: &Credential) -> Result<(), IssuerError>;
    fn create(&mut self, name: &str) -> Result<Credential, IssuerError>;
    fn set_value(&mut self, name: &str, value: &str) -> Result<(), IssuerError>;
    fn roll(&mut self, current: &Credential) -> Result<Credential, IssuerError>;
    fn revoke(&mut self, credential: &Credential) -> Result<(), IssuerError>;
    fn reconcile(
        &mut self,
        step: &StepKind,
        name: &str,
    ) -> Result<Reconcile, IssuerError>;

    // Provided method
    fn set_target(&self, _current_id: &str, run_name: &str) -> String { ... }
}

Required Methods§

Source

fn capabilities(&self) -> Vec<Class>

Source

fn verify(&mut self, credential: &Credential) -> Result<(), IssuerError>

Does this credential work at the issuer right now?

Source

fn create(&mut self, name: &str) -> Result<Credential, IssuerError>

Overlapping: make a new credential called name (the name carries the entry, generation and run id, so it can be found again).

Source

fn set_value(&mut self, name: &str, value: &str) -> Result<(), IssuerError>

Client-generated: tell the issuer to use value for name. Idempotent.

Source

fn roll(&mut self, current: &Credential) -> Result<Credential, IssuerError>

Provider-generated: roll current in place. The old value stops working.

Source

fn revoke(&mut self, credential: &Credential) -> Result<(), IssuerError>

Remove a credential. Called last, and only when the revoke rule is met.

Source

fn reconcile( &mut self, step: &StepKind, name: &str, ) -> Result<Reconcile, IssuerError>

Did step take effect? Asked only after a lost response.

Provided Methods§

Source

fn set_target(&self, _current_id: &str, run_name: &str) -> String

Client-generated: what the new credential is called at the issuer. The default is the run’s name; a connector with fixed identities (two database roles taking turns) returns the one that is not current_id.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§