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

Credential Schema Support #520

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TaylorBeeston
Copy link
Contributor

Adds support for checking credentialSchema.

  • Adds an extra check, credentialSchema, that, when specified in options, will check the credentialSchema field of a credential.
  • Uses boon for schema validation.
  • Adds a CheckableSchema enum, similar to the CheckableStatus enum in ssi-vc that (for now) only supports 1EdTechJSONSchemaValidator2019 schemas, though boon supports much more
  • Adds a test CLR Credential and uses it to add a credential_schema test that makes sure everything is working!
    • I chose a CLR because that is what I'm working towards trying to implement full support for!
  • Adds OBv3.0.1, OBv3 Extensions, and CLRv2 contexts (these were needed for the above test credential)
  • For some reason, rustc likes to sometimes error at me about the iri_match macro, complaining that a comma is missing. I have found that adding a comma like so fixes that:
    image

Feel free to remove that comma if necessary, I'm not really sure why it's happening to me as Rust macros still make my brain stop working a bit!

One more bit of reference: These are my cargo/rustc versions I am using and seeing that error with:
image

@sbihel
Copy link
Member

sbihel commented Jul 17, 2023

ssi is currently in the middle of a major refactor, so we will hold off adding such new feature until it's complete.

A couple of thoughts though after skimming through the PR:

  • we've decided to limit the contexts in ssi-context to contexts that everybody would need, so probably the CLR context should be provided by the user; and
  • I would prefer jsonschema over boon, I understand boon appears to be more complete, but jsonschema has a larger user base and had been around for a while now.

@TaylorBeeston
Copy link
Contributor Author

@sbihel no worries! I'll just move the CLR context out of StaticLoader and then ad hoc use it for the test since I've already got that credential all set up. Should I do the same with the Open Badges contexts?

Also no worries about using jsonschema instead! I just went here and picked boon because it had more recent commits 😂

I'll go ahead and get started on that now!

@TaylorBeeston
Copy link
Contributor Author

Okay, this now uses jsonschema, does not include CLR V2 context in StaticLoader, and adds an extra test to make sure that invalid schemas do fail. Let me know if you want me to move OBv3.0.1 and OBv3 Extensions contexts out of StaticLoader as well!

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants