pub struct ProgramReadAuthorization {Show 16 fields
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,
pub actor_key: Option<String>,
pub account_key: Option<String>,
pub consumer_key: Option<String>,
pub policy_version: Option<u32>,
pub account_limits: Limits,
}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.
actor_key: Option<String>Raw signed actor identity; use ProgramReadAuthorization::actor_key to resolve.
account_key: Option<String>Raw signed account identity; use ProgramReadAuthorization::account_key to resolve.
consumer_key: Option<String>Raw signed consumer identity; use ProgramReadAuthorization::consumer_key to resolve.
policy_version: Option<u32>Monotonic account policy version, absent on legacy tokens.
account_limits: LimitsAggregate account limits, defaulted when the token carries none.
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.
Sourcepub fn consumer_key(&self) -> &str
pub fn consumer_key(&self) -> &str
Resolved consumer identity: consumer_key claim, falling back to sub.
Sourcepub fn account_key(&self) -> &str
pub fn account_key(&self) -> &str
Resolved account identity: account_key claim, falling back to
metering_key.
Sourcepub fn is_legacy_policy(&self) -> bool
pub fn is_legacy_policy(&self) -> bool
True when the token predates the v2 policy contract.
Trait Implementations§
Source§impl Clone for ProgramReadAuthorization
impl Clone for ProgramReadAuthorization
Source§fn clone(&self) -> ProgramReadAuthorization
fn clone(&self) -> ProgramReadAuthorization
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more