pub struct PublicRepoWriter { /* private fields */ }Expand description
Public repository writer with an explicit native authorization gate.
Implementations§
Source§impl PublicRepoWriter
impl PublicRepoWriter
pub fn did(&self) -> &str
Sourcepub fn new(
store: Arc<PublicRepoStore>,
did: impl Into<String>,
signing_key: SigningKey,
authorizer: Arc<dyn PublicPublicationAuthorizer>,
) -> Result<Self>
pub fn new( store: Arc<PublicRepoStore>, did: impl Into<String>, signing_key: SigningKey, authorizer: Arc<dyn PublicPublicationAuthorizer>, ) -> Result<Self>
Bind a trusted account key to this store. All writer handles for the same DID share one active authority; a different key requires promotion.
Sourcepub fn new_external(
store: Arc<PublicRepoStore>,
did: impl Into<String>,
verifying_key: VerifyingKey,
authorizer: Arc<dyn PublicPublicationAuthorizer>,
) -> Result<Self>
pub fn new_external( store: Arc<PublicRepoStore>, did: impl Into<String>, verifying_key: VerifyingKey, authorizer: Arc<dyn PublicPublicationAuthorizer>, ) -> Result<Self>
Bind a hosted account’s public authority without importing its private signing key into this repository boundary.
Sourcepub fn active_verifying_key(&self) -> Result<VerifyingKey>
pub fn active_verifying_key(&self) -> Result<VerifyingKey>
Resolve this account’s active public key from shared transaction state. DID-document publication must use this authority after promotion returns.
pub fn prepare_external_record_with_expected_prev_text( &self, request: PublicCreateRequest, expected_prev: Option<&str>, ) -> Result<PublicCreatePreparation, PublicRepoWriteError>
pub fn finish_external_record( &self, preparation: PublicPendingCreate, signature: Vec<u8>, ) -> Result<PublicCommitResult, PublicRepoWriteError>
Sourcepub fn promote_signing_key(
&self,
principal: &str,
expected_active: &VerifyingKey,
candidate: SigningKey,
) -> Result<Option<Cid>>
pub fn promote_signing_key( &self, principal: &str, expected_active: &VerifyingKey, candidate: SigningKey, ) -> Result<Option<Cid>>
Explicit account-owner promotion boundary. The trusted caller must validate/secure the candidate and publish it in the account DID document only after this succeeds. This is not the node-global OAuth key store.
Serializes with all writers for this store/account. Re-signs an idle head over identical canonical unsigned bytes, persists the new head and immutable block synchronously, then exposes the candidate to surviving writers and public-key readers. Errors leave the active key unchanged. Old blocks and publication intents remain immutable for original retries. This in-process boundary does not subscribe to external key rotations; account lifecycle wiring must route promotion through it.
pub fn create_record( &self, request: PublicCreateRequest, ) -> Result<PublicCommitResult, PublicRepoWriteError>
Sourcepub fn create_record_with_expected_prev_text(
&self,
request: PublicCreateRequest,
expected_prev: Option<&str>,
) -> Result<PublicCommitResult, PublicRepoWriteError>
pub fn create_record_with_expected_prev_text( &self, request: PublicCreateRequest, expected_prev: Option<&str>, ) -> Result<PublicCommitResult, PublicRepoWriteError>
XRPC creation with an optional base32 CID head condition. Unlike the
native typed API, omission permits a new write on any current head.
Authorization, retry lookup, head comparison and the write all use the
shared transaction path; no repository state is read by this adapter.
This argument supersedes request.expected_prev.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PublicRepoWriter
impl !RefUnwindSafe for PublicRepoWriter
impl Send for PublicRepoWriter
impl Sync for PublicRepoWriter
impl Unpin for PublicRepoWriter
impl UnsafeUnpin for PublicRepoWriter
impl !UnwindSafe for PublicRepoWriter
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request