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

chore: merge develop #512

Merged
merged 11 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-crabs-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/dapp': patch
---

Fixes issue with importing Polygon ID credentials.
8 changes: 6 additions & 2 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
"@blockchain-lab-um/masca-types": "1.2.0"
},
"changesets": [
"hungry-crabs-end",
"late-geckos-retire",
"modern-grapes-buy",
"purple-jokes-hunt",
"weak-frogs-occur"
"shy-seals-remember",
"tasty-eels-relax",
"weak-frogs-occur",
"wicked-socks-play"
]
}
}
5 changes: 5 additions & 0 deletions .changeset/shy-seals-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/did-provider-ebsi': patch
---

Correctly sets the privateKeyHex.
5 changes: 5 additions & 0 deletions .changeset/tasty-eels-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/masca': patch
---

Updates snap shasum.
5 changes: 5 additions & 0 deletions .changeset/wicked-socks-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/masca-connector': patch
---

Adds build for UMD.
6 changes: 6 additions & 0 deletions libs/did-provider-ebsi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.2.1-beta.0

### Patch Changes

- [#508](https://github.com/blockchain-lab-um/masca/pull/508) [`60c0e6e`](https://github.com/blockchain-lab-um/masca/commit/60c0e6eac0e09c199c9471de292cfb1426650ed7) Thanks [@pseudobun](https://github.com/pseudobun)! - Correctly sets the privateKeyHex.

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/did-provider-ebsi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockchain-lab-um/did-provider-ebsi",
"version": "1.2.0",
"version": "1.2.1-beta.0",
"private": false,
"description": "Veramo plugin that can enable creation and control of EBSI DIDs",
"keywords": [],
Expand Down
1 change: 1 addition & 0 deletions libs/did-provider-ebsi/src/ebsiDidProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export class EbsiDIDProvider extends AbstractIdentifierProvider {
y,
};
privateKeyJwk = { ...publicKeyJwk, d };
privateKeyHex = args.privateKeyHex;

jwkThumbprint = await jose.calculateJwkThumbprint(
privateKeyJwk,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@typescript-eslint/parser": "^6.3.0",
"concurrently": "^8.2.0",
"cross-env": "^7.0.3",
"eslint": "^8.46.0",
"eslint": "^8.51.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "^9.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/connector/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bundle/
6 changes: 6 additions & 0 deletions packages/connector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.2.1-beta.0

### Patch Changes

- [#504](https://github.com/blockchain-lab-um/masca/pull/504) [`54efbd0`](https://github.com/blockchain-lab-um/masca/commit/54efbd0f7777a172e879228a6da134c6cc0b3b33) Thanks [@pseudobun](https://github.com/pseudobun)! - Adds build for UMD.

## 1.2.0

### Minor Changes
Expand Down
7 changes: 5 additions & 2 deletions packages/connector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockchain-lab-um/masca-connector",
"version": "1.2.0",
"version": "1.2.1-beta.0",
"description": "Library for using Masca on the frontend",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -32,6 +32,7 @@
],
"scripts": {
"build": "pnpm clean && pnpm compile",
"bundle": "webpack",
"clean": "rimraf dist",
"compile": "tsup",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
Expand All @@ -50,7 +51,9 @@
"eip-712-types-generation": "^0.1.6"
},
"devDependencies": {
"tsup": "^7.2.0"
"esbuild-loader": "^4.0.2",
"tsup": "^7.2.0",
"webpack-cli": "^5.1.4"
},
"publishConfig": {
"access": "public"
Expand Down
38 changes: 38 additions & 0 deletions packages/connector/webpack.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import path from 'path';
import { fileURLToPath } from 'url';

// eslint-disable-next-line @typescript-eslint/naming-convention
const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.[jt]sx?$/,
loader: 'esbuild-loader',
exclude: /node_modules/,
options: {
tsconfig: './tsconfig.json',
loader: 'ts',
target: 'es2020',
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
extensionAlias: {
'.js': ['.js', '.ts'],
},
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'bundle'),
globalObject: 'this',
library: {
name: 'webpackNumbers',
type: 'umd',
},
},
};
13 changes: 13 additions & 0 deletions packages/dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @blockchain-lab-um/dapp

## 1.1.1-beta.1

### Patch Changes

- [#507](https://github.com/blockchain-lab-um/masca/pull/507) [`0f322c5`](https://github.com/blockchain-lab-um/masca/commit/0f322c5b4eb3884cf7ea2363860db053332b4649) Thanks [@martines3000](https://github.com/martines3000)! - Fixes issue with importing Polygon ID credentials.

## 1.1.1-beta.0

### Patch Changes

- Updated dependencies [[`54efbd0`](https://github.com/blockchain-lab-um/masca/commit/54efbd0f7777a172e879228a6da134c6cc0b3b33)]:
- @blockchain-lab-um/masca-connector@1.2.1-beta.0

## 1.1.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockchain-lab-um/dapp",
"version": "1.1.0",
"version": "1.1.1-beta.1",
"private": true,
"license": "(Apache-2.0 AND MIT)",
"type": "commonjs",
Expand All @@ -20,7 +20,7 @@
"start": "next start"
},
"dependencies": {
"@blockchain-lab-um/masca-connector": "1.2.0",
"@blockchain-lab-um/masca-connector": "1.2.1-beta.0",
"@blockchain-lab-um/oidc-types": "0.0.8",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
Expand Down Expand Up @@ -62,7 +62,7 @@
"@types/react-dom": "18.2.7",
"autoprefixer": "^10.4.15",
"eslint-config-next": "^13.5.1",
"postcss": "^8.4.30",
"postcss": "^8.4.31",
"prisma": "^5.3.1",
"sass": "^1.67.0",
"stylelint": "^15.10.3",
Expand Down
33 changes: 27 additions & 6 deletions packages/dapp/src/components/Controlbar/Controlbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ const Controlbar = () => {
});

if (isError(res)) {
console.log('error', res);
setTimeout(() => {
useToastStore.setState({
open: true,
title: res.error,
type: 'error',
loading: false,
link: null,
});
}, 200);
return false;
}

Expand All @@ -112,14 +120,27 @@ const Controlbar = () => {
} as QueryCredentialsRequestResult;
newVcs.push(finalVC);
});
changeVcs(
[...vcs, ...newVcs].map((modifyVC) =>
stringifyCredentialSubject(modifyVC)
)
);

setTimeout(() => {
useToastStore.setState({
open: true,
title: t('save-success'),
type: 'success',
loading: false,
link: null,
});
}, 200);
const queryResult = await api.queryCredentials();
if (isError(queryResult)) {
setTimeout(() => {
useToastStore.setState({
open: true,
title: t('query-error'),
type: 'error',
loading: false,
link: null,
});
}, 200);
return false;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/dapp/src/components/ImportModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';
import {
isVerifiableCredential,
isW3CCredential,
isW3CVerifiableCredential,
type AvailableCredentialStores,
} from '@blockchain-lab-um/masca-connector';
import { Dialog } from '@headlessui/react';
Expand Down Expand Up @@ -41,10 +42,9 @@ function ImportModal({ isOpen, setOpen, importVC }: ImportModalProps) {

const validateAndImportCredential = async (): Promise<void> => {
setLoading(true);

let vcObj: W3CVerifiableCredential;
let vcObj: any;
try {
vcObj = JSON.parse(vc) as W3CVerifiableCredential;
vcObj = JSON.parse(vc);
} catch (err) {
try {
vcObj = normalizeCredential(vc) as W3CVerifiableCredential;
Expand All @@ -64,7 +64,7 @@ function ImportModal({ isOpen, setOpen, importVC }: ImportModalProps) {
}
}

if (!isVerifiableCredential(vcObj)) {
if (!isW3CVerifiableCredential(vcObj) && !isW3CCredential(vcObj)) {
setTimeout(() => {
useToastStore.setState({
open: true,
Expand Down
4 changes: 3 additions & 1 deletion packages/dapp/src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
"query": "Querying credentials",
"query-error": "Failed to query credentials",
"query-success": "Successfully queried credentials",
"save-error": "Failed to save credential. VC was invalid"
"save-error": "Failed to save credential. VC was invalid",
"save-error-title": "Failed to save credential",
"save-success": "Successfully saved credential"
},
"CreateConnectionModal": {
"desc": " Scan this QR code with your mobile device to create a connection to this page.",
Expand Down
10 changes: 5 additions & 5 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
"@emotion/styled": "^11.11.0",
"@mdx-js/react": "1.6.22",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.0.6",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.1",
"@docusaurus/plugin-content-docs": "^2.4.1",
"@docusaurus/types": "^2.4.1",
"@docusaurus/module-type-aliases": "^2.4.3",
"@docusaurus/plugin-content-docs": "^2.4.3",
"@docusaurus/types": "^2.4.3",
"@tsconfig/docusaurus": "^1.0.7",
"@types/react": "18.2.19",
"precompress": "^11.2.2",
"stylelint": "^15.10.2",
"stylelint": "^15.11.0",
"stylelint-config-css-modules": "^4.3.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^34.0.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/snap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.0-beta.2

### Patch Changes

- [#509](https://github.com/blockchain-lab-um/masca/pull/509) [`0caf964`](https://github.com/blockchain-lab-um/masca/commit/0caf96495c05236aaf0aabc2b8abe19b09ad1607) Thanks [@pseudobun](https://github.com/pseudobun)! - Updates snap shasum.

## 1.1.0-beta.1

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockchain-lab-um/masca",
"version": "1.1.0-beta.1",
"version": "1.1.0-beta.2",
"description": "Snap for managing VCs and VPs in MetaMask",
"keywords": [
"MetaMask",
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0-beta.1",
"version": "1.1.0-beta.2",
"description": "Snap for managing VCs and VPs in MetaMask",
"proposedName": "Masca",
"repository": {
Expand All @@ -15,7 +15,7 @@
"registry": "https://registry.npmjs.org"
}
},
"shasum": "CfbR75Rq/tHjBxu7c22DYXHSlP9D4k7n/Uvc9EWn7HA="
"shasum": "3Ad2GjuhlL4oRdOlzn/pVFlPxgHYIdeZZUuhEdqeqsY="
},
"initialPermissions": {
"endowment:ethereum-provider": {},
Expand Down
Loading