pub struct Authorization {
pub path: AuthPath,
pub subject: Subject,
pub token_ref: Option<TokenRef>,
pub authorization_reference: Option<String>,
}Expand description
The complete authorisation of a session.
Fields§
§path: AuthPathWhich mechanism.
subject: SubjectWho for.
token_ref: Option<TokenRef>An opaque, keyed hash of the token that was presented.
Never the RFID UID or the eMAID itself. A UID is a lifelong identifier of a physical object a person carries; storing it in every session row builds a movement profile that no part of this platform needs.
The provider’s authorisation reference, for a roaming session.
Implementations§
Source§impl Authorization
impl Authorization
Sourcepub const fn plug_and_charge(id: ContractId, emaid: Emaid) -> Self
pub const fn plug_and_charge(id: ContractId, emaid: Emaid) -> Self
A Plug & Charge authorisation, off a verified contract certificate.
§Both halves come from the certificate
emaid is the identifier [V2G2-108] puts in the leaf’s Common Name,
and emob_pnc::verify_contract is what reads it there — never a value a
caller supplied beside the chain. What the caller does supply is the
contract it maps to in this platform’s own books, which is a
commercial fact no certificate carries.
Self::token_ref is left empty on purpose. An eMAID is a lifelong
identifier of a person’s contract, and the keyed digest that may be
stored in its place needs a key this crate does not have — see
TokenRef, and empd, which holds it.
Sourcepub fn is_ad_hoc(&self) -> bool
pub fn is_ad_hoc(&self) -> bool
Whether this session may be billed against an ad-hoc tariff.
Both halves have to agree. A session on the ad-hoc path that carries a contract is a contract session that used a card reader, and billing it at the ad-hoc price would be charging a customer twice over.