hyperledger-archives / aries-framework-go

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.
https://wiki.hyperledger.org/display/ARIES/aries-framework-go
Apache License 2.0
240 stars 161 forks source link

feat: added JWT handling for limit disclosure Presentation Definition query #3588

Closed mishasizov-SK closed 1 year ago

mishasizov-SK commented 1 year ago

Title: Added JWT handling for limit disclosure Presentation Definition query.

Summary: After new credential is created based on limit disclosure constraints:

credential, err = createNewCredential(constraints, credentialSrc, template, credential, opts...)
if err != nil {
     return nil, fmt.Errorf("create new credential: %w", err)
}

it always returned in JSON-LD format.

Then, down the code, we check is it JWT in merge func

vcFormat := FormatLDPVC
if credential.JWT != "" {
     vcFormat = FormatJWTVC
}
.....
  desc := &InputDescriptorMapping{
    PathNested: &InputDescriptorMapping{
        Format: vcFormat,
    },
}

I added a code that calculates JWT field in limited disclosure VC based on existing claims.

codecov[bot] commented 1 year ago

Codecov Report

Merging #3588 (fe88438) into main (0284074) will decrease coverage by 0.20%. The diff coverage is 64.70%.

@@            Coverage Diff             @@
##             main    #3588      +/-   ##
==========================================
- Coverage   87.21%   87.02%   -0.20%     
==========================================
  Files         353      353              
  Lines       48735    48682      -53     
==========================================
- Hits        42504    42364     -140     
- Misses       4686     4773      +87     
  Partials     1545     1545              
Impacted Files Coverage Δ
pkg/doc/presexch/definition.go 84.53% <64.70%> (-0.35%) :arrow_down:

... and 79 files with indirect coverage changes