pub struct TrustChain {
pub signer: HarnessSigner,
pub system_account: String,
/* private fields */
}Expand description
The fixture trust chain.
Fields§
§signer: HarnessSigner§system_account: StringThe system account’s public nkey. Its private identity key is discarded; user JWTs are signed with a separate throwaway signing key.
Implementations§
Source§impl TrustChain
impl TrustChain
pub fn generate() -> Self
Sourcepub fn signer_public(&self) -> String
pub fn signer_public(&self) -> String
The operator signer as the operator JWT lists it (O...).
Sourcepub fn box_root_public(&self) -> String
pub fn box_root_public(&self) -> String
The public nkey (A...) trusted to sign users of the box account.
The box account JWT lists this key in signing_keys.
pub fn operator_jwt(&self) -> String
pub fn system_account_jwt(&self) -> String
Sourcepub fn user_jwt(
&self,
root_id: &str,
account_public: &str,
user: &KeyPair,
iat: i64,
) -> String
pub fn user_jwt( &self, root_id: &str, account_public: &str, user: &KeyPair, iat: i64, ) -> String
A harness user in account_public, signed by the root the account lists, with no
permission restriction.
Trait Implementations§
Auto Trait Implementations§
impl Forget for TrustChain
impl Freeze for TrustChainwhere
*const ArcInner<BTreeMap<String, FixtureRoot>> is !null: Freeze,
PhantomData<ArcInner<BTreeMap<String, FixtureRoot>>>: Freeze,
*const ArcInner<Mutex<Vec<Option<Principal>>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Vec<Option<Principal>>>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for TrustChain
impl RefUnwindSafe for TrustChain
impl Send for TrustChain
impl Sync for TrustChain
impl Unpin for TrustChain
impl UnsafeUnpin for TrustChainwhere
*const ArcInner<BTreeMap<String, FixtureRoot>> is !null: UnsafeUnpin,
PhantomData<ArcInner<BTreeMap<String, FixtureRoot>>>: UnsafeUnpin,
*const ArcInner<Mutex<Vec<Option<Principal>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Vec<Option<Principal>>>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for TrustChainwhere
Arc<BTreeMap<String, FixtureRoot>>: UnwindSafe,
Arc<Mutex<Vec<Option<Principal>>>>: UnwindSafe,
RawVecInner: UnwindSafe,
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