diff --git a/cli/src/proto/services/trustregistry/v1/mod.rs b/cli/src/proto/services/trustregistry/v1/mod.rs index cf7f9d053..875232c02 100644 --- a/cli/src/proto/services/trustregistry/v1/mod.rs +++ b/cli/src/proto/services/trustregistry/v1/mod.rs @@ -72,7 +72,7 @@ pub mod unregister_member_request { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnregisterMemberResponse {} -/// Request to fetch member status in governance framework for a specific credential schema. +/// Request to fetch member status in Trust Registry for a specific credential schema. #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -143,7 +143,7 @@ pub struct AuthorizedMemberSchema { #[prost(uint64, tag = "5")] pub valid_until: u64, } -/// Request to get a member of the governance framework +/// Request to get a member of the Trust Registry #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/dart/example/vaccine_example.dart b/dart/example/vaccine_example.dart index bea4b8129..f7aed5e83 100644 --- a/dart/example/vaccine_example.dart +++ b/dart/example/vaccine_example.dart @@ -94,7 +94,7 @@ Future runVaccineDemo() async { // } // storeCredential() { - // Alice stores the credential in her cloud wallet. + // Allison stores the credential in her cloud wallet. trinsic.serviceOptions.authToken = allison.authToken; // insertItemWallet() { var insertResponse = await trinsic diff --git a/dart/lib/src/proto/services/trust-registry/v1/trust-registry.pb.dart b/dart/lib/src/proto/services/trust-registry/v1/trust-registry.pb.dart index 88882b654..c211e1761 100644 --- a/dart/lib/src/proto/services/trust-registry/v1/trust-registry.pb.dart +++ b/dart/lib/src/proto/services/trust-registry/v1/trust-registry.pb.dart @@ -416,7 +416,7 @@ class UnregisterMemberResponse extends $pb.GeneratedMessage { static UnregisterMemberResponse? _defaultInstance; } -/// Request to fetch member status in governance framework for a specific credential schema. +/// Request to fetch member status in Trust Registry for a specific credential schema. class GetMemberAuthorizationStatusRequest extends $pb.GeneratedMessage { factory GetMemberAuthorizationStatusRequest({ $core.String? didUri, @@ -971,7 +971,7 @@ class AuthorizedMemberSchema extends $pb.GeneratedMessage { enum GetMemberRequest_Member { didUri, walletId, email, notSet } -/// Request to get a member of the governance framework +/// Request to get a member of the Trust Registry class GetMemberRequest extends $pb.GeneratedMessage { factory GetMemberRequest({ $core.String? didUri, diff --git a/dart/lib/src/proto/services/verifiable-credentials/v1/verifiable-credentials.pb.dart b/dart/lib/src/proto/services/verifiable-credentials/v1/verifiable-credentials.pb.dart index e1688add6..d5be21122 100644 --- a/dart/lib/src/proto/services/verifiable-credentials/v1/verifiable-credentials.pb.dart +++ b/dart/lib/src/proto/services/verifiable-credentials/v1/verifiable-credentials.pb.dart @@ -156,7 +156,7 @@ class IssueFromTemplateRequest extends $pb.GeneratedMessage { void clearExpirationDate() => clearField(5); /// If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - /// governance framework. + /// Trust Registry. @$pb.TagNumber(6) $core.bool get includeGovernance => $_getBF(4); @$pb.TagNumber(6) @@ -1394,7 +1394,7 @@ class CreateCredentialOfferRequest extends $pb.GeneratedMessage { void clearHolderBinding() => clearField(3); /// If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - /// governance framework. + /// Trust Registry. @$pb.TagNumber(4) $core.bool get includeGovernance => $_getBF(3); @$pb.TagNumber(4) diff --git a/docs/_static/proto.json b/docs/_static/proto.json index ca77ada16..11fa6c720 100644 --- a/docs/_static/proto.json +++ b/docs/_static/proto.json @@ -6381,7 +6381,7 @@ "services.trustregistry.v1.GetMemberAuthorizationStatusRequest": { "name": "GetMemberAuthorizationStatusRequest", "full_name": "services.trustregistry.v1.GetMemberAuthorizationStatusRequest", - "description": "Request to fetch member status in governance framework for a specific credential schema.", + "description": "Request to fetch member status in Trust Registry for a specific credential schema.", "fields": [ "services.trustregistry.v1.GetMemberAuthorizationStatusRequest.did_uri", "services.trustregistry.v1.GetMemberAuthorizationStatusRequest.schema_uri" @@ -6402,7 +6402,7 @@ "services.trustregistry.v1.GetMemberRequest": { "name": "GetMemberRequest", "full_name": "services.trustregistry.v1.GetMemberRequest", - "description": "Request to get a member of the governance framework", + "description": "Request to get a member of the Trust Registry", "fields": [ "services.trustregistry.v1.GetMemberRequest.did_uri", "services.trustregistry.v1.GetMemberRequest.wallet_id", @@ -10375,7 +10375,7 @@ "label": "LABEL_OPTIONAL", "type": "bool", "full_type": "bool", - "description": "If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's\ngovernance framework." + "description": "If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's\nTrust Registry." }, "services.verifiablecredentials.v1.CreateCredentialOfferRequest.signature_type": { "name": "signature_type", @@ -10498,7 +10498,7 @@ "label": "LABEL_OPTIONAL", "type": "bool", "full_type": "bool", - "description": "If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's\ngovernance framework." + "description": "If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's\nTrust Registry." }, "services.verifiablecredentials.v1.IssueFromTemplateRequest.save_copy": { "name": "save_copy", diff --git a/docs/dart/index.md b/docs/dart/index.md index ca650bbb4..85101ef6c 100644 --- a/docs/dart/index.md +++ b/docs/dart/index.md @@ -24,7 +24,7 @@ Alternatively, you can simply instantiate this service with or without parameter ```dart import 'package:trinsic_dart/trinsic.dart'; // ... -var trinsicService = TrinsicService(null); +var trinsic = TrinsicService(null); // Or, if you have an auth token -var trinsicService = TrinsicService(trinsicConfig(authToken: "")); +var trinsic = TrinsicService(trinsicConfig(authToken: "")); ``` \ No newline at end of file diff --git a/docs/dotnet/index.md b/docs/dotnet/index.md index 17ad44fed..eb7f5ece4 100644 --- a/docs/dotnet/index.md +++ b/docs/dotnet/index.md @@ -50,11 +50,11 @@ public MyController(TrinsicService trinsicService) Alternatively, you can simply instantiate this service with or without parameters ```cs -var trinsicService = new TrinsicService(); +var trinsic = new TrinsicService(); // or -var trinsicService = new TrinsicService(new ServiceOptions +var trinsic = new TrinsicService(new ServiceOptions { AuthToken = "" }); diff --git a/docs/examples/issue-direct-send.md b/docs/examples/issue-direct-send.md index bbc39f78f..548726875 100644 --- a/docs/examples/issue-direct-send.md +++ b/docs/examples/issue-direct-send.md @@ -85,12 +85,12 @@ const issueResponse = await trinsic.credential().issueFromTemplate({ console.dir(JSON.parse(issueResponse.documentJson), { depth: null, }); ``` -Let's look at some of the input fields for the issue from template request. +Let's look at some of the input fields for the `issueFromTemplate()` request. -: `templateId` is a required field and refers to the template ID that we want to use. -: `valuesJson` is a required field and must be an object with fields and their values. This object must be passed as JSON stringified value. -: `signatureType` is optional field that specifies type of signature that will be used to sign the credential. There are currently two types supported: `Standard` will use NIST approved cryptographic curves, specifically the Ed25519 curve with EDDSA signature. The `Experimental` signature type will use BBS Signatures with BLS12381 curve. -: `includeGovernance` is optional field that specifies if we'd like governance attestation about the issuer to be included with the credential. This will indicate that the issuer is authorized member of the governance framework for the given ecosystem. + - `templateId` is a required field and refers to the template ID that we want to use. + - `valuesJson` is a required field and must be an object with fields and their values. This object must be passed as JSON stringified value. + - `signatureType` is optional field that specifies type of signature that will be used to sign the credential. There are currently two types supported: `Standard` will use NIST approved cryptographic curves, specifically the Ed25519 curve with EDDSA signature. The `Experimental` signature type will use BBS Signatures with BLS12381 curve. + - `includeGovernance` is optional field that specifies if we'd like governance attestation about the issuer to be included with the credential. This will indicate that the issuer is authorized member of the governance framework for the given ecosystem. Without governance information: ```json @@ -107,17 +107,18 @@ Let's look at some of the input fields for the issue from template request. } ``` -: `expirationDate` is optional and specifies the validity period of the issed credential. If specified, this field must be in ISO 8601 format -: `saveCopy` is optional and will save a copy of the issued credential in the issuer wallet that will be marked as `IssuedVerifiableCredential`. This copy will not contain any cryptographic data or signatures and it's purpose is to allow the issuers to track the issued credentials and their metadata. This metadata is required if the issuer wants to change the status of the credential and revoke it's validity. This is controlled using the data found in the `credentialStatus` field. + - `expirationDate` is optional and specifies the validity period of the issed credential. If specified, this field must be in ISO 8601 format + - `saveCopy` is optional and will save a copy of the issued credential in the issuer wallet that will be marked as `IssuedVerifiableCredential`. This copy will not contain any cryptographic data or signatures and it's purpose is to allow the issuers to track the issued credentials and their metadata. This metadata is required if the issuer wants to change the status of the credential and revoke it's validity. This is controlled using the data found in the `credentialStatus` field. ### Send the credential -Finally, we can just send the credentil to the user's wallet by specifying the email address of the user. +Finally, we can just send the credential to the user's wallet by specifying its email address. If you want to send an email notification that a credential has been sent to the user's wallet, just set `sendNotification` to true. ```js await trinsic.credential().send({ documentJson: issueResponse.documentJson, email: "", + sendNotification: true, }); ``` diff --git a/docs/node/index.md b/docs/node/index.md index e2c2226bd..ed0058061 100644 --- a/docs/node/index.md +++ b/docs/node/index.md @@ -24,7 +24,7 @@ let { TrinsicService } = require("@trinsic/trinsic"); You must instantiate the trinsic service first: ```js -const trinsicService = new TrinsicService({ +const trinsic = new TrinsicService({ /** Trinsic API endpoint. Defaults to `prod.trinsic.cloud` */ serverEndpoint: "prod.trinsic.cloud", /** Trinsic API port; defaults to `443` */ @@ -38,7 +38,7 @@ const trinsicService = new TrinsicService({ Now you can use the SDK: ```js -const newWallet = await trinsicService.wallet().createWallet(); +const newWallet = await trinsic.wallet().createWallet(); console.log(JSON.stringify(newWallet, null, 4)); ``` diff --git a/docs/reference/proto/index.md b/docs/reference/proto/index.md index fe901ffbe..fb7fda455 100644 --- a/docs/reference/proto/index.md +++ b/docs/reference/proto/index.md @@ -1126,7 +1126,7 @@ Response to `CheckStatusRequest` | template_id | [string](/reference/proto#string) | ID of template to use | | values_json | [string](/reference/proto#string) | JSON document string with keys corresponding to the fields of the template referenced by `template_id` | | holder_binding | [bool](/reference/proto#bool) | If true, the credential will be issued with holder binding by specifying the holder DID in the credential subject | -| include_governance | [bool](/reference/proto#bool) | If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's governance framework. | +| include_governance | [bool](/reference/proto#bool) | If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's Trust Registry. | | generate_share_url | [bool](/reference/proto#bool) | If true, a short URL link will be generated that can be used to share the credential offer with the holder. This link will point to the credential offer in the wallet app. | | signature_type | [SignatureType](/reference/proto#services-verifiablecredentials-v1-SignatureType) | The type of signature to use when signing the credential. Defaults to `EXPERIMENTAL`. | @@ -1200,7 +1200,7 @@ Request to create and sign a JSON-LD Verifiable Credential from a template using | values_json | [string](/reference/proto#string) | JSON document string with keys corresponding to the fields of the template referenced by `template_id` | | save_copy | [bool](/reference/proto#bool) | Save a copy of the issued credential to this user's wallet. This copy will only contain the credential data, but not the secret proof value. Issuers may use this data to keep track of the details for revocation status. | | expiration_date | [string](/reference/proto#string) | The ISO8601 expiration UTC date of the credential. This is a reserved field in the VC specification. If specified, the issued credential will contain an expiration date. https://www.w3.org/TR/vc-data-model/#expiration | -| include_governance | [bool](/reference/proto#bool) | If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's governance framework. | +| include_governance | [bool](/reference/proto#bool) | If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's Trust Registry. | | signature_type | [SignatureType](/reference/proto#services-verifiablecredentials-v1-SignatureType) | The type of signature to use when signing the credential. Defaults to `EXPERIMENTAL`. | @@ -2208,7 +2208,7 @@ How to display a URI value when rendering a credential. ### GetMemberAuthorizationStatusRequest -Request to fetch member status in governance framework for a specific credential schema. +Request to fetch member status in Trust Registry for a specific credential schema. | Field | Type | Description | @@ -2239,7 +2239,7 @@ Response to `GetMemberAuthorizationStatusRequest` ### GetMemberRequest -Request to get a member of the governance framework +Request to get a member of the Trust Registry | Field | Type | Description | diff --git a/docs/reference/services/credential-service.md b/docs/reference/services/credential-service.md index 3e3b87670..c058e9f11 100644 --- a/docs/reference/services/credential-service.md +++ b/docs/reference/services/credential-service.md @@ -94,6 +94,14 @@ By utilizing the "Create Offer" endpoint, the issuing party can initiate a reque Furthermore, the "Create Offer" endpoint enables the issuing party to define and configure the holder binding properties of the credential. This means that the issued credential will be bound to the intended holder, making it non-transferable and restricted for use solely by the authorized holder. +{{ proto_sample_start() }} + === "TypeScript" + + ```typescript + [Create Credential Offer](../../../web/test/WalletService.test.ts) inside_block:createCredentialOffer + ``` + + {{ proto_method_tabs("services.verifiablecredentials.v1.VerifiableCredential.CreateCredentialOffer") }} --- @@ -104,6 +112,14 @@ The purpose of the "Accept Offer" method is for the user to formally accept the The "Accept Offer" method is a mandatory step in the issuance process, as it solidifies the user's commitment to acquiring the verifiable credential. During this step, if the issuer requested binding information, the user's wallet will submit a proof of DID ownership bind the credential to the user and make it non-transferable. The verifiable credential is then securely generated and delivered to the user, officially establishing their possession and ownership of the credential. +{{ proto_sample_start() }} + === "TypeScript" + + ```typescript + [Accept Credential](../../../web/test/WalletService.test.ts) inside_block:acceptCredential + ``` + + {{ proto_method_tabs("services.verifiablecredentials.v1.VerifiableCredential.AcceptCredential") }} --- @@ -111,6 +127,14 @@ The "Accept Offer" method is a mandatory step in the issuance process, as it sol ## Reject Credential This endpoint allows users to decline or reject an offered verifiable credential. By utilizing this endpoint, users can explicitly communicate their decision not to accept the credential being offered to them. By offering this option in your application, your platform promotes user empowerment and supports a transparent workflow for the acceptance or rejection of verifiable credentials. +   +{{ proto_sample_start() }} + === "TypeScript" + + ```typescript + [Reject Credential](../../../web/test/WalletService.test.ts) inside_block:rejectCredential + ``` + {{ proto_method_tabs("services.verifiablecredentials.v1.VerifiableCredential.RejectCredential") }} @@ -364,8 +388,9 @@ The specified email address must be tied to an existing account in the same ecos ```typescript await trinsic.credential().send(SendRequest.fromPartial({ - email: "", - documentJson: JSON.stringify({}), + documentJson: issueResponse.documentJson, + email: "", + sendNotification: true, })); ``` diff --git a/dotnet/Tests/HostTests.cs b/dotnet/Tests/HostTests.cs index 0a4a04c87..c297677a4 100644 --- a/dotnet/Tests/HostTests.cs +++ b/dotnet/Tests/HostTests.cs @@ -21,9 +21,9 @@ public class HostTests await host.StartAsync(); - var trinsicService = host.Services.GetRequiredService(); - var providerService = trinsicService.Provider; - var accountService = trinsicService.Wallet; + var trinsic = host.Services.GetRequiredService(); + var providerService = trinsic.Provider; + var accountService = trinsic.Wallet; providerService.Should().NotBeNull(); accountService.Should().NotBeNull(); @@ -51,9 +51,9 @@ public class HostTests await host.StartAsync(); - var trinsicService = host.Services.GetRequiredService(); - var providerService = trinsicService.Provider; - var walletService = trinsicService.Wallet; + var trinsic = host.Services.GetRequiredService(); + var providerService = trinsic.Provider; + var walletService = trinsic.Wallet; providerService.Should().NotBeNull(); walletService.Should().NotBeNull(); diff --git a/dotnet/Tests/Tests.cs b/dotnet/Tests/Tests.cs index 73bc7a539..acad66b18 100644 --- a/dotnet/Tests/Tests.cs +++ b/dotnet/Tests/Tests.cs @@ -100,7 +100,7 @@ public class Tests // Read the JSON credential data // issueCredentialSample() { - var credential = await trinsic.Credential.IssueFromTemplateAsync(new() { + var issueResponse = await trinsic.Credential.IssueFromTemplateAsync(new() { TemplateId = template.Data.Id, ValuesJson = JsonConvert.SerializeObject(new { field = 123 @@ -108,12 +108,16 @@ public class Tests }); // } - _testOutputHelper.WriteLine($"Credential:\n{credential.DocumentJson}"); + _testOutputHelper.WriteLine($"Credential:\n{issueResponse.DocumentJson}"); try { // sendCredential() { - var sendResponse = await trinsic.Credential.SendAsync(new() { Email = "example@trinsic.id" }); + var sendResponse = await trinsic.Credential.SendAsync(new() { + Email = "", + DocumentJson = issueResponse.DocumentJson, + SendNotification = true, + }); // } } catch { @@ -123,7 +127,7 @@ public class Tests trinsic = new TrinsicService(_options.CloneWithAuthToken(allison.AuthToken)); var insertItemResponse = - await trinsic.Wallet.InsertItemAsync(new() { ItemJson = credential.DocumentJson }); + await trinsic.Wallet.InsertItemAsync(new() { ItemJson = issueResponse.DocumentJson }); var itemId = insertItemResponse.ItemId; // getItem() { diff --git a/dotnet/Trinsic/Trinsic.xml b/dotnet/Trinsic/Trinsic.xml index 08143d807..2dff6aeb3 100644 --- a/dotnet/Trinsic/Trinsic.xml +++ b/dotnet/Trinsic/Trinsic.xml @@ -2499,7 +2499,7 @@ - Request to fetch member status in governance framework for a specific credential schema. + Request to fetch member status in Trust Registry for a specific credential schema. @@ -2611,7 +2611,7 @@ - Request to get a member of the governance framework + Request to get a member of the Trust Registry @@ -5712,7 +5712,7 @@ If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - governance framework. + Trust Registry. @@ -6036,7 +6036,7 @@ If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - governance framework. + Trust Registry. diff --git a/go/proto/services/trustregistry/v1/trustregistry/trust-registry.pb.go b/go/proto/services/trustregistry/v1/trustregistry/trust-registry.pb.go index a99fd932c..3a374b0df 100644 --- a/go/proto/services/trustregistry/v1/trustregistry/trust-registry.pb.go +++ b/go/proto/services/trustregistry/v1/trustregistry/trust-registry.pb.go @@ -389,7 +389,7 @@ func (*UnregisterMemberResponse) Descriptor() ([]byte, []int) { return file_services_trust_registry_v1_trust_registry_proto_rawDescGZIP(), []int{3} } -// Request to fetch member status in governance framework for a specific credential schema. +// Request to fetch member status in Trust Registry for a specific credential schema. type GetMemberAuthorizationStatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -754,7 +754,7 @@ func (x *AuthorizedMemberSchema) GetValidUntil() uint64 { return 0 } -// Request to get a member of the governance framework +// Request to get a member of the Trust Registry type GetMemberRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/go/proto/services/verifiablecredentials/v1/credential/verifiable-credentials.pb.go b/go/proto/services/verifiablecredentials/v1/credential/verifiable-credentials.pb.go index d03144266..3e0371e3f 100644 --- a/go/proto/services/verifiablecredentials/v1/credential/verifiable-credentials.pb.go +++ b/go/proto/services/verifiablecredentials/v1/credential/verifiable-credentials.pb.go @@ -95,7 +95,7 @@ type IssueFromTemplateRequest struct { // https://www.w3.org/TR/vc-data-model/#expiration ExpirationDate string `protobuf:"bytes,5,opt,name=expiration_date,json=expirationDate,proto3" json:"expiration_date,omitempty"` // If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - // governance framework. + // Trust Registry. IncludeGovernance bool `protobuf:"varint,6,opt,name=include_governance,json=includeGovernance,proto3" json:"include_governance,omitempty"` // The type of signature to use when signing the credential. Defaults to `EXPERIMENTAL`. SignatureType SignatureType `protobuf:"varint,7,opt,name=signature_type,json=signatureType,proto3,enum=services.verifiablecredentials.v1.SignatureType" json:"signature_type,omitempty"` @@ -1045,7 +1045,7 @@ type CreateCredentialOfferRequest struct { // the holder DID in the credential subject HolderBinding bool `protobuf:"varint,3,opt,name=holder_binding,json=holderBinding,proto3" json:"holder_binding,omitempty"` // If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - // governance framework. + // Trust Registry. IncludeGovernance bool `protobuf:"varint,4,opt,name=include_governance,json=includeGovernance,proto3" json:"include_governance,omitempty"` // If true, a short URL link will be generated that can be used to share the credential offer with the holder. // This link will point to the credential offer in the wallet app. diff --git a/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberAuthorizationStatusRequest.java b/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberAuthorizationStatusRequest.java index 4e21403c7..0cadeefae 100644 --- a/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberAuthorizationStatusRequest.java +++ b/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberAuthorizationStatusRequest.java @@ -7,7 +7,7 @@ * * *
- * Request to fetch member status in governance framework for a specific credential schema.
+ * Request to fetch member status in Trust Registry for a specific credential schema.
  * 
* * Protobuf type {@code services.trustregistry.v1.GetMemberAuthorizationStatusRequest} @@ -327,7 +327,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request to fetch member status in governance framework for a specific credential schema.
+   * Request to fetch member status in Trust Registry for a specific credential schema.
    * 
* * Protobuf type {@code services.trustregistry.v1.GetMemberAuthorizationStatusRequest} diff --git a/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberRequest.java b/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberRequest.java index 637ab960a..3afb8cc00 100644 --- a/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberRequest.java +++ b/java/src/main/java/trinsic/services/trustregistry/v1/GetMemberRequest.java @@ -7,7 +7,7 @@ * * *
- * Request to get a member of the governance framework
+ * Request to get a member of the Trust Registry
  * 
* * Protobuf type {@code services.trustregistry.v1.GetMemberRequest} @@ -512,7 +512,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request to get a member of the governance framework
+   * Request to get a member of the Trust Registry
    * 
* * Protobuf type {@code services.trustregistry.v1.GetMemberRequest} diff --git a/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequest.java b/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequest.java index aaab2d9cb..45e86c44e 100644 --- a/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequest.java +++ b/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequest.java @@ -172,7 +172,7 @@ public boolean getHolderBinding() { * *
    * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-   * governance framework.
+   * Trust Registry.
    * 
* * bool include_governance = 4; @@ -958,7 +958,7 @@ public Builder clearHolderBinding() { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 4; @@ -974,7 +974,7 @@ public boolean getIncludeGovernance() { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 4; @@ -993,7 +993,7 @@ public Builder setIncludeGovernance(boolean value) { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 4; diff --git a/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequestOrBuilder.java b/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequestOrBuilder.java index c97a324de..5a2d5d2b5 100644 --- a/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequestOrBuilder.java +++ b/java/src/main/java/trinsic/services/verifiablecredentials/v1/CreateCredentialOfferRequestOrBuilder.java @@ -79,7 +79,7 @@ public interface CreateCredentialOfferRequestOrBuilder * *
    * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-   * governance framework.
+   * Trust Registry.
    * 
* * bool include_governance = 4; diff --git a/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequest.java b/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequest.java index 961cec3c1..47d1ec5ab 100644 --- a/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequest.java +++ b/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequest.java @@ -235,7 +235,7 @@ public com.google.protobuf.ByteString getExpirationDateBytes() { * *
    * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-   * governance framework.
+   * Trust Registry.
    * 
* * bool include_governance = 6; @@ -1129,7 +1129,7 @@ public Builder setExpirationDateBytes(com.google.protobuf.ByteString value) { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 6; @@ -1145,7 +1145,7 @@ public boolean getIncludeGovernance() { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 6; @@ -1164,7 +1164,7 @@ public Builder setIncludeGovernance(boolean value) { * *
      * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-     * governance framework.
+     * Trust Registry.
      * 
* * bool include_governance = 6; diff --git a/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequestOrBuilder.java b/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequestOrBuilder.java index 76aaa8996..65b442043 100644 --- a/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequestOrBuilder.java +++ b/java/src/main/java/trinsic/services/verifiablecredentials/v1/IssueFromTemplateRequestOrBuilder.java @@ -109,7 +109,7 @@ public interface IssueFromTemplateRequestOrBuilder * *
    * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's
-   * governance framework.
+   * Trust Registry.
    * 
* * bool include_governance = 6; diff --git a/java/src/test/java/trinsic/VaccineDemo.java b/java/src/test/java/trinsic/VaccineDemo.java index e407b8297..b7d979091 100644 --- a/java/src/test/java/trinsic/VaccineDemo.java +++ b/java/src/test/java/trinsic/VaccineDemo.java @@ -117,13 +117,12 @@ public static void run() throws IOException, ExecutionException, InterruptedExce trinsic.shutdown(); } - private static String IssueCredential( - TrinsicService trinsicService, String templateId, String clinic) + private static String IssueCredential(TrinsicService trinsic, String templateId, String clinic) throws InvalidProtocolBufferException, ExecutionException, InterruptedException { // issueCredential() { // Set active profile to 'clinic' so we can issue credential signed // with the clinic's signing keys - trinsicService.setAuthToken(clinic); + trinsic.setAuthToken(clinic); // Prepare credential values var valuesMap = new HashMap(); @@ -137,7 +136,7 @@ private static String IssueCredential( // Issue credential var issueResponse = - trinsicService + trinsic .credential() .issueFromTemplate( IssueFromTemplateRequest.newBuilder() diff --git a/java/src/test/java/trinsic/VaccineDemoKt.kt b/java/src/test/java/trinsic/VaccineDemoKt.kt index 2d4a89316..49c4353ca 100644 --- a/java/src/test/java/trinsic/VaccineDemoKt.kt +++ b/java/src/test/java/trinsic/VaccineDemoKt.kt @@ -133,14 +133,14 @@ suspend fun runVaccineDemo() { @Throws( InvalidProtocolBufferException::class, ExecutionException::class, InterruptedException::class) private suspend fun issueCredential( - trinsicService: TrinsicServiceKt, + trinsic: TrinsicServiceKt, templateId: String, clinic: String ): String { // issueCredential() { // Set active profile to 'clinic' so we can issue credential signed // with the clinic's signing keys - trinsicService.setAuthToken(clinic) + trinsic.setAuthToken(clinic) // Prepare credential values val valuesMap = HashMap() @@ -154,7 +154,7 @@ private suspend fun issueCredential( // Issue credential val issueResponse = - trinsicService + trinsic .credential() .issueFromTemplate( IssueFromTemplateRequest.newBuilder() diff --git a/proto/services/trust-registry/v1/trust-registry.proto b/proto/services/trust-registry/v1/trust-registry.proto index b5c3237c1..df3cdf9ba 100644 --- a/proto/services/trust-registry/v1/trust-registry.proto +++ b/proto/services/trust-registry/v1/trust-registry.proto @@ -60,7 +60,7 @@ message UnregisterMemberRequest { // Response to `UnregisterMemberRequest` message UnregisterMemberResponse {} -// Request to fetch member status in governance framework for a specific credential schema. +// Request to fetch member status in Trust Registry for a specific credential schema. message GetMemberAuthorizationStatusRequest { // DID URI of member string did_uri = 1; @@ -115,7 +115,7 @@ message AuthorizedMemberSchema{ uint64 valid_until = 5; } -// Request to get a member of the governance framework +// Request to get a member of the Trust Registry message GetMemberRequest { oneof member { // DID URI of member to get diff --git a/proto/services/verifiable-credentials/v1/verifiable-credentials.proto b/proto/services/verifiable-credentials/v1/verifiable-credentials.proto index c1a946715..cdcfe65c0 100644 --- a/proto/services/verifiable-credentials/v1/verifiable-credentials.proto +++ b/proto/services/verifiable-credentials/v1/verifiable-credentials.proto @@ -33,7 +33,7 @@ message IssueFromTemplateRequest { string expiration_date = 5; // If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - // governance framework. + // Trust Registry. bool include_governance = 6; // The type of signature to use when signing the credential. Defaults to `EXPERIMENTAL`. @@ -231,7 +231,7 @@ message CreateCredentialOfferRequest{ // the holder DID in the credential subject bool holder_binding = 3; // If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - // governance framework. + // Trust Registry. bool include_governance = 4; // If true, a short URL link will be generated that can be used to share the credential offer with the holder. // This link will point to the credential offer in the wallet app. diff --git a/python/trinsic/proto/services/trustregistry/v1/__init__.py b/python/trinsic/proto/services/trustregistry/v1/__init__.py index 7483dfd02..cd124d3f3 100644 --- a/python/trinsic/proto/services/trustregistry/v1/__init__.py +++ b/python/trinsic/proto/services/trustregistry/v1/__init__.py @@ -104,8 +104,8 @@ class UnregisterMemberResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetMemberAuthorizationStatusRequest(betterproto.Message): """ - Request to fetch member status in governance framework for a specific - credential schema. + Request to fetch member status in Trust Registry for a specific credential + schema. """ did_uri: str = betterproto.string_field(1) @@ -174,7 +174,7 @@ class AuthorizedMemberSchema(betterproto.Message): @dataclass(eq=False, repr=False) class GetMemberRequest(betterproto.Message): - """Request to get a member of the governance framework""" + """Request to get a member of the Trust Registry""" did_uri: str = betterproto.string_field(1, group="member") """DID URI of member to get""" diff --git a/python/trinsic/proto/services/verifiablecredentials/v1/__init__.py b/python/trinsic/proto/services/verifiablecredentials/v1/__init__.py index 5562d3773..7e102ae08 100644 --- a/python/trinsic/proto/services/verifiablecredentials/v1/__init__.py +++ b/python/trinsic/proto/services/verifiablecredentials/v1/__init__.py @@ -72,7 +72,7 @@ class IssueFromTemplateRequest(betterproto.Message): include_governance: bool = betterproto.bool_field(6) """ If true, the issued credential will contain an attestation of the issuer's - membership in the ecosystem's governance framework. + membership in the ecosystem's Trust Registry. """ signature_type: "SignatureType" = betterproto.enum_field(7) @@ -286,7 +286,7 @@ class CreateCredentialOfferRequest(betterproto.Message): include_governance: bool = betterproto.bool_field(4) """ If true, the issued credential will contain an attestation of the issuer's - membership in the ecosystem's governance framework. + membership in the ecosystem's Trust Registry. """ generate_share_url: bool = betterproto.bool_field(5) diff --git a/samples/go/sample.go b/samples/go/sample.go index 90c5c621e..e509d9592 100644 --- a/samples/go/sample.go +++ b/samples/go/sample.go @@ -7,12 +7,12 @@ import ( ) func main() { - trinsicService, err := sdk.NewTrinsic() + trinsic, err := sdk.NewTrinsic() if err != nil { panic("Account service not created") } - profile, err := trinsicService.Account().LoginAnonymous(context.Background()) + profile, err := trinsic.Account().LoginAnonymous(context.Background()) if err != nil { panic("Sign in failed!") } diff --git a/samples/node/index.ts b/samples/node/index.ts index e4250f3d4..9b173361e 100644 --- a/samples/node/index.ts +++ b/samples/node/index.ts @@ -1,6 +1,6 @@ -import {CreateProofRequest, InsertItemRequest, TrinsicService, VerifyProofResponse} from '@trinsic/trinsic'; -import {resolve} from "path"; -import {readFileSync} from "fs"; +import { CreateProofRequest, InsertItemRequest, TrinsicService, VerifyProofResponse } from '@trinsic/trinsic'; +import { resolve } from "path"; +import { readFileSync } from "fs"; function vaccineCertFramePath(): string { return resolve( @@ -51,9 +51,9 @@ async function vaccineDemo(): Promise { const trinsic = new TrinsicService(); // Create 3 different profiles for each participant in the scenario - const allison = await trinsic.wallet().createWallet({ecosystemId: "default"}); - const clinic = await trinsic.wallet().createWallet({ecosystemId: "default"}); - const airline = await trinsic.wallet().createWallet({ecosystemId: "default"}); + const allison = await trinsic.wallet().createWallet({ ecosystemId: "default" }); + const clinic = await trinsic.wallet().createWallet({ ecosystemId: "default" }); + const airline = await trinsic.wallet().createWallet({ ecosystemId: "default" }); // @ts-ignore trinsic.options.authToken = clinic.authToken; @@ -62,12 +62,12 @@ async function vaccineDemo(): Promise { // Sign a credential as the clinic and send it to Allison const credentialJson = getVaccineCertUnsignedJSON() - const credential = await trinsic.credential().issue({documentJson: JSON.stringify(credentialJson)}); + const credential = await trinsic.credential().issue({ documentJson: JSON.stringify(credentialJson) }); - // Alice stores the credential in her cloud wallet. + // Allison stores the credential in her cloud wallet. // @ts-ignore trinsic.options.authToken = allison.authToken; - const itemId = await trinsic.wallet().insertItem(InsertItemRequest.fromPartial({itemJson: credential.signedDocumentJson})); + const itemId = await trinsic.wallet().insertItem(InsertItemRequest.fromPartial({ itemJson: credential.signedDocumentJson })); // Allison shares the credential with the venue. // The venue has communicated with Allison the details of the credential @@ -83,7 +83,7 @@ async function vaccineDemo(): Promise { // The trinsic verifies the credential // @ts-ignore trinsic.options.authToken = (airline); - return await trinsic.credential().verifyProof({proofDocumentJson: proof.proofDocumentJson}) + return await trinsic.credential().verifyProof({ proofDocumentJson: proof.proofDocumentJson }) } vaccineDemo().then(x => { diff --git a/web/src/proto/services/trust-registry/v1/trust-registry.ts b/web/src/proto/services/trust-registry/v1/trust-registry.ts index a10e4016d..e15326f0b 100644 --- a/web/src/proto/services/trust-registry/v1/trust-registry.ts +++ b/web/src/proto/services/trust-registry/v1/trust-registry.ts @@ -116,7 +116,7 @@ export interface UnregisterMemberRequest { export interface UnregisterMemberResponse { } -/** Request to fetch member status in governance framework for a specific credential schema. */ +/** Request to fetch member status in Trust Registry for a specific credential schema. */ export interface GetMemberAuthorizationStatusRequest { /** DID URI of member */ didUri?: @@ -168,7 +168,7 @@ export interface AuthorizedMemberSchema { validUntil?: number | undefined; } -/** Request to get a member of the governance framework */ +/** Request to get a member of the Trust Registry */ export interface GetMemberRequest { /** DID URI of member to get */ didUri?: diff --git a/web/src/proto/services/verifiable-credentials/v1/verifiable-credentials.ts b/web/src/proto/services/verifiable-credentials/v1/verifiable-credentials.ts index 11aec2df3..d90a010ef 100644 --- a/web/src/proto/services/verifiable-credentials/v1/verifiable-credentials.ts +++ b/web/src/proto/services/verifiable-credentials/v1/verifiable-credentials.ts @@ -80,7 +80,7 @@ export interface IssueFromTemplateRequest { | undefined; /** * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - * governance framework. + * Trust Registry. */ includeGovernance?: | boolean @@ -270,7 +270,7 @@ export interface CreateCredentialOfferRequest { | undefined; /** * If true, the issued credential will contain an attestation of the issuer's membership in the ecosystem's - * governance framework. + * Trust Registry. */ includeGovernance?: | boolean diff --git a/web/test/VaccineDemoShared.ts b/web/test/VaccineDemoShared.ts index f0a8ca766..077a267bf 100644 --- a/web/test/VaccineDemoShared.ts +++ b/web/test/VaccineDemoShared.ts @@ -70,7 +70,7 @@ export async function vaccineDemo() { // } // storeCredential() { - // Alice stores the credential in her cloud wallet. + // Allison stores the credential in her cloud wallet. trinsic.options.authToken = allison.authToken; const insertResponse = await trinsic.wallet().insertItem( InsertItemRequest.fromPartial({ @@ -103,7 +103,7 @@ export async function vaccineDemo() { } async function doTemplate( - trinsicService: TrinsicService, + trinsic: TrinsicService, ): Promise { // createTemplate() { //Define all fields @@ -139,7 +139,7 @@ async function doTemplate( }); //Create template - const response = await trinsicService.template().create(request); + const response = await trinsic.template().create(request); const template = response.data; // } diff --git a/web/test/WalletService.test.ts b/web/test/WalletService.test.ts index 760e83c78..e6aa3b785 100644 --- a/web/test/WalletService.test.ts +++ b/web/test/WalletService.test.ts @@ -1,11 +1,15 @@ import { + AcceptCredentialRequest, + CreateCredentialOfferRequest, CreateCredentialTemplateRequest, CreateCredentialTemplateResponse, CreateEcosystemRequest, CreateProofRequest, FieldType, InsertItemRequest, + RejectCredentialRequest, SearchRequest, + SignatureType, TemplateField, TrinsicService, } from "../src"; @@ -142,11 +146,13 @@ describe("WalletService Unit Tests", () => { // createProof() { let proof = await trinsic.credential().createProof( CreateProofRequest.fromPartial({ + documentJson: issueResponse.documentJson, itemId: insertItemResponse.itemId, }), ); let selectiveProof = await trinsic.credential().createProof( CreateProofRequest.fromPartial({ + documentJson: issueResponse.documentJson, itemId: insertItemResponse.itemId, revealTemplate: { templateAttributes: ["firstName", "lastName"], @@ -160,11 +166,11 @@ describe("WalletService Unit Tests", () => { let verifyResponse = await trinsic.credential().verifyProof({ proofDocumentJson: proof.proofDocumentJson, }); - // } let selectiveVerifyResponse = await trinsic.credential().verifyProof({ proofDocumentJson: selectiveProof.proofDocumentJson, }); + // } expect( verifyResponse.validationResults!["SignatureVerification"].isValid, @@ -184,6 +190,65 @@ describe("WalletService Unit Tests", () => { //} }); + it("Demo: create, accept and reject credential offer", async () => { + trinsic.options = clinic; + let values = JSON.stringify({ + firstName: "Jane", + lastName: "Doe", + age: 42, + }); + + const templateId = template!.data!.id; + + let issueResponse = await trinsic.credential().issueFromTemplate({ + templateId: templateId, + valuesJson: values, + }); + + expect(issueResponse).not.toBeNull(); + + //createCredentialOffer() { + let createCredentialOfferResponse = await trinsic.credential().createCredentialOffer( + CreateCredentialOfferRequest.fromPartial({ + templateId: templateId, + valuesJson: issueResponse.documentJson, + holderBinding: true, + includeGovernance: true, + generateShareUrl: true, + signatureType: SignatureType.EXPERIMENTAL, + }) + ); + //} + + //acceptCredential() { + let acceptCredentialResponse = await trinsic.credential().acceptCredential( + AcceptCredentialRequest.fromPartial({ + documentJson: createCredentialOfferResponse.documentJson, + }) + ); + //} + + //Create another credential offer so the next call can reject an existing offer + createCredentialOfferResponse = await trinsic.credential().createCredentialOffer( + CreateCredentialOfferRequest.fromPartial({ + templateId: templateId, + valuesJson: issueResponse.documentJson, + holderBinding: true, + includeGovernance: true, + generateShareUrl: true, + signatureType: SignatureType.EXPERIMENTAL, + }) + ); + + //rejectCredential() { + let rejectCredentialResponse = await trinsic.credential().rejectCredential( + RejectCredentialRequest.fromPartial({ + documentJson: createCredentialOfferResponse.documentJson, + }) + ); + //} + }); + it("Demo: template management and credential issuance from template", async () => { let response = await trinsic .wallet()