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

VC DI proof request #2960

Conversation

sarthakvijayvergiya
Copy link
Contributor

@sarthakvijayvergiya sarthakvijayvergiya commented May 21, 2024

Presentation request (DIF) for VC_DI credentials

Copy link

sonarcloud bot commented May 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@ianco
Copy link
Contributor

ianco commented Jun 4, 2024

I know this is still WIP, but we need to have a description on the PR (is necessary in case anyone needs to look back on this PR in the future, and is also used for release notes). Also it's good - if the PR is in WIP state - to make a note of what is done and what's still outstanding ...

@sarthakvijayvergiya sarthakvijayvergiya marked this pull request as draft June 5, 2024 06:58
@sarthakvijayvergiya sarthakvijayvergiya changed the title feat: VC DI proof request [WIP] feat: VC DI proof request Jun 5, 2024
@sarthakvijayvergiya sarthakvijayvergiya force-pushed the whatscookin/feat/vc-di-proof branch 2 times, most recently from 4dee13e to e344a1d Compare June 5, 2024 10:22
@ianco
Copy link
Contributor

ianco commented Jun 16, 2024

Also just noticed the commit is missing the DCO signoff

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
EmadAnwer and others added 7 commits June 28, 2024 22:20
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
…est_web_request object for revocation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
@EmadAnwer EmadAnwer force-pushed the whatscookin/feat/vc-di-proof branch from 6f53dc0 to c13a3df Compare July 4, 2024 19:56
- getting the correct timestamp
- create  rev_states
- remove static code

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: Emad <emadanwer.official@gmail.com>
EmadAnwer and others added 5 commits July 8, 2024 23:18
to
 - create_rev_states
- prepare_data_for_presentation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
add
- prepare_data_for_presentation
- _load_w3c_credentials functions

remove holder flag

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Additional integration tests for vc_di and revocation
- test_assert_no_callenge_error
- test_assert_verify_presentation
- test__extract_cred_idx
- test__get_predicate_type_and_value
- test__load_w3c_credentials
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Copy link
Contributor

@ianco ianco left a comment

Choose a reason for hiding this comment

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

A couple of comments to be removed (minor issue) and unit test coverage (SonarCloud reports 27 new lines in each of aries_cloudagent/anoncreds/holder.py and aries_cloudagent/vc/vc_di/prove.py that are not covered - I think 2 simple "happy path" tests could cover most of this).

Also PR description ... (@EmadAnwer not sure if you mentioned you can't edit the description?)

Overall looks really good!

demo/runners/agent_container.py Outdated Show resolved Hide resolved
@@ -169,7 +171,7 @@ async def create_pres(
domain = proof_request["options"].get("domain")
if not challenge:
challenge = str(uuid4())

# TODO handle vc_di format in the future
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment can be removed

- test_create_presentation_w3c
- test_create_presentation_w3c_create_error

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
- test_create_signed_anoncreds_presentation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: Emad <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
@EmadAnwer EmadAnwer force-pushed the whatscookin/feat/vc-di-proof branch from ac32d5e to d13136c Compare July 11, 2024 19:37
- test_store_credential_w3c
- test_get_type_manager_options

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
@ianco ianco requested a review from jamshale July 11, 2024 22:27
@jamshale jamshale changed the title [WIP] feat: VC DI proof request VC DI proof request Jul 11, 2024
@jamshale
Copy link
Contributor

jamshale commented Jul 11, 2024

There is quite a few things reported in sonarcloud. I don't think everything needs to be addressed but some definitely should like the unused variable and shadow variable names.

https://sonarcloud.io/project/issues?id=hyperledger_aries-cloudagent-python&pullRequest=2960&resolved=false&sinceLeakPeriod=true

Maybe have a go over and see if we can make some improvements. I think overall the code looks good and well tested.

@ianco
Copy link
Contributor

ianco commented Jul 11, 2024

There is quite a few things reported in sonarcloud. I don't think everything needs to be addressed but some definitely should like the unused variable and shadow variable names.

https://sonarcloud.io/project/issues?id=hyperledger_aries-cloudagent-python&pullRequest=2960&resolved=false&sinceLeakPeriod=true

Maybe have a go over and see if we can make some improvements. I think overall the code looks good and well tested.

Good catch @jamshale

@EmadAnwer can you review the SonarCloud report and do a bit of cleanup? As Jamie says we don't need to address everything but take a pass and see what you think.

Copy link
Contributor

@ianco ianco left a comment

Choose a reason for hiding this comment

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

SonarCloud as noted by Jamie

@EmadAnwer
Copy link
Contributor

There is quite a few things reported in sonarcloud. I don't think everything needs to be addressed but some definitely should like the unused variable and shadow variable names.
https://sonarcloud.io/project/issues?id=hyperledger_aries-cloudagent-python&pullRequest=2960&resolved=false&sinceLeakPeriod=true
Maybe have a go over and see if we can make some improvements. I think overall the code looks good and well tested.

Good catch @jamshale

@EmadAnwer can you review the SonarCloud report and do a bit of cleanup? As Jamie says we don't need to address everything but take a pass and see what you think.

yes sure

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Copy link

sonarcloud bot commented Jul 12, 2024

@EmadAnwer
Copy link
Contributor

Quality Gate Passed Quality Gate passed

Issues 12 New issues 0 Accepted issues

Measures 0 Security Hotspots 86.4% Coverage on New Code 0.0% Duplication on New Code

See analysis details on SonarCloud

There is quite a few things reported in sonarcloud. I don't think everything needs to be addressed but some definitely should like the unused variable and shadow variable names.
https://sonarcloud.io/project/issues?id=hyperledger_aries-cloudagent-python&pullRequest=2960&resolved=false&sinceLeakPeriod=true
Maybe have a go over and see if we can make some improvements. I think overall the code looks good and well tested.

Good catch @jamshale
@EmadAnwer can you review the SonarCloud report and do a bit of cleanup? As Jamie says we don't need to address everything but take a pass and see what you think.

yes sure

@jamshale @ianco I have fixed most of it, check it please, let me know if there are any suggestions

@jamshale jamshale merged commit a1a5afc into openwallet-foundation:main Jul 12, 2024
8 checks passed
@jamshale
Copy link
Contributor

I'm going to merge this. Would be nice to have in the 1.0.0 release and don't predict any regressions.

@swcurran
Copy link
Contributor

w00t!!! Awesome.

darshilnb pushed a commit to Northern-Block/aries-cloudagent-python that referenced this pull request Sep 5, 2024
* WIP: vc di proof request - authored by ianco(openwallet-foundation#3043)

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>

* fixed lint checks, cleanup

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>

* fix: verify_pres, get_sign_key_credential_subject_id

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* WIP: debugging revocation & fixes

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>

* WIP: fix ununsed import

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>

* refactor: create_signed_anoncreds_presentation,   faber vcdi proof_request_web_request  object for revocation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* Refactor:Add W3cCredential loading for VCDI format handler

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* fix: tests
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* WPA: using static data to test the revocation validation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* feat: Add revocation support to VCDI
- getting the correct timestamp
- create  rev_states
- remove static code

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* Remove unused code for credential definition and revocation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* WPA: fix lint

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* Fix cred search for vc_di proof

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* Additional integration tests for vc_di and revocation

Signed-off-by: Ian Costanzo <ian@anon-solutions.ca>

* refactor: remove unused comments and TODO's
 - implement _extract_cred_idx
- add try catch to some expected fail code

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* refactor: split create_signed_anoncreds_presentation
to
 - create_rev_states
- prepare_data_for_presentation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* refactor: `create_signed_anoncreds_presentation`

add
- prepare_data_for_presentation
- _load_w3c_credentials functions

remove holder flag

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* add: tests

- test_assert_no_callenge_error
- test_assert_verify_presentation
- test__extract_cred_idx
- test__get_predicate_type_and_value
- test__load_w3c_credentials
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* add: tests, remove todos

- test_create_presentation_w3c
- test_create_presentation_w3c_create_error

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* add: tests

- test_create_signed_anoncreds_presentation

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* fix: linter

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* fix: remove unused imports

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* add: tests

- test_store_credential_w3c
- test_get_type_manager_options

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

* refactor: remove extra variables and comments

Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>

---------

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
Signed-off-by: EmadAnwer <emadanwer.official@gmail.com>
Signed-off-by: Emad <emadanwer.official@gmail.com>
Signed-off-by: Ian Costanzo <ian@anon-solutions.ca>
Co-authored-by: EmadAnwer <emadanwer.official@gmail.com>
Co-authored-by: Ian Costanzo <ian@anon-solutions.ca>
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.

5 participants