pub struct ProgramReadAuthorization {
pub subject: String,
pub issuer: String,
pub key_class: KeyClass,
pub metering_key: String,
pub target_id: String,
pub program_id: String,
pub program_release_hash: String,
pub limits: Limits,
pub plan: Option<String>,
pub expires_at: u64,
pub jti: String,
}Expand description
Authorization for one exact program read, derived from verified claims.
Fields§
§subject: StringSubject used for user attribution.
issuer: StringIssuer of the verified token.
key_class: KeyClassAPI key class used for policy and attribution.
metering_key: StringOpaque API-key or anonymous metering identity.
target_id: StringAuthorized public program-read binding ID.
program_id: StringAuthorized Solana program ID.
program_release_hash: StringAuthorized immutable program release hash.
limits: LimitsResource limits carried by the token.
plan: Option<String>Plan or access tier carried by the token.
expires_at: u64Token expiration time.
jti: StringJWT ID for audit correlation.
Implementations§
Source§impl ProgramReadAuthorization
impl ProgramReadAuthorization
Sourcepub fn try_from_context(
context: &AuthContext,
expected_target_id: &str,
expected_program_id: &str,
expected_program_release_hash: &str,
) -> Result<Self, ProgramReadAuthorizationError>
pub fn try_from_context( context: &AuthContext, expected_target_id: &str, expected_program_id: &str, expected_program_release_hash: &str, ) -> Result<Self, ProgramReadAuthorizationError>
Convert a verified context into authorization for the requested resource.
Trait Implementations§
Source§impl Clone for ProgramReadAuthorization
impl Clone for ProgramReadAuthorization
Source§fn clone(&self) -> ProgramReadAuthorization
fn clone(&self) -> ProgramReadAuthorization
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgramReadAuthorization
impl Debug for ProgramReadAuthorization
Source§impl<'a> TryFrom<(&'a AuthContext, &'a str, &'a str, &'a str)> for ProgramReadAuthorization
impl<'a> TryFrom<(&'a AuthContext, &'a str, &'a str, &'a str)> for ProgramReadAuthorization
Auto Trait Implementations§
impl Freeze for ProgramReadAuthorization
impl RefUnwindSafe for ProgramReadAuthorization
impl Send for ProgramReadAuthorization
impl Sync for ProgramReadAuthorization
impl Unpin for ProgramReadAuthorization
impl UnsafeUnpin for ProgramReadAuthorization
impl UnwindSafe for ProgramReadAuthorization
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