Skip to content

Commit

Permalink
Fix signed credential type (#16)
Browse files Browse the repository at this point in the history
Also fix leftover type param
  • Loading branch information
sbihel authored Aug 20, 2024
1 parent 31d97c5 commit 149b6ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/core/profiles/w3c/ldp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use serde::{Deserialize, Serialize};
use ssi_claims::vc::AnyJsonCredential;
use ssi_claims::{
data_integrity::{AnySuite, DataIntegrity},
vc::AnyJsonCredential,
};

use crate::profiles::{
AuthorizationDetailsProfile, CredentialMetadataProfile, CredentialOfferProfile,
Expand Down Expand Up @@ -178,20 +181,20 @@ impl CredentialRequestProfile for Request {
type Response = Response;
}

// We might want to make the credential type generic
// TODO We want to make the credential type generic and avoid using AnySuite, but right now we are already pulling ssi-claims
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Response {
credential: AnyJsonCredential,
credential: DataIntegrity<AnyJsonCredential, AnySuite>,
}

impl Response {
pub fn new(credential: AnyJsonCredential) -> Self {
pub fn new(credential: DataIntegrity<AnyJsonCredential, AnySuite>) -> Self {
Self { credential }
}

field_getters_setters![
pub self [self] ["LD VC credential response value"] {
set_credential -> credential[AnyJsonCredential],
set_credential -> credential[DataIntegrity<AnyJsonCredential, AnySuite>],
}
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ impl AuthorizationMetadata {
.map_err(Self::trace_and_continue)
}

pub fn discover<LF, HC, RE, CM, JT, JE, JA>(
pub fn discover<HC, RE, CM, JT, JE, JA>(
credential_issuer_metadata: &CredentialIssuerMetadata<CM, JT, JE, JA>,
grant_type: Option<CoreGrantType>,
http_client: HC,
Expand Down Expand Up @@ -559,7 +559,7 @@ impl AuthorizationMetadata {
.map_err(Self::trace_and_continue)
}

pub async fn discover_async<F, LF, HC, RE, CM, JT, JE, JA>(
pub async fn discover_async<F, HC, RE, CM, JT, JE, JA>(
credential_issuer_metadata: &CredentialIssuerMetadata<CM, JT, JE, JA>,
grant_type: Option<CoreGrantType>,
http_client: HC,
Expand Down

0 comments on commit 149b6ff

Please sign in to comment.