Skip to content
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

fix: add reference app + mediator live mode #177

Merged
merged 8 commits into from
Feb 27, 2024

Conversation

elribonazo
Copy link
Contributor

@elribonazo elribonazo commented Feb 27, 2024

Description

This pull request contains the reference app implementation and ws support for the pickup protocol and the mediator.
The 4 demos that we have have been updated to test and validate that it works, + some additional tests e2e tests ran confirming that WS are in use and indeed working.

Jira link

ATL-6571 and ATL-5960

Checklist

  • Self-reviewed the diff
  • New code has inline documentation
  • New code has proper comments/tests
  • Any changes not covered by tests have been tested manually

@elribonazo elribonazo force-pushed the features/reference-implementation branch from 415ebf6 to ae281e4 Compare February 27, 2024 09:28
@elribonazo elribonazo changed the title Features/reference implementation fix: add reference app + mediator live mode Feb 27, 2024
Copy link

# npm audit report

ip  2.0.0
Severity: moderate
NPM IP package incorrectly identifies some private IP addresses as public - https://github.com/advisories/GHSA-78xj-cgh5-2h22
fix available via `npm audit fix`
node_modules/npm/node_modules/ip

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

1 similar comment
Copy link

# npm audit report

ip  2.0.0
Severity: moderate
NPM IP package incorrectly identifies some private IP addresses as public - https://github.com/advisories/GHSA-78xj-cgh5-2h22
fix available via `npm audit fix`
node_modules/npm/node_modules/ip

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Copy link

Lines Statements Branches Functions
Coverage: 61%
61.47% (1270/2066) 50.4% (560/1111) 63.48% (372/586)

JUnit

Tests Skipped Failures Errors Time
337 2 💤 0 ❌ 0 🔥 39.235s ⏱️

@elribonazo elribonazo merged commit 86dece4 into master Feb 27, 2024
4 checks passed
@elribonazo elribonazo deleted the features/reference-implementation branch February 27, 2024 11:23
"jose": "^4.12.2",
"jsonwebtoken": "^9.0.0",
"multiformats": "^9.9.0",
"socket.io-client": "^4.7.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't appear to be used?

Comment on lines +139 to +151
if (!did) {
return true;
}
if (!did?.method || !did.methodId || !did.schema || !did.toString) {
return true;
}
if (typeof did.method !== "string" || typeof did.methodId !== "string" || typeof did.schema !== "string") {
return true;
}
if (typeof did.toString !== "function") {
return true;
}
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks odd, why is all this extra logic needed? shouldn't this all be asserted from a Domain.DID?

elribonazo added a commit that referenced this pull request Feb 27, 2024
Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
Co-authored-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
atala-dev added a commit that referenced this pull request Feb 28, 2024
# [5.0.0](v4.0.0...v5.0.0) (2024-02-28)

### Bug Fixes

* add reference app + mediator live mode ([#177](#177)) ([6ebf48a](6ebf48a))
* e2e tests improvement ([#178](#178)) ([eb6a5ab](eb6a5ab))
* key's id name according to the DID Peer new specs [#126](#126) ([#148](#148)) ([a851b69](a851b69))
* Manually generating the missing changelog and breaking changes b… ([#167](#167)) ([24ecc04](24ecc04))
* Recover JTI field correctly. Allowing to regenerate the original JWT string ([#171](#171)) ([913f3fa](913f3fa))

* feat!: Implementing Pluto Repositories (#160) ([ce7669f](ce7669f)), closes [#160](#160)

### BREAKING CHANGES

* - Domain.Credential now has uuid (string) as an optional attribute in the class
- Change StorePrismDID Function parameters, removing keyPathIndex and privateKeyMetadataId which were not in use
- Small change in the getCredentialMetadata and getLinkSecret to return null when not found
- Change Pluto interface to use CredentialMetadata class VS what it was using before.
- Change Pluto interface, storeMediator now accepts a Mediator class and not 3 attributes, mediator, host and routing
- Rename storePrivateKeys to storePrivateKey
- Change Pluto interface, using Domain.PrismDID instead of Domain.PrismDID which is being removed
- Added new properties to handle Anoncreds credentials properties.
- Re-implemented Pluto which is now available again to all the users.

import SDK from "@atala/prism-wallet-sdk";
import IndexDB from "@pluto-encrypted/indexdb";

const store = new SDK.Store({
name: "test",
storage: IndexDB,
password: Buffer.from("demoapp").toString("hex")
});
const pluto = new SDK.Pluto(store, apollo);

Migrations, schemas, queries and error handling have been moved to the SDK again but user's which were using the existing storages can just pass the indexDB pluto-encrypted storage and it will integrate with the new db schemas, migrations, etc
elribonazo added a commit that referenced this pull request May 2, 2024
Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
Co-authored-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
elribonazo pushed a commit that referenced this pull request May 2, 2024
# [5.0.0](v4.0.0...v5.0.0) (2024-02-28)

### Bug Fixes

* add reference app + mediator live mode ([#177](#177)) ([6ebf48a](6ebf48a))
* e2e tests improvement ([#178](#178)) ([eb6a5ab](eb6a5ab))
* key's id name according to the DID Peer new specs [#126](#126) ([#148](#148)) ([a851b69](a851b69))
* Manually generating the missing changelog and breaking changes b… ([#167](#167)) ([24ecc04](24ecc04))
* Recover JTI field correctly. Allowing to regenerate the original JWT string ([#171](#171)) ([913f3fa](913f3fa))

* feat!: Implementing Pluto Repositories (#160) ([ce7669f](ce7669f)), closes [#160](#160)

### BREAKING CHANGES

* - Domain.Credential now has uuid (string) as an optional attribute in the class
- Change StorePrismDID Function parameters, removing keyPathIndex and privateKeyMetadataId which were not in use
- Small change in the getCredentialMetadata and getLinkSecret to return null when not found
- Change Pluto interface to use CredentialMetadata class VS what it was using before.
- Change Pluto interface, storeMediator now accepts a Mediator class and not 3 attributes, mediator, host and routing
- Rename storePrivateKeys to storePrivateKey
- Change Pluto interface, using Domain.PrismDID instead of Domain.PrismDID which is being removed
- Added new properties to handle Anoncreds credentials properties.
- Re-implemented Pluto which is now available again to all the users.

import SDK from "@atala/prism-wallet-sdk";
import IndexDB from "@pluto-encrypted/indexdb";

const store = new SDK.Store({
name: "test",
storage: IndexDB,
password: Buffer.from("demoapp").toString("hex")
});
const pluto = new SDK.Pluto(store, apollo);

Migrations, schemas, queries and error handling have been moved to the SDK again but user's which were using the existing storages can just pass the indexDB pluto-encrypted storage and it will integrate with the new db schemas, migrations, etc
elribonazo added a commit that referenced this pull request May 2, 2024
Signed-off-by: Francisco Javier Ribó Labrador <elribonazo@gmail.com>
elribonazo added a commit that referenced this pull request May 2, 2024
Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
Co-authored-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
elribonazo pushed a commit that referenced this pull request May 2, 2024
# [5.0.0](v4.0.0...v5.0.0) (2024-02-28)

### Bug Fixes

* add reference app + mediator live mode ([#177](#177)) ([6ebf48a](6ebf48a))
* e2e tests improvement ([#178](#178)) ([eb6a5ab](eb6a5ab))
* key's id name according to the DID Peer new specs [#126](#126) ([#148](#148)) ([a851b69](a851b69))
* Manually generating the missing changelog and breaking changes b… ([#167](#167)) ([24ecc04](24ecc04))
* Recover JTI field correctly. Allowing to regenerate the original JWT string ([#171](#171)) ([913f3fa](913f3fa))

* feat!: Implementing Pluto Repositories (#160) ([ce7669f](ce7669f)), closes [#160](#160)

### BREAKING CHANGES

* - Domain.Credential now has uuid (string) as an optional attribute in the class
- Change StorePrismDID Function parameters, removing keyPathIndex and privateKeyMetadataId which were not in use
- Small change in the getCredentialMetadata and getLinkSecret to return null when not found
- Change Pluto interface to use CredentialMetadata class VS what it was using before.
- Change Pluto interface, storeMediator now accepts a Mediator class and not 3 attributes, mediator, host and routing
- Rename storePrivateKeys to storePrivateKey
- Change Pluto interface, using Domain.PrismDID instead of Domain.PrismDID which is being removed
- Added new properties to handle Anoncreds credentials properties.
- Re-implemented Pluto which is now available again to all the users.

import SDK from "@atala/prism-wallet-sdk";
import IndexDB from "@pluto-encrypted/indexdb";

const store = new SDK.Store({
name: "test",
storage: IndexDB,
password: Buffer.from("demoapp").toString("hex")
});
const pluto = new SDK.Pluto(store, apollo);

Migrations, schemas, queries and error handling have been moved to the SDK again but user's which were using the existing storages can just pass the indexDB pluto-encrypted storage and it will integrate with the new db schemas, migrations, etc
elribonazo added a commit that referenced this pull request May 3, 2024
Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
Co-authored-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
elribonazo pushed a commit that referenced this pull request May 3, 2024
# [5.0.0](v4.0.0...v5.0.0) (2024-02-28)

### Bug Fixes

* add reference app + mediator live mode ([#177](#177)) ([6ebf48a](6ebf48a))
* e2e tests improvement ([#178](#178)) ([eb6a5ab](eb6a5ab))
* key's id name according to the DID Peer new specs [#126](#126) ([#148](#148)) ([a851b69](a851b69))
* Manually generating the missing changelog and breaking changes b… ([#167](#167)) ([24ecc04](24ecc04))
* Recover JTI field correctly. Allowing to regenerate the original JWT string ([#171](#171)) ([913f3fa](913f3fa))

* feat!: Implementing Pluto Repositories (#160) ([ce7669f](ce7669f)), closes [#160](#160)

### BREAKING CHANGES

* - Domain.Credential now has uuid (string) as an optional attribute in the class
- Change StorePrismDID Function parameters, removing keyPathIndex and privateKeyMetadataId which were not in use
- Small change in the getCredentialMetadata and getLinkSecret to return null when not found
- Change Pluto interface to use CredentialMetadata class VS what it was using before.
- Change Pluto interface, storeMediator now accepts a Mediator class and not 3 attributes, mediator, host and routing
- Rename storePrivateKeys to storePrivateKey
- Change Pluto interface, using Domain.PrismDID instead of Domain.PrismDID which is being removed
- Added new properties to handle Anoncreds credentials properties.
- Re-implemented Pluto which is now available again to all the users.

import SDK from "@atala/prism-wallet-sdk";
import IndexDB from "@pluto-encrypted/indexdb";

const store = new SDK.Store({
name: "test",
storage: IndexDB,
password: Buffer.from("demoapp").toString("hex")
});
const pluto = new SDK.Pluto(store, apollo);

Migrations, schemas, queries and error handling have been moved to the SDK again but user's which were using the existing storages can just pass the indexDB pluto-encrypted storage and it will integrate with the new db schemas, migrations, etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants