#[non_exhaustive]pub struct DomainLinkageConfiguration {
pub context: String,
pub linked_dids: Vec<LinkedDid>,
}domain-linkage only.Expand description
The DID configuration resource: @context and the domain linkage credentials.
§Examples
use identity_kit::domain_linkage::{DomainLinkageConfiguration, LinkedDid};
use serde_json::json;
let configuration: DomainLinkageConfiguration = serde_json::from_value(json!({
"@context": "https://identity.foundation/.well-known/did-configuration/v1",
"linked_dids": [
"eyJhbGciOiJFZERTQSJ9.RXhhbXBsZSBvZiBFZDI1NTE5IHNpZ25pbmc.hgyY0il_MGCjP0JzlnLWG1PPOt7-09PGcvMg3AIbQR6dWbhijcNR4ki4iylGjg5BhVsPt9g7sVvpAr_MuM0KAg"
]
}))?;
assert_eq!(configuration.jwts().count(), 1);
assert!(serde_json::from_value::<DomainLinkageConfiguration>(json!({
"@context": "https://example.com/other", "linked_dids": []
})).is_err());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.context: String@context, CONTEXT.
linked_dids: Vec<LinkedDid>The domain linkage credentials, one per linked DID.
Implementations§
Source§impl DomainLinkageConfiguration
impl DomainLinkageConfiguration
Sourcepub fn with_credential(self, credential: Jwt) -> Self
pub fn with_credential(self, credential: Jwt) -> Self
This configuration with credential added.
Sourcepub fn jwts(&self) -> impl Iterator<Item = (usize, &Jwt)>
pub fn jwts(&self) -> impl Iterator<Item = (usize, &Jwt)>
The credentials in the JSON Web Token proof format, with their positions.
Sourcepub fn entries(
&self,
) -> impl Iterator<Item = (usize, Result<UnverifiedLinkage, DomainLinkageError>)> + '_
pub fn entries( &self, ) -> impl Iterator<Item = (usize, Result<UnverifiedLinkage, DomainLinkageError>)> + '_
The credentials in the JSON Web Token proof format, with their positions, each read
without verifying it (UnverifiedLinkage::from_jwt), or why it does not read.
Linked Data Proof entries are not among them.
For the controller of the origin, maintaining the configuration it publishes; a
verifier validates with DomainLinkageValidator.
Sourcepub fn earliest_expiry(&self) -> Option<DateTime<Utc>>
pub fn earliest_expiry(&self) -> Option<DateTime<Utc>>
The earliest expiry among the JWT credentials that read (entries),
or None when none reads or none expires: when the configuration needs renewing at
the latest.
Sourcepub fn remove_origin(
&mut self,
origin: &Url,
) -> Result<usize, DomainLinkageError>
pub fn remove_origin( &mut self, origin: &Url, ) -> Result<usize, DomainLinkageError>
Removes the JWT credentials linking origin, compared normalized
(normalize_origin), and returns how many it removed. Credentials that do not
read (entries) and Linked Data Proof entries are kept; remove them
from linked_dids directly.
§Errors
DomainLinkageError::InvalidOrigin when origin has no host.
Sourcepub fn check(&self) -> Result<(), DomainLinkageError>
pub fn check(&self) -> Result<(), DomainLinkageError>
Trait Implementations§
Source§impl Clone for DomainLinkageConfiguration
impl Clone for DomainLinkageConfiguration
Source§impl Debug for DomainLinkageConfiguration
impl Debug for DomainLinkageConfiguration
Source§impl Default for DomainLinkageConfiguration
impl Default for DomainLinkageConfiguration
Source§impl<'de> Deserialize<'de> for DomainLinkageConfiguration
impl<'de> Deserialize<'de> for DomainLinkageConfiguration
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for DomainLinkageConfiguration
impl Display for DomainLinkageConfiguration
impl Eq for DomainLinkageConfiguration
Source§impl PartialSchema for DomainLinkageConfiguration
Available on crate feature utoipa only.
impl PartialSchema for DomainLinkageConfiguration
utoipa only.impl StructuralPartialEq for DomainLinkageConfiguration
Source§impl ToSchema for DomainLinkageConfiguration
Available on crate feature utoipa only.
impl ToSchema for DomainLinkageConfiguration
utoipa only.Auto Trait Implementations§
impl Freeze for DomainLinkageConfiguration
impl RefUnwindSafe for DomainLinkageConfiguration
impl Send for DomainLinkageConfiguration
impl Sync for DomainLinkageConfiguration
impl Unpin for DomainLinkageConfiguration
impl UnsafeUnpin for DomainLinkageConfiguration
impl UnwindSafe for DomainLinkageConfiguration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.