Skip to content

Commit

Permalink
Merge pull request #1 from cre8/unstable
Browse files Browse the repository at this point in the history
Unstable
  • Loading branch information
cre8 authored Feb 21, 2024
2 parents b259b86 + 0bcd37c commit 66dc2a2
Show file tree
Hide file tree
Showing 57 changed files with 271 additions and 175 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build-test-publish-on-push-cached.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cache: 'pnpm'
- name: 'Run node'
run: pnpm test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-artifacts
path: coverage/
Expand All @@ -73,7 +73,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-artifacts
path: coverage
Expand Down Expand Up @@ -116,18 +116,18 @@ jobs:
- test
# - lint
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GH_TOKEN: ${{secrets.GH_TOKEN}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
GH_USER: ${{secrets.GH_USER}}
GH_EMAIL: ${{secrets.GH_EMAIL}}
NPM_TOKEN: ${{secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN }}
GH_TOKEN: ${{secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
GH_USER: github-actions
GH_EMAIL: [email protected]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{secrets.GH_TOKEN}}
token: ${{secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v3
with:
version: 8
Expand All @@ -148,16 +148,16 @@ jobs:

- name: 'Setup git coordinates'
run: |
git remote set-url origin https://${{secrets.GH_USER}}:${{secrets.GH_TOKEN}}@github.com/${{ github.repository }}.git
git remote set-url origin https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{ github.repository }}.git
git config user.name $GH_USER
git config user.email $GH_EMAIL
- name: 'Setup npm registry'
run: |
echo "@veramo:registry=https://registry.npmjs.org/" > .npmrc
echo "@bcrl:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
# npm whoami

- name: 'Publish @latest when on main'
if: github.ref == 'refs/heads/main'
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.1.0](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.1...v2.1.0) (2024-02-21)


### Bug Fixes

* add correct urls ([edb6bbb](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/edb6bbb0cd73c4b0ec6d650af12b31dadd1b5142))
* test ci ([9940152](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/9940152227b384baff0a0db9448adf5555a887d9))
* the bytes of the output of the hash function must be base64url-encoded. ([#57](https://github.com/openwallet-foundation-labs/sd-jwt-js/issues/57)) ([025786b](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/025786bd76415195e5daff0c5f2270ece31bd963))


### Features

* Apply lerna to move src to core ([#67](https://github.com/openwallet-foundation-labs/sd-jwt-js/issues/67)) ([c4d555c](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/c4d555c3ca61e83eb4703cd8cda75a9c261e2915))
* use tsup as a bundler ([#62](https://github.com/openwallet-foundation-labs/sd-jwt-js/issues/62)) ([e1ae323](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/e1ae323023031e3defea20ec8ce9c56c2f1a7ea6))






## [2.0.3](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.2...v2.0.3) (2024-02-20)


Expand Down
4 changes: 2 additions & 2 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

| Maintainer | GitHub ID | LFID | Email | Chat ID | Company Affiliation | Scope |
| ----------------- | ---------------- | --------- | --------------------- | ----------- | ------------------- | --------- |
| Ace | pensivej | - | Ace@hopae.io | Ace | Hopae Inc. | sd-jwt-js |
| Gavin | zustkeeper | - | Gavin@hopae.io | Gavin | Hopae Inc. | sd-jwt-js |
| Ace | pensivej | - | Ace@bcrl.io | Ace | Hopae Inc. | sd-jwt-js |
| Gavin | zustkeeper | - | Gavin@bcrl.io | Gavin | Hopae Inc. | sd-jwt-js |
| Lukas | lukasjhan | Lukas.Han | [email protected] | lukas.j.han | Hopae Inc. | sd-jwt-js |
| Berend Sliedrecht | berendsliedrecht | beri14 | [email protected] | - | Animo Solutions | sd-jwt-js |

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ By adhering to these design principles, "Selective Disclosure for JWT" aims to s
To install this project, run the following command:

```bash
npm install @hopae/sd-jwt
npm install @bcrl/sd-jwt
```

Ensure you have Node.js installed as a prerequisite.
Expand All @@ -53,7 +53,7 @@ Ensure you have Node.js installed as a prerequisite.
Here's a basic example of how to use this library:

```jsx
import sdjwt, { DisclosureFrame } from '@hopae/sd-jwt';
import sdjwt, { DisclosureFrame } from '@bcrl/sd-jwt';

// Issuer defines the claims object with the user's information
const claims = {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2 class="text-2xl font-bold mb-4">Installation</h2>
</p>
<p class="mb-4">
<div class="bg-gray-800 text-blue-200 font-mono text-sm p-4 rounded-lg overflow-x-auto my-6">
<pre>$ npm install @hopae/sd-jwt</pre>
<pre>$ npm install @bcrl/sd-jwt</pre>
</div>
</p>
<div class="flex justify-center items-center gap-4 pb-6">
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/all.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/basic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/custom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/custom_header.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/core-example/decode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/decoy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/kb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/core-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@hopae/sd-jwt-core": "workspace:*",
"@hopae/sd-jwt-type": "workspace:*"
"@bcrl/sd-jwt-core": "workspace:*",
"@bcrl/sd-jwt-type": "workspace:*"
}
}
4 changes: 2 additions & 2 deletions examples/core-example/sdjwtobject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SDJwtInstance } from '@hopae/sd-jwt-core';
import { DisclosureFrame } from '@hopae/sd-jwt-type';
import { SDJwtInstance } from '@bcrl/sd-jwt-core';
import { DisclosureFrame } from '@bcrl/sd-jwt-type';
import { createSignerVerifier, digest, generateSalt } from './utils';

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/core-example/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Crypto from 'crypto';
import { Signer, Verifier } from '@hopae/sd-jwt-type';
import { Signer, Verifier } from '@bcrl/sd-jwt-type';

export const createSignerVerifier = () => {
const { privateKey, publicKey } = Crypto.generateKeyPairSync('ed25519');
Expand Down
4 changes: 2 additions & 2 deletions examples/decode-example/decode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { decodeSdJwt, getClaims } from '@hopae/sd-jwt-decode';
import { digest } from '@hopae/sd-jwt-node-crypto';
import { decodeSdJwt, getClaims } from '@bcrl/sd-jwt-decode';
import { digest } from '@bcrl/sd-jwt-node-crypto';

(async () => {
const sdjwt =
Expand Down
6 changes: 3 additions & 3 deletions examples/decode-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@hopae/sd-jwt-decode": "workspace:*",
"@hopae/sd-jwt-type": "workspace:*",
"@hopae/sd-jwt-node-crypto": "workspace:*"
"@bcrl/sd-jwt-decode": "workspace:*",
"@bcrl/sd-jwt-type": "workspace:*",
"@bcrl/sd-jwt-node-crypto": "workspace:*"
}
}
8 changes: 4 additions & 4 deletions examples/present-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@hopae/sd-jwt-present": "workspace:*",
"@hopae/sd-jwt-decode": "workspace:*",
"@hopae/sd-jwt-type": "workspace:*",
"@hopae/sd-jwt-node-crypto": "workspace:*"
"@bcrl/sd-jwt-present": "workspace:*",
"@bcrl/sd-jwt-decode": "workspace:*",
"@bcrl/sd-jwt-type": "workspace:*",
"@bcrl/sd-jwt-node-crypto": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions examples/present-example/present.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { present, presentableKeys } from '@hopae/sd-jwt-present';
import { decodeSdJwt, getClaims } from '@hopae/sd-jwt-decode';
import { digest } from '@hopae/sd-jwt-node-crypto';
import { present, presentableKeys } from '@bcrl/sd-jwt-present';
import { decodeSdJwt, getClaims } from '@bcrl/sd-jwt-decode';
import { digest } from '@bcrl/sd-jwt-node-crypto';

(async () => {
const sdjwt =
Expand Down
5 changes: 3 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.0.3",
"version": "2.1.0",
"npmClient": "pnpm",
"exact": true,
"message": "chore(release): %s",
Expand All @@ -9,7 +9,8 @@
],
"command": {
"publish": {
"conventionalCommits": true
"conventionalCommits": true,
"access": "public"
}
}
}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "@hopae/sd-jwt",
"name": "@bcrl/sd-jwt",
"version": "2.0.1",
"description": "sd-jwt draft 7 implementation in typescript",
"scripts": {
"build": "lerna run build --stream",
"lint": "lerna run lint --stream",
"test": "vitest run --coverage",
"clean": "lerna clean -y",
"publish:latest": "lerna publish --conventional-commits --include-merged-tags --create-release github --yes --dist-tag latest",
"publish:next": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes",
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes"
"publish:latest": "lerna publish --no-private --conventional-commits --include-merged-tags --create-release github --yes --dist-tag latest",
"publish:next": "lerna publish --no-private --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes",
"publish:unstable": "lerna publish --no-private --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"keywords": [
"sd-jwt",
Expand Down
11 changes: 10 additions & 1 deletion packages/broswer-crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.1.0](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.1...v2.1.0) (2024-02-21)

**Note:** Version bump only for package @bcrl/sd-jwt-browser-crypto






## [2.0.3](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.2...v2.0.3) (2024-02-20)

**Note:** Version bump only for package @hopae/sd-jwt-browser-crypto
**Note:** Version bump only for package @bcrl/sd-jwt-browser-crypto
4 changes: 2 additions & 2 deletions packages/broswer-crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hopae/sd-jwt-browser-crypto",
"version": "2.0.3",
"name": "@bcrl/sd-jwt-browser-crypto",
"version": "2.1.0",
"description": "sd-jwt draft 7 implementation in typescript",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
14 changes: 13 additions & 1 deletion packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.1.0](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.1...v2.1.0) (2024-02-21)


### Features

* Apply lerna to move src to core ([#67](https://github.com/openwallet-foundation-labs/sd-jwt-js/issues/67)) ([c4d555c](https://github.com/openwallet-foundation-labs/sd-jwt-js/commit/c4d555c3ca61e83eb4703cd8cda75a9c261e2915))






## [2.0.3](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v2.0.2...v2.0.3) (2024-02-20)

**Note:** Version bump only for package @hopae/sd-jwt-core
**Note:** Version bump only for package @bcrl/sd-jwt-core
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hopae/sd-jwt-core",
"version": "2.0.3",
"name": "@bcrl/sd-jwt-core",
"version": "2.1.0",
"description": "sd-jwt draft 7 implementation in typescript",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -36,12 +36,12 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@hopae/sd-jwt-node-crypto": "2.0.3"
"@bcrl/sd-jwt-node-crypto": "2.1.0"
},
"dependencies": {
"@hopae/sd-jwt-decode": "2.0.3",
"@hopae/sd-jwt-type": "2.0.3",
"@hopae/sd-jwt-util": "2.0.3"
"@bcrl/sd-jwt-decode": "2.1.0",
"@bcrl/sd-jwt-type": "2.1.0",
"@bcrl/sd-jwt-util": "2.1.0"
},
"tsup": {
"entry": [
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/decoy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HasherAndAlg, SaltGenerator } from '@hopae/sd-jwt-type';
import { Uint8ArrayToBase64Url } from '@hopae/sd-jwt-util';
import { HasherAndAlg, SaltGenerator } from '@bcrl/sd-jwt-type';
import { Uint8ArrayToBase64Url } from '@bcrl/sd-jwt-util';

// This function creates a decoy value that can be used to obscure SD JWT payload.
// The value is basically a hash of a random salt. So the value is not predictable.
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SDJWTException } from '@hopae/sd-jwt-util';
import { SDJWTException } from '@bcrl/sd-jwt-util';
import { Jwt } from './jwt';
import { KBJwt } from './kbjwt';
import { SDJwt, pack } from './sdjwt';
Expand All @@ -9,7 +9,7 @@ import {
SDJWTCompact,
SDJWTConfig,
SD_JWT_TYP,
} from '@hopae/sd-jwt-type';
} from '@bcrl/sd-jwt-type';

export * from './sdjwt';
export * from './kbjwt';
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/jwt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Base64urlEncode, SDJWTException } from '@hopae/sd-jwt-util';
import { Base64urlString, Signer, Verifier } from '@hopae/sd-jwt-type';
import { decodeJwt } from '@hopae/sd-jwt-decode';
import { Base64urlEncode, SDJWTException } from '@bcrl/sd-jwt-util';
import { Base64urlString, Signer, Verifier } from '@bcrl/sd-jwt-type';
import { decodeJwt } from '@bcrl/sd-jwt-decode';

export type JwtData<
Header extends Record<string, any>,
Expand Down
Loading

0 comments on commit 66dc2a2

Please sign in to comment.