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

Cred Manifest <--> Cred Application Validation #222

Merged
merged 8 commits into from
Oct 11, 2022
Merged

Conversation

nitro-neal
Copy link
Contributor

IsValidPair validates the rules on how a credential manifest [cm] and credential application [ca] relate to each other https://identity.foundation/credential-manifest/#credential-application

The object MUST contain a manifest_id property. The value of this property MUST be the id of a valid Credential Manifest.

The following rules are enforced in the pr:

The ca must have a format property if the related Credential Manifest specifies a format property.
Its value must be a subset of the format property in the Credential Manifest that this Credential Submission

The Credential Application object MUST contain a presentation_submission property IF the related Credential Manifest contains a presentation_definition.
Its value MUST be a valid Presentation Submission:

https://identity.foundation/presentation-exchange/#presentation-submission
The presentation_submission object MUST contain a definition_id property. The value of this property MUST be the id value of a valid Presentation Definition.

The descriptor_map object MUST include a format property. The value of this property MUST be a string that matches one of the Claim Format Designation. This denotes the data format of the Claim.

}
}

// TODO: Path validation
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Is there any validation work that needs to be done here between the Input Descriptors and the descriptor map's path?

Copy link
Member

Choose a reason for hiding this comment

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

perhaps make sure the path exists?

Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

see comments

Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov-commenter
Copy link

Codecov Report

Merging #222 (267f52a) into main (85da66c) will increase coverage by 0.08%.
The diff coverage is 61.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   57.76%   57.83%   +0.08%     
==========================================
  Files          36       36              
  Lines        3996     4053      +57     
==========================================
+ Hits         2308     2344      +36     
- Misses       1304     1320      +16     
- Partials      384      389       +5     
Impacted Files Coverage Δ
credential/exchange/model.go 37.66% <43.75%> (+0.16%) ⬆️
credential/manifest/model.go 56.00% <68.09%> (+10.72%) ⬆️

@nitro-neal nitro-neal merged commit 619481b into main Oct 11, 2022
@nitro-neal nitro-neal deleted the cm-ca-validation branch October 11, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants