pub struct TicketClaims {
pub authority_generation: Option<u64>,
pub ticket_id: Hash,
pub audience: String,
pub repository: String,
pub signer: Hash,
pub pack_id: Hash,
pub bytes: u64,
pub part_size: u64,
pub expires_at_ms: u64,
pub upload_session: Vec<u8>,
}Expand description
Authenticated, deployment-bound upload claims. Clients treat their encoding as opaque; no metadata read is needed to verify them.
Fields§
Authority generation authorized when this ticket was created.
ticket_id: HashReservation-derived ticket id.
audience: StringCanonical deployment audience.
repository: StringFull repository identity, including namespace.
signer: HashSigner permitted to upload and consume this ticket.
pack_id: HashExpected pack commitment.
bytes: u64Declared pack byte count.
part_size: u64Server-selected part geometry.
expires_at_ms: u64Expiry on the business clock, Unix milliseconds.
upload_session: Vec<u8>Backend multipart identifier; empty before WP-1.11.
Implementations§
Source§impl TicketClaims
impl TicketClaims
Sourcepub fn check_principal(
&self,
audience: &str,
repository: &str,
signer: &Hash,
) -> Result<(), ServerError>
pub fn check_principal( &self, audience: &str, repository: &str, signer: &Hash, ) -> Result<(), ServerError>
Bind the ticket to the caller before an RPC checks its own payload fields.
Sourcepub fn check_binding(
&self,
audience: &str,
repository: &str,
signer: &Hash,
pack_id: &Hash,
bytes: u64,
) -> Result<(), ServerError>
pub fn check_binding( &self, audience: &str, repository: &str, signer: &Hash, pack_id: &Hash, bytes: u64, ) -> Result<(), ServerError>
Check the request binding after token verification. Ticket, part and receipt-specific commitments are checked by their respective RPCs.
Trait Implementations§
Source§impl Clone for TicketClaims
impl Clone for TicketClaims
Source§impl Debug for TicketClaims
impl Debug for TicketClaims
impl Eq for TicketClaims
Source§impl PartialEq for TicketClaims
impl PartialEq for TicketClaims
impl StructuralPartialEq for TicketClaims
Auto Trait Implementations§
impl Freeze for TicketClaims
impl RefUnwindSafe for TicketClaims
impl Send for TicketClaims
impl Sync for TicketClaims
impl Unpin for TicketClaims
impl UnsafeUnpin for TicketClaims
impl UnwindSafe for TicketClaims
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