-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: add support for json-object based issuer #155
feat: add support for json-object based issuer #155
Conversation
This is amazing work @enmand 💯 CI currently failing because of UniFFI bindings; all of the bindings stuff is in a heavy WIP state so let me see what I can come to in order to merge this PR, brb |
Alright so the issue is caused from UniFFI's lack of support for enums with non-named field. I created a ticket to explore the ideal solution #161 @enmand I would recommend one of two ways forward:
If you choose to go route (2), here is a code diff of the removal of the code (I don't have push access to your repo so I can't open a PR, so this is good enough): diff --git a/bindings/uniffi/src/lib.rs b/bindings/uniffi/src/lib.rs
index 0069364..8aca89c 100644
--- a/bindings/uniffi/src/lib.rs
+++ b/bindings/uniffi/src/lib.rs
@@ -1,4 +1,3 @@
-use ::credentials::vc::{verify_vcjwt, CredentialError, CredentialSubject, VerifiableCredential};
use ::crypto::Curve;
use ::dids::{
bearer::{BearerDid, BearerDidError},
diff --git a/bindings/uniffi/src/web5.udl b/bindings/uniffi/src/web5.udl
index 3bba112..22d1da0 100644
--- a/bindings/uniffi/src/web5.udl
+++ b/bindings/uniffi/src/web5.udl
@@ -6,9 +6,6 @@ namespace web5 {
string sign_jwt([ByRef] BearerDid bearer_did, [ByRef] KeySelector key_selector, [ByRef] string encoded_header, [ByRef] string encoded_payload);
[Throws=JwtError, Async]
void verify_jwt([ByRef] string jwt);
-
- [Throws=CredentialError, Async]
- VerifiableCredential verify_vcjwt([ByRef] string jwt);
};
[Error]
@@ -195,21 +192,4 @@ interface Claims {
string encode();
[Throws=JwtError]
string sign([ByRef] BearerDid bearer_did, [ByRef] KeySelector key_selector);
-};
-
-dictionary CredentialSubject {
- string id;
- record<string, string>? params;
-};
-
-[Error]
-enum CredentialError {
- "JwtError",
- "JwsError",
-};
-
-interface VerifiableCredential {
- constructor(sequence<string> context, string id, sequence<string> type, string issuer, i64 issuance_date, i64? expiration_date, CredentialSubject credential_subject);
- [Throws=CredentialError]
- string sign([ByRef] BearerDid bearer_did, [ByRef] KeySelector key_selector);
};
\ No newline at end of file |
a0b4025
to
ef6362b
Compare
I didn't expect this to work, but I was able to checkout For background, we blanked out in #181 so the above blocker has been removed |
Thanks again for this @enmand! This is awesome work! |
Add support for a JSON-like object for id/name for an Issuer, in addition to a string based on the VC spec.
Resolves #113