Skip to content

Commit

Permalink
Rename packages into @sd-jwt (openwallet-foundation-labs#77)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
lukasjhan authored and cre8 committed Mar 8, 2024
1 parent 6e10b68 commit 2be094f
Show file tree
Hide file tree
Showing 52 changed files with 148 additions and 242 deletions.
11 changes: 0 additions & 11 deletions CHANGELOG.md

This file was deleted.

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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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:*"
"@sd-jwt/core": "workspace:*",
"@sd-jwt/types": "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 '@sd-jwt/core';
import { DisclosureFrame } from '@sd-jwt/types';
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 '@sd-jwt/types';

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 '@sd-jwt/decode';
import { digest } from '@sd-jwt/crypto-nodejs';

(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:*"
"@sd-jwt/decode": "workspace:*",
"@sd-jwt/types": "workspace:*",
"@sd-jwt/crypto-nodejs": "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:*"
"@sd-jwt/present": "workspace:*",
"@sd-jwt/decode": "workspace:*",
"@sd-jwt/types": "workspace:*",
"@sd-jwt/crypto-nodejs": "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 '@sd-jwt/present';
import { decodeSdJwt, getClaims } from '@sd-jwt/decode';
import { digest } from '@sd-jwt/crypto-nodejs';

(async () => {
const sdjwt =
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hopae/sd-jwt",
"version": "2.0.1",
"name": "@sd-jwt/sd-jwt",
"version": "0.3.0",
"description": "sd-jwt draft 7 implementation in typescript",
"scripts": {
"build": "lerna run build --stream",
Expand Down
8 changes: 0 additions & 8 deletions packages/broswer-crypto/CHANGELOG.md

This file was deleted.

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": "@sd-jwt/crypto-browser",
"version": "0.3.0",
"description": "sd-jwt draft 7 implementation in typescript",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
8 changes: 0 additions & 8 deletions packages/core/CHANGELOG.md

This file was deleted.

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": "@sd-jwt/core",
"version": "0.3.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"
"@sd-jwt/crypto-nodejs": "workspace:*"
},
"dependencies": {
"@hopae/sd-jwt-decode": "2.0.3",
"@hopae/sd-jwt-type": "2.0.3",
"@hopae/sd-jwt-util": "2.0.3"
"@sd-jwt/decode": "workspace:*",
"@sd-jwt/types": "workspace:*",
"@sd-jwt/utils": "workspace:*"
},
"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 '@sd-jwt/types';
import { Uint8ArrayToBase64Url } from '@sd-jwt/utils';

// 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 '@sd-jwt/utils';
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 '@sd-jwt/types';

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 '@sd-jwt/utils';
import { Base64urlString, Signer, Verifier } from '@sd-jwt/types';
import { decodeJwt } from '@sd-jwt/decode';

export type JwtData<
Header extends Record<string, any>,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/kbjwt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SDJWTException } from '@hopae/sd-jwt-util';
import { SDJWTException } from '@sd-jwt/utils';
import { Jwt } from './jwt';
import { Verifier, kbHeader, kbPayload } from '@hopae/sd-jwt-type';
import { Verifier, kbHeader, kbPayload } from '@sd-jwt/types';

export class KBJwt<
Header extends kbHeader = kbHeader,
Expand Down
10 changes: 3 additions & 7 deletions packages/core/src/sdjwt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createDecoy } from './decoy';
import { SDJWTException, Disclosure } from '@hopae/sd-jwt-util';
import { SDJWTException, Disclosure } from '@sd-jwt/utils';
import { Jwt } from './jwt';
import { KBJwt } from './kbjwt';
import {
Expand All @@ -14,12 +14,8 @@ import {
SaltGenerator,
kbHeader,
kbPayload,
} from '@hopae/sd-jwt-type';
import {
createHashMapping,
getSDAlgAndPayload,
unpack,
} from '@hopae/sd-jwt-decode';
} from '@sd-jwt/types';
import { createHashMapping, getSDAlgAndPayload, unpack } from '@sd-jwt/decode';

export type SDJwtData<
Header extends Record<string, any>,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/test/decoy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createDecoy } from '../decoy';
import { describe, expect, test } from 'vitest';
import { Base64urlEncode } from '@hopae/sd-jwt-util';
import { digest, generateSalt } from '@hopae/sd-jwt-node-crypto';
import { Base64urlEncode } from '@sd-jwt/utils';
import { digest, generateSalt } from '@sd-jwt/crypto-nodejs';

const hash = {
hasher: digest,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SDJwtInstance } from '../index';
import { Signer, Verifier } from '@hopae/sd-jwt-type';
import { Signer, Verifier } from '@sd-jwt/types';
import Crypto from 'node:crypto';
import { describe, expect, test } from 'vitest';
import { digest, generateSalt } from '@hopae/sd-jwt-node-crypto';
import { digest, generateSalt } from '@sd-jwt/crypto-nodejs';

export const createSignerVerifier = () => {
const { privateKey, publicKey } = Crypto.generateKeyPairSync('ed25519');
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/test/jwt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SDJWTException } from '@hopae/sd-jwt-util';
import { SDJWTException } from '@sd-jwt/utils';
import { Jwt } from '../jwt';
import Crypto from 'node:crypto';
import { Signer, Verifier } from '@hopae/sd-jwt-type';
import { Signer, Verifier } from '@sd-jwt/types';
import { describe, expect, test } from 'vitest';

describe('JWT', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/test/kbjwt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SDJWTException } from '@hopae/sd-jwt-util';
import { SDJWTException } from '@sd-jwt/utils';
import { KBJwt } from '../kbjwt';
import { KB_JWT_TYP, Signer, Verifier } from '@hopae/sd-jwt-type';
import { KB_JWT_TYP, Signer, Verifier } from '@sd-jwt/types';
import Crypto from 'node:crypto';
import { describe, expect, test } from 'vitest';

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/test/sdjwt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Disclosure } from '@hopae/sd-jwt-util';
import { Disclosure } from '@sd-jwt/utils';
import { Jwt } from '../jwt';
import { SDJwt, listKeys, pack } from '../sdjwt';
import Crypto from 'node:crypto';
import { describe, test, expect } from 'vitest';
import { DisclosureFrame, Signer } from '@hopae/sd-jwt-type';
import { generateSalt, digest as hasher } from '@hopae/sd-jwt-node-crypto';
import { unpack, createHashMapping } from '@hopae/sd-jwt-decode';
import { DisclosureFrame, Signer } from '@sd-jwt/types';
import { generateSalt, digest as hasher } from '@sd-jwt/crypto-nodejs';
import { unpack, createHashMapping } from '@sd-jwt/decode';

const hash = { alg: 'SHA256', hasher };

Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/app-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Crypto from 'node:crypto';
import { SDJwtInstance } from '../src';
import { DisclosureFrame, Signer, Verifier } from '@hopae/sd-jwt-type';
import { DisclosureFrame, Signer, Verifier } from '@sd-jwt/types';
import fs from 'fs';
import path from 'path';
import { describe, expect, test } from 'vitest';
import { digest, generateSalt } from '@hopae/sd-jwt-node-crypto';
import { digest, generateSalt } from '@sd-jwt/crypto-nodejs';

export const createSignerVerifier = () => {
const { privateKey, publicKey } = Crypto.generateKeyPairSync('ed25519');
Expand Down
8 changes: 0 additions & 8 deletions packages/decode/CHANGELOG.md

This file was deleted.

10 changes: 5 additions & 5 deletions packages/decode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hopae/sd-jwt-decode",
"version": "2.0.3",
"name": "@sd-jwt/decode",
"version": "0.3.0",
"description": "sd-jwt draft 7 implementation in typescript",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -34,11 +34,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@hopae/sd-jwt-node-crypto": "2.0.3"
"@sd-jwt/crypto-nodejs": "workspace:*"
},
"dependencies": {
"@hopae/sd-jwt-type": "2.0.3",
"@hopae/sd-jwt-util": "2.0.3"
"@sd-jwt/types": "workspace:*",
"@sd-jwt/utils": "workspace:*"
},
"tsup": {
"entry": [
Expand Down
10 changes: 3 additions & 7 deletions packages/decode/src/decode.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import {
Base64urlDecode,
SDJWTException,
Disclosure,
} from '@hopae/sd-jwt-util';
import { Base64urlDecode, SDJWTException, Disclosure } from '@sd-jwt/utils';
import {
Hasher,
HasherAndAlg,
SD_DIGEST,
SD_LIST_KEY,
SD_SEPARATOR,
} from '@hopae/sd-jwt-type';
import { HasherAndAlgSync, HasherSync } from '@hopae/sd-jwt-type/src/type';
} from '@sd-jwt/types';
import { HasherAndAlgSync, HasherSync } from '@sd-jwt/types/src/type';

export const decodeJwt = <
H extends Record<string, any>,
Expand Down
2 changes: 1 addition & 1 deletion packages/decode/src/test/decode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getClaimsSync,
splitSdJwt,
} from '../decode';
import { digest } from '@hopae/sd-jwt-node-crypto';
import { digest } from '@sd-jwt/crypto-nodejs';

describe('decode tests', () => {
test('decode jwt', () => {
Expand Down
Loading

0 comments on commit 2be094f

Please sign in to comment.