ssi-sdk icon indicating copy to clipboard operation
ssi-sdk copied to clipboard

demo of full authorization flow

Open andorsk opened this issue 1 year ago • 8 comments

a sample demo with a full authorization flow. This is moved from https://github.com/TBD54566975/ssi-sdk/pull/123. In this, 3 actors are presented:

  1. A university
  2. A student
  3. An employer

The situation is simple: A student graduates from Example University, and Employer now wants to hire the student. This flow outlines how the VC flow works, between the holder, issuer, and verifier. Below is an example of the flow.

image

There is a basic authorization check later, which checks if the employer is OK with the student's VC claims. This is intended to be an explanatory demo, not a production use case.

andorsk avatar Jul 18 '22 09:07 andorsk

@decentralgabe can you take a look at this and let me know if at least the flow is correct and there's nothing wrong conceptually with the demonstration?

andorsk avatar Jul 18 '22 09:07 andorsk

@decentralgabe yea...we can break it up into multiple files. Good idea. Thanks for the comments.

andorsk avatar Jul 19 '22 02:07 andorsk

I need to eventually bring this back to life. Sorry, been caught up with other things.

andorsk avatar Jul 26 '22 12:07 andorsk

Based on https://github.com/TBD54566975/ssi-sdk/pull/164 will move over to use_cases.

andorsk avatar Aug 15 '22 21:08 andorsk

Codecov Report

Merging #147 (39a1d1b) into main (bee622c) will decrease coverage by 0.62%. The diff coverage is 42.43%.

@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
- Coverage   55.72%   55.10%   -0.63%     
==========================================
  Files          38       40       +2     
  Lines        4163     4368     +205     
==========================================
+ Hits         2320     2407      +87     
- Misses       1449     1565     +116     
- Partials      394      396       +2     
Impacted Files Coverage Δ
did/util.go 37.50% <0.00%> (-5.77%) :arrow_down:
...ses/apartment_application/apartment_application.go 100.00% <ø> (ø)
example/util.go 6.66% <0.00%> (-13.34%) :arrow_down:
example/wallet.go 0.00% <0.00%> (ø)
example/use_cases/employer_university_flow/main.go 92.55% <92.55%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 15 '22 22:08 codecov-commenter

@decentralgabe I think this example will work. I've incorporated the feedback provided. There's things that I would like to improve, in later PR's, but for now if possible I'd like to just get this example in, and improve the example later. It's been 29 days this PR's been open now 🙄 ( mia culpa. it just slid off my radar )

Can you take a look when you have a chance, and we can discuss what changes would be needed for a merge? I'd like to limit future work on it, but I don't want to scrap this work either as it accomplishes I think, it's primary goal of being a simple example to demonstrate a full issuance and verification flow.

I think this with the apartment use case: https://github.com/TBD54566975/ssi-sdk/tree/main/example/use_cases/apartment_application are reasonable reference points for a beginner.

https://github.com/TBD54566975/ssi-sdk/pull/164

image

andorsk avatar Aug 15 '22 22:08 andorsk

@decentralgabe please check out the comment above re: my position on this PR.

andorsk avatar Aug 15 '22 22:08 andorsk

noticed a number of package names with underscores. I know there are some already with this pattern (which should be corrected) - but the go style guide advises avoiding it https://go.dev/blog/package-names

decentralgabe avatar Aug 16 '22 16:08 decentralgabe

noticed a number of package names with underscores. I know there are some already with this pattern (which should be corrected) - but the go style guide advises avoiding it https://go.dev/blog/package-names

Good call out. Refactoring.

andorsk avatar Aug 30 '22 18:08 andorsk

Addressed comments:

image

andorsk avatar Aug 30 '22 19:08 andorsk

@decentralgabe thanks for the review! Hopefully addressed the comments/concerns. Made a few notes about some thoughts. Lmk if there's anything else. Looking forward to getting this in.

andorsk avatar Aug 31 '22 19:08 andorsk