Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding applicant as required #428

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion credential/manifest/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type CredentialApplicationWrapper struct {
type CredentialApplication struct {
ID string `json:"id" validate:"required"`
SpecVersion string `json:"spec_version" validate:"required"`
Applicant string `json:"applicant"`
Applicant string `json:"applicant" validate:"required"`
ManifestID string `json:"manifest_id" validate:"required"`
Format *exchange.ClaimFormat `json:"format" validate:"required,dive"`
// Must be present if the corresponding manifest contains a presentation_definition
Expand Down
1 change: 1 addition & 0 deletions credential/manifest/testdata/full-application.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"spec_version": "https://identity.foundation/credential-manifest/spec/v1.0.0/",
"applicant": "did:example:123",
"manifest_id": "WA-DL-CLASS-A",
"format": {
"ldp_vc": {
Expand Down
4 changes: 4 additions & 0 deletions example/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ func prepareCredentialApplication(cm manifest.CredentialManifest, vc credential.
return nil, err
}

if err := builder.SetApplicantID("did:example:123"); err != nil {
return nil, err
}

format := string(exchange.JWTVC)
if err := builder.SetPresentationSubmission(exchange.PresentationSubmission{
ID: uuid.NewString(),
Expand Down
1 change: 1 addition & 0 deletions example/usecase/steel_thread/testdata/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"id": "c0c6e312-ad44-4f18-935e-a6efaad91612",
"spec_version": "https://identity.foundation/credential-manifest/spec/v1.0.0/",
"manifest_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"applicant" : "did:example:123",
"format": {
"jwt_vc": {
"alg": [
Expand Down