-
Notifications
You must be signed in to change notification settings - Fork 28
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
refactor!: VCs in core #798
Conversation
* @param initialCTypes An array of CTypes with which the cache is to be initialized. | ||
* @returns A function that takes a CType id and looks up a CType definition in an internal cache, and if not found, tries to fetch it from the KILT blochchain. | ||
*/ | ||
export function newCachingCTypeLoader( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to CType features
/** | ||
* Credential context URL required for Kilt credentials. | ||
*/ | ||
export const CONTEXT_URL = 'https://www.kilt.io/contexts/credentials' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved constants to the files to which they relate most to make the relationships of the them clearer
export const spiritnetGenesisHash = hexToU8a( | ||
'0x411f057b9107718c9624d6aa4a3f23c1653898297f3d4d529d9bb6511a39dd21' | ||
) | ||
export const KILT_ATTESTER_LEGITIMATION_V1_TYPE = 'KiltAttesterLegitimationV1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted to expose them under the KiltCredentialV1 namespace but was afraid circular dependencies may break things, so they are defined here and exposed there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signing is still TBD
export * from './suites/index.js' | ||
export * from './purposes/index.js' | ||
export * from './documentLoader.js' | ||
export { validationContexts as contexts } from './context/index.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this package only contains the jsonld-signatures support now. moved this a level up
console.info('Credential proof verified') | ||
|
||
await KiltRevocationStatusV1.check(issued) | ||
console.info('Credential status verified') | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presentation also still missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I. Love. It. Very very nice. We just need to expose an easier way to verify a credential, and a way to sign presentations, and then we're golden.
52f2c48
to
5442d41
Compare
Note that test pass, just the coverage is too low at the moment - I would defer ramping up coverage to when we have the complete feature set implemented though. |
fixes KILTProtocol/ticket#2827
Moves the VC type credentials into the core package and removes legacy credential support from it.
THIS DOES NOT YET IMPLEMENT A USER FRIENDLY ISSUANCE, PRESENTATION AND VERIFICATION API - THIS IS TBD!
To be done in a follow-up PR:
How to test:
Play around with it?
Checklist: