From bbc119d8464ffa94a97e97b07e8189ddd56fd4f0 Mon Sep 17 00:00:00 2001 From: IvanMahda Date: Thu, 12 Sep 2024 15:35:11 +0300 Subject: [PATCH 1/5] [BRO-48] Enable ZK proof generations with new company identities Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` --- packages/sdk/CHANGELOG.md | 1 + packages/sdk/src/web3-id/types.ts | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 3f426dae5..0ae56e7a7 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Add `legalCountry` as an allowed attribute for set/not-set membership proofs. +- added `AttributeKey` check for `IDENTITY_SUBJECT_SCHEMA`. Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` ## 8.0.1 diff --git a/packages/sdk/src/web3-id/types.ts b/packages/sdk/src/web3-id/types.ts index 248faa470..81527cc39 100644 --- a/packages/sdk/src/web3-id/types.ts +++ b/packages/sdk/src/web3-id/types.ts @@ -87,7 +87,7 @@ type CredentialSchemaAttributes = { title?: string; description?: string; type: 'object'; - properties: Record; + properties: Record; required: string[]; }; @@ -163,6 +163,26 @@ export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = { title: 'Tax ID Number', type: 'string', }, + lei: { + title: 'Legal Entity Identifier (LEI)', + type: 'string' + }, + legalName: { + title: 'Legal Name', + type: 'string', + }, + legalCountry: { + title: 'Legal Country', + type: 'string', + }, + businessNumber: { + title: 'Business Number', + type: 'string', + }, + registrationAuth: { + title: 'Registration Authority', + type: 'string', + } }, required: [], }, From d45077bb85c958de5414418a10a495f0230c04f7 Mon Sep 17 00:00:00 2001 From: IvanMahda Date: Thu, 12 Sep 2024 15:40:13 +0300 Subject: [PATCH 2/5] [BRO-48] Enable ZK proof generations with new company identities Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` --- packages/sdk/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 0ae56e7a7..5e41ce2c5 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -5,7 +5,7 @@ ### Added - Add `legalCountry` as an allowed attribute for set/not-set membership proofs. -- added `AttributeKey` check for `IDENTITY_SUBJECT_SCHEMA`. Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` +- Added `AttributeKey` check for `IDENTITY_SUBJECT_SCHEMA`. Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` ## 8.0.1 From c042332b0fc33f4a4c117a0289dff0363e68ac49 Mon Sep 17 00:00:00 2001 From: IvanMahda Date: Thu, 12 Sep 2024 17:02:26 +0300 Subject: [PATCH 3/5] [BRO-48] Enable ZK proof generations with new company identities Created additional type for IDENTITY_SUBJECT_SCHEMA --- packages/sdk/src/web3-id/types.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/sdk/src/web3-id/types.ts b/packages/sdk/src/web3-id/types.ts index 81527cc39..463b85cec 100644 --- a/packages/sdk/src/web3-id/types.ts +++ b/packages/sdk/src/web3-id/types.ts @@ -87,7 +87,7 @@ type CredentialSchemaAttributes = { title?: string; description?: string; type: 'object'; - properties: Record; + properties: Record; required: string[]; }; @@ -100,7 +100,22 @@ export type CredentialSchemaSubject = { required: string[]; }; -export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = { +type Override = Omit & NewType; + +type IdCredentialSchemaSubject = Override< + CredentialSchemaSubject, + { + properties: { + id: IdDetails; + attributes: Override< + CredentialSchemaAttributes, + { properties: Record } + >; + }; + } +>; + +export const IDENTITY_SUBJECT_SCHEMA: IdCredentialSchemaSubject = { type: 'object', properties: { id: { @@ -165,7 +180,7 @@ export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = { }, lei: { title: 'Legal Entity Identifier (LEI)', - type: 'string' + type: 'string', }, legalName: { title: 'Legal Name', @@ -182,7 +197,7 @@ export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = { registrationAuth: { title: 'Registration Authority', type: 'string', - } + }, }, required: [], }, From 1bca707f3bf8a8de68125339a81b40c914cbdd5a Mon Sep 17 00:00:00 2001 From: IvanMahda Date: Thu, 12 Sep 2024 17:04:35 +0300 Subject: [PATCH 4/5] [BRO-48] Enable ZK proof generations with new company identities --- packages/sdk/CHANGELOG.md | 2 +- packages/sdk/src/web3-id/types.ts | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 5e41ce2c5..c91b08857 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -5,7 +5,7 @@ ### Added - Add `legalCountry` as an allowed attribute for set/not-set membership proofs. -- Added `AttributeKey` check for `IDENTITY_SUBJECT_SCHEMA`. Implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` +- `IDENTITY_SUBJECT_SCHEMA` implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` ## 8.0.1 diff --git a/packages/sdk/src/web3-id/types.ts b/packages/sdk/src/web3-id/types.ts index 463b85cec..a6a057180 100644 --- a/packages/sdk/src/web3-id/types.ts +++ b/packages/sdk/src/web3-id/types.ts @@ -100,22 +100,7 @@ export type CredentialSchemaSubject = { required: string[]; }; -type Override = Omit & NewType; - -type IdCredentialSchemaSubject = Override< - CredentialSchemaSubject, - { - properties: { - id: IdDetails; - attributes: Override< - CredentialSchemaAttributes, - { properties: Record } - >; - }; - } ->; - -export const IDENTITY_SUBJECT_SCHEMA: IdCredentialSchemaSubject = { +export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = { type: 'object', properties: { id: { From 29958bda4ed4446e4de770614956be9fe7433d3e Mon Sep 17 00:00:00 2001 From: Ivan-Mahda <164325149+Ivan-Mahda@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:53:05 +0300 Subject: [PATCH 5/5] Update packages/sdk/CHANGELOG.md Co-authored-by: Doris Benda --- packages/sdk/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index c91b08857..6ea53dc40 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -5,7 +5,7 @@ ### Added - Add `legalCountry` as an allowed attribute for set/not-set membership proofs. -- `IDENTITY_SUBJECT_SCHEMA` implemented missed attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, `registrationAuth` +- Add attributes `lei`, `legalName`, `legalCountry`, `businessNumber`, and `registrationAuth` to `IDENTITY_SUBJECT_SCHEMA`. ## 8.0.1