pub struct SecureCreateNewFilePublisher { /* private fields */ }Expand description
One fixed staging file and one fixed create-new destination.
Implementations§
Source§impl SecureCreateNewFilePublisher
impl SecureCreateNewFilePublisher
pub async fn open( stage_directory: PathBuf, stage_name: String, destination: PathBuf, ) -> Result<Self, SecurePublicationError>
pub async fn stage( &self, bytes: Vec<u8>, maximum_bytes: usize, expected: Option<PublishedFileIdentity>, ) -> Result<PublishedFileIdentity, SecurePublicationError>
Sourcepub async fn stage_sensitive(
&self,
bytes: Vec<u8>,
maximum_bytes: usize,
expected: Option<PublishedFileIdentity>,
) -> Result<PublishedFileIdentity, SecurePublicationError>
pub async fn stage_sensitive( &self, bytes: Vec<u8>, maximum_bytes: usize, expected: Option<PublishedFileIdentity>, ) -> Result<PublishedFileIdentity, SecurePublicationError>
Stages secret bytes and clears the caller-owned buffer before the blocking task returns.
Sourcepub async fn read_stage(
&self,
maximum_bytes: usize,
) -> Result<Option<Vec<u8>>, SecurePublicationError>
pub async fn read_stage( &self, maximum_bytes: usize, ) -> Result<Option<Vec<u8>>, SecurePublicationError>
Reopens one fixed staged file for a typed owner that will clear secret bytes after decoding.
Sourcepub async fn read_published(
&self,
maximum_bytes: usize,
) -> Result<Option<Vec<u8>>, SecurePublicationError>
pub async fn read_published( &self, maximum_bytes: usize, ) -> Result<Option<Vec<u8>>, SecurePublicationError>
Reopens the fixed published destination for a typed owner.
Sourcepub async fn remove_unpublished_stage(
&self,
expected: Option<PublishedFileIdentity>,
) -> Result<(), SecurePublicationError>
pub async fn remove_unpublished_stage( &self, expected: Option<PublishedFileIdentity>, ) -> Result<(), SecurePublicationError>
Removes only the exact unpublished staging inode.
pub async fn publish( &self, expected: PublishedFileIdentity, ) -> Result<(), SecurePublicationError>
Sourcepub async fn publish_deterministic(
&self,
bytes: Vec<u8>,
maximum_bytes: usize,
) -> Result<PublishedFileIdentity, SecurePublicationError>
pub async fn publish_deterministic( &self, bytes: Vec<u8>, maximum_bytes: usize, ) -> Result<PublishedFileIdentity, SecurePublicationError>
Publishes fully deterministic, non-sensitive bytes and repairs the narrow crash window after the destination link exists but before the staging link is removed.
Secret or randomly generated material must instead record the identity
returned by Self::stage_sensitive in its sealed workflow journal
before calling Self::publish.
pub async fn verify_published( &self, expected: PublishedFileIdentity, ) -> Result<(), SecurePublicationError>
Sourcepub async fn validate_destination(
&self,
expected: Option<PublishedFileIdentity>,
required: bool,
) -> Result<(), SecurePublicationError>
pub async fn validate_destination( &self, expected: Option<PublishedFileIdentity>, required: bool, ) -> Result<(), SecurePublicationError>
Validates whether the fixed destination is absent or has the exact recorded identity.
Auto Trait Implementations§
impl Freeze for SecureCreateNewFilePublisher
impl RefUnwindSafe for SecureCreateNewFilePublisher
impl Send for SecureCreateNewFilePublisher
impl Sync for SecureCreateNewFilePublisher
impl Unpin for SecureCreateNewFilePublisher
impl UnsafeUnpin for SecureCreateNewFilePublisher
impl UnwindSafe for SecureCreateNewFilePublisher
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
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> 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