pub struct SolanaGatewayAuthorization {Show 14 fields
pub subject: String,
pub issuer: String,
pub key_class: KeyClass,
pub metering_key: String,
pub target_id: 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 regional Solana gateway binding.
Fields§
§subject: String§issuer: String§key_class: KeyClass§metering_key: String§target_id: String§limits: Limits§plan: Option<String>§expires_at: u64§jti: String§actor_key: Option<String>Raw signed actor identity; use SolanaGatewayAuthorization::actor_key to resolve.
account_key: Option<String>Raw signed account identity; use SolanaGatewayAuthorization::account_key to resolve.
consumer_key: Option<String>Raw signed consumer identity; use SolanaGatewayAuthorization::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 SolanaGatewayAuthorization
impl SolanaGatewayAuthorization
Sourcepub fn validate_target(
context: &AuthContext,
expected_target_id: &str,
) -> Result<(), SolanaGatewayAuthorizationError>
pub fn validate_target( context: &AuthContext, expected_target_id: &str, ) -> Result<(), SolanaGatewayAuthorizationError>
Validate only the stable audience and exact gateway target claims.
Sourcepub fn try_from_context(
context: &AuthContext,
expected_target_id: &str,
required_scope: SolanaGatewayScope,
) -> Result<SolanaGatewayAuthorization, SolanaGatewayAuthorizationError>
pub fn try_from_context( context: &AuthContext, expected_target_id: &str, required_scope: SolanaGatewayScope, ) -> Result<SolanaGatewayAuthorization, SolanaGatewayAuthorizationError>
Validate verified claims against an exact gateway binding and permission.
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 SolanaGatewayAuthorization
impl Clone for SolanaGatewayAuthorization
Source§fn clone(&self) -> SolanaGatewayAuthorization
fn clone(&self) -> SolanaGatewayAuthorization
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more