This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from boschresearch/feature/self-attested
model updates to prepare for selective disclosure and self attested attributes
- Loading branch information
Showing
42 changed files
with
34,540 additions
and
19,241 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 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 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
31 changes: 0 additions & 31 deletions
31
...r-agent/src/main/java/org/hyperledger/bpa/controller/api/partner/ApproveProofRequest.java
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
...ner-agent/src/main/java/org/hyperledger/bpa/controller/api/proof/ApproveProofRequest.java
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,62 @@ | ||
/* | ||
* Copyright (c) 2020-2022 - for information on the respective copyright owner | ||
* see the NOTICE file and/or the repository at | ||
* https://github.com/hyperledger-labs/business-partner-agent | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hyperledger.bpa.controller.api.proof; | ||
|
||
import io.micronaut.core.annotation.Introspected; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.hyperledger.aries.api.present_proof.SendPresentationRequestHelper; | ||
|
||
import javax.validation.constraints.NotEmpty; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@Introspected | ||
public class ApproveProofRequest { | ||
|
||
@NotEmpty | ||
private Map<String, SelectedReferent> selectedReferents; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public static class SelectedReferent { | ||
private String referent; | ||
private Boolean revealed; | ||
private String selfAttestedValue; | ||
} | ||
|
||
public Map<String, SendPresentationRequestHelper.SelectedMatch.ReferentInfo> toClientAPI() { | ||
return selectedReferents.entrySet().stream() | ||
.map(e -> Map.entry(e.getKey(), | ||
SendPresentationRequestHelper.SelectedMatch.ReferentInfo.builder() | ||
.referent(e.getValue().getReferent()) | ||
.revealed(e.getValue().getRevealed()) | ||
.selfAttestedValue(e.getValue().getSelfAttestedValue()) | ||
.build())) | ||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); | ||
} | ||
|
||
public List<String> collectReferents() { | ||
return selectedReferents.values().stream() | ||
.map(SelectedReferent::getReferent) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
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.