-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify core and custom profiles under one type
- Loading branch information
Showing
35 changed files
with
210 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...re/profiles/ldp_vc/credential_response.rs → ...re/profiles/ldp_vc/credential_response.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/profiles/core/profiles/mso_mdoc/credential_response.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use isomdl::definitions::IssuerSigned; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::profiles::CredentialResponseProfile; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct CredentialResponse; | ||
|
||
impl CredentialResponseProfile for CredentialResponse { | ||
type Type = IsoIssuerSigned; | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct IsoIssuerSigned(#[serde(with = "base64_cbor")] IssuerSigned); | ||
|
||
mod base64_cbor { | ||
use base64::{engine::general_purpose::URL_SAFE, Engine}; | ||
use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize, Serializer}; | ||
|
||
pub fn serialize<T: Sized + Serialize, S: Serializer>(v: &T, s: S) -> Result<S::Ok, S::Error> { | ||
let v = match serde_cbor::to_vec(v) { | ||
Ok(v) => v, | ||
Err(e) => return Err(serde::ser::Error::custom(e)), | ||
}; | ||
let b64 = URL_SAFE.encode(v); | ||
String::serialize(&b64, s) | ||
} | ||
|
||
pub fn deserialize<'de, T: DeserializeOwned, D: Deserializer<'de>>( | ||
d: D, | ||
) -> Result<T, D::Error> { | ||
let b64 = String::deserialize(d)?; | ||
match URL_SAFE.decode(b64) { | ||
Ok(v) => match serde_cbor::from_slice(&v) { | ||
Ok(v) => Ok(v), | ||
Err(e) => Err(serde::de::Error::custom(e)), | ||
}, | ||
Err(e) => Err(serde::de::Error::custom(e)), | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...rofiles/vc_sd_jwt/authorization_detail.rs → ...rofiles/vc_sd_jwt/authorization_detail.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...les/vc_sd_jwt/credential_configuration.rs → ...les/vc_sd_jwt/credential_configuration.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.