From ec2f8eb5236625af71fc62fe79ef56884178de22 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:14:48 +0200 Subject: [PATCH 1/4] feat: adding subject of the key hash --- integration/nevermined/NVMApiKey.test.ts | 1 - src/models/NvmApiKey.ts | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration/nevermined/NVMApiKey.test.ts b/integration/nevermined/NVMApiKey.test.ts index e47b11cce..25fb59315 100644 --- a/integration/nevermined/NVMApiKey.test.ts +++ b/integration/nevermined/NVMApiKey.test.ts @@ -245,7 +245,6 @@ describe('Nevermined API Key', () => { const publicKey = '0x04c19e8524f8080e0f9a5ef54c87b7596a2c93a992e986f713d02e091142d7d57f3094c34a265fc5dfd098e2143cb8eaf325e5621a7572ba00997654a19a819b35' // We should get the private key from the node (STAGING) - // const privateKey = '0x9bf5d7e4978ed5206f760e6daded34d657572bd49fa5b3fe885679329fb16b16' encryptedNvmApiKey = await NvmApiKey.generate( nvm.utils.signature, diff --git a/src/models/NvmApiKey.ts b/src/models/NvmApiKey.ts index 576c703dd..7159b4315 100644 --- a/src/models/NvmApiKey.ts +++ b/src/models/NvmApiKey.ts @@ -8,7 +8,7 @@ import { bytesToHex } from 'viem/utils' export class NvmApiKey implements JWTPayload { /** - * The public address of the account issuing the key + * The public address of the account issuing the key. */ iss: string @@ -18,7 +18,7 @@ export class NvmApiKey implements JWTPayload { aud: string /** - * The public address of the account the key is issued for. Typically the address of the Node/Backend who can process the key + * The public address of the account the key is issued for. */ sub: string @@ -199,11 +199,12 @@ export class NvmApiKey implements JWTPayload { * @returns a JWT string representing the hash of the NvmApiKey */ public async hashJWT(signatureUtils: SignatureUtils, issuerAccount: NvmAccount): Promise { - const address = getChecksumAddress(issuerAccount.getId()) + const issuerAddress = getChecksumAddress(issuerAccount.getId()) return new EthSignJWT({ - iss: address, - sub: this.hash(), + iss: issuerAddress, // the account generating the hash (node/provider, etc) is the issuer of the hash + sub: this.iss, // the issuer of the NVMApiKey (the user) is the subject of the hash + jti: this.hash(), exp: this.exp, }) .setProtectedHeader({ alg: 'ES256K' }) From 6f0e9f800bc795131ecfa42698ea646de0cddae5 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:16:19 +0200 Subject: [PATCH 2/4] chore: changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c78d98239..a797b6d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2319,7 +2319,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 2 May 2022 -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931) #### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21) @@ -2582,7 +2582,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 January 2022 -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c) @@ -3088,7 +3088,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268) - Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266) - integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264) -- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) +- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248) - Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244) - replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243) - fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246) @@ -3127,7 +3127,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191) - Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189) - Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187) -- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) +- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186) - [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183) - Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177) - Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184) From 54b577b42babbc824081a2ff720594725fd9d09f Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:21:34 +0200 Subject: [PATCH 3/4] chore: version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dca159f78..6a04cb639 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "3.0.37", + "version": "3.0.38", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 3d976fb8ace22f97be53820131d88630d38f87ff Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:34:54 +0200 Subject: [PATCH 4/4] chore: adding v3.0.38 Changelog updates --- CHANGELOG.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a797b6d90..acb6de7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v3.0.38](https://github.com/nevermined-io/sdk-js/compare/v3.0.37...v3.0.38) + +> 4 October 2024 + +- docs: updating documentation [skip actions] [`d9e752c`](https://github.com/nevermined-io/sdk-js/commit/d9e752cab1d68be36ce515713eb2c88382ce4132) +- Automated CHANGELOG.md update [`414db5f`](https://github.com/nevermined-io/sdk-js/commit/414db5fba135665acbeecfc29b3292c8e9044af7) +- feat: adding subject of the key hash [`ec2f8eb`](https://github.com/nevermined-io/sdk-js/commit/ec2f8eb5236625af71fc62fe79ef56884178de22) + #### [v3.0.37](https://github.com/nevermined-io/sdk-js/compare/v3.0.36...v3.0.37) > 2 October 2024 @@ -497,7 +505,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: wait tx for session keys an use bigint for blocknumbers in all the places [`a6188e7`](https://github.com/nevermined-io/sdk-js/commit/a6188e78eaeecb346ff0b067335c4c7783dfefb0) - chore: adding v3.0.0 Changelog updates [`bcc2d13`](https://github.com/nevermined-io/sdk-js/commit/bcc2d13c3da67cee187b2bb1b8e2c74ebec40bb4) -### [v3.0.0](https://github.com/nevermined-io/sdk-js/compare/v3.0.0-rc9...v3.0.0) +#### [v3.0.0](https://github.com/nevermined-io/sdk-js/compare/v3.0.0-rc9...v3.0.0) > 2 May 2024 @@ -984,7 +992,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: add as an option in the config [`6f610b4`](https://github.com/nevermined-io/sdk-js/commit/6f610b4d6372c0d0843b70083b7018708f5a948d) - chore: adding v2.0.0 Changelog updates [`4ddbf3d`](https://github.com/nevermined-io/sdk-js/commit/4ddbf3de548ed94c0a79341961693510151ce9bd) -### [v2.0.0](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc9...v2.0.0) +#### [v2.0.0](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc9...v2.0.0) > 20 October 2023 @@ -1580,7 +1588,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384) - linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4) -### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) +#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0) > 14 February 2023