pub struct Credentials {
pub token: OcpiString<64>,
pub url: Url,
pub hub_party_id: Option<CiString<5>>,
pub roles: Vec<CredentialsRole>,
pub extensions: Extensions,
}v2_3_0 only.Expand description
The credentials one platform gives another.
Spec: 2.3.0 §credentials_credentials_object
Fields§
§token: OcpiString<64>The credentials token for the other party to authenticate in your system.
It should only contain printable non-whitespace ASCII characters, that is, characters with Unicode code points from the range of U+0021 up to and including U+007E.
This is the token in cleartext — the value that goes, Base64-encoded, into the peer’s
Authorization header. CredentialsToken is the
type to hold it in once it leaves this object: it redacts itself in Debug, compares in
constant time and is zeroised on drop.
url: UrlThe URL to your API versions endpoint.
hub_party_id: Option<CiString<5>>The Hub party of this platform, as a five-character <country><party> string.
A Platform that supports Hub functionality with the Message routing headers SHALL give the country code and party ID of the Hub in the
hub_party_idfield.
New in OCPI 2.3.0. Use PartyRef::from_hub_party_id to split it.
roles: Vec<CredentialsRole>The roles this platform provides. Cardinality +.
NOTE: In OCPI 2.3.0, unlike in OCPI 2.2 or 2.2.1, Roaming Hubs’ platforms are expected to include the parties that are reachable through the Roaming Hub in the list in
roles.
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn builder() -> CredentialsBuilder
pub fn builder() -> CredentialsBuilder
Create an instance of Credentials using the builder syntax
Source§impl Credentials
impl Credentials
Sourcepub fn parties(&self) -> impl Iterator<Item = PartyRef> + '_
pub fn parties(&self) -> impl Iterator<Item = PartyRef> + '_
Every party this platform speaks for.
Sourcepub fn hub_party(&self) -> Option<PartyRef>
pub fn hub_party(&self) -> Option<PartyRef>
The hub this platform routes through, if it declared one.
Sourcepub fn is_routing_platform(&self) -> bool
pub fn is_routing_platform(&self) -> bool
Whether this platform advertises itself as a routing platform.
A hub is recognised by the presence of hub_party_id, not by a role: OCPI 2.3.0 removed
2.2.1’s HUB role value.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl<'de> Deserialize<'de> for Credentials
impl<'de> Deserialize<'de> for Credentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Downgrade<Credentials> for Credentials
Available on crate feature convert only.
impl Downgrade<Credentials> for Credentials
convert only.Source§fn downgrade(self) -> Converted<Credentials>
fn downgrade(self) -> Converted<Credentials>
A 2.3.0 hub_party_id becomes a 2.2.1 HUB role.
The 2.2.1 role needs business_details, which 2.3.0 does not carry for the hub party
itself; the first role’s details are reused and the substitution is reported.
Source§impl JsonSchema for Credentials
impl JsonSchema for Credentials
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for Credentials
impl PartialEq for Credentials
Source§impl Serialize for Credentials
impl Serialize for Credentials
impl StructuralPartialEq for Credentials
Source§impl Upgrade<Credentials> for Credentials
Available on crate feature convert only.
impl Upgrade<Credentials> for Credentials
convert only.Source§fn upgrade(self) -> Converted<Credentials>
fn upgrade(self) -> Converted<Credentials>
A 2.2.1 HUB role becomes 2.3.0’s hub_party_id, and the role entry is dropped: that is
exactly where OCPI 2.3.0 moved the information.
A Platform that supports Hub functionality with the Message routing headers SHALL give the country code and party ID of the Hub in the
hub_party_idfield.