pub struct ApprovalSigner { /* private fields */ }Expand description
Ed25519 signer that mints provenance signatures for approval_response
payloads. Wraps Signer in an Arc so the gRPC service and the
connect path share one instance.
Implementations§
Source§impl ApprovalSigner
impl ApprovalSigner
Sourcepub fn from_key_bytes(bytes: &[u8]) -> Result<Self, SignerError>
pub fn from_key_bytes(bytes: &[u8]) -> Result<Self, SignerError>
Build a signer from raw ed25519 private-key bytes loaded from a
secret store (#784) — the ONLY production-safe way to construct an
ApprovalSigner. bytes must be exactly 32 bytes, the raw encoded
ed25519 private key.
§Errors
Returns crate::SignerError if bytes is not a validly-encoded
ed25519 private key.
Sourcepub fn public_key_bytes(&self) -> Vec<u8> ⓘ
pub fn public_key_bytes(&self) -> Vec<u8> ⓘ
Encoded public key bytes; clients verify approval signatures against these.
Sourcepub fn sign(&self, canonical_bytes: &[u8]) -> Vec<u8> ⓘ
pub fn sign(&self, canonical_bytes: &[u8]) -> Vec<u8> ⓘ
Sign the canonical bytes of a response payload. The canonical bytes
are the JSON encoding with the signature_hex and signed_by fields
cleared — same shape as crate::toolcall (signature commits to
everything except itself).
Sourcepub fn as_signer(&self) -> &Signer
pub fn as_signer(&self) -> &Signer
Borrow the underlying platform Signer, for the grant-family builders
that take one directly (e.g. crate::grant::suspension_payload, the
platform’s ed25519 kill switch for a live grant, #623). The suspension is
signed by the SAME platform key every approval-side signature uses, so a
suspension and a grant_replay in the audit trail share one signer.
Trait Implementations§
Source§impl Clone for ApprovalSigner
impl Clone for ApprovalSigner
Source§fn clone(&self) -> ApprovalSigner
fn clone(&self) -> ApprovalSigner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ApprovalSigner
impl RefUnwindSafe for ApprovalSigner
impl Send for ApprovalSigner
impl Sync for ApprovalSigner
impl Unpin for ApprovalSigner
impl UnsafeUnpin for ApprovalSigner
impl UnwindSafe for ApprovalSigner
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
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>
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