Skip to content

Init#1

Merged
wistefan merged 8 commits intomainfrom
init
Oct 1, 2025
Merged

Init#1
wistefan merged 8 commits intomainfrom
init

Conversation

@wistefan
Copy link
Copy Markdown
Owner

No description provided.

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
@wistefan wistefan added the patch label Sep 12, 2025
@Slf4j
public class ClaimsEvaluator {

private static final String SD_KEY = "_sd";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a additional documentation for this key would be useful. At least I was unfamiliar with the selective disclosure field specifics

Object candidate = candidateWrapper.value;

// If map contains _sd, reveal it and MERGE revealed entries with the original map
if (disclosures != null && candidate instanceof Map<?, ?> mapCandidate && mapCandidate.containsKey("_sd")) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (disclosures != null && candidate instanceof Map<?, ?> mapCandidate && mapCandidate.containsKey("_sd")) {
if (disclosures != null && candidate instanceof Map<?, ?> mapCandidate && mapCandidate.containsKey(SD_KEY)) {


// If map contains _sd, reveal it and MERGE revealed entries with the original map
if (disclosures != null && candidate instanceof Map<?, ?> mapCandidate && mapCandidate.containsKey("_sd")) {
Object sdObj = mapCandidate.get("_sd");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Object sdObj = mapCandidate.get("_sd");
Object sdObj = mapCandidate.get(SD_KEY);

.toList();
}

public static List<LdpCredential> toLdpCredentials(List<Credential> credentialsList) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity: Would it be a possible scenario to have a type-mixed set of credentials?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially yes, but we filter the list of credentials for format, before mapping them. This can be done, because since "format" is a mandatory field for every DCQL, e.g. every DCQL can only return a single type of format. Thus, we filter out the credentials by format, map them to the concrete format and apply the query to that pre-filtered list.

selectedCredentials.addAll(credentialsFullfilling);
}
// if no sets are requested, put the credentials at one
return new QueryResult(true, Map.of("credentials", selectedCredentials));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new QueryResult(true, Map.of("credentials", selectedCredentials));
return new QueryResult(true, Map.of(DEFAULT_KEY, selectedCredentials));


private static List<Credential> evaluateCredentialQuery(CredentialQuery credentialQuery, List<Credential> credentialsList) {

if (!containsClaims(credentialQuery)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either I have a "Knick in der Optik" or you might have to check this condition

@wistefan wistefan requested a review from pulledtim September 26, 2025 11:39
@wistefan wistefan merged commit a57e460 into main Oct 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants