Skip to content

Commit

Permalink
chore: Update tsconfig and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed May 5, 2023
1 parent 8463776 commit 09d17aa
Show file tree
Hide file tree
Showing 26 changed files with 321 additions and 201 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,34 @@ the REST APIs.

## OpenID for Verifiable Credentials (OID4VC)

This is a new set of specification by the OpenID Foundation, that enable peer to peer authentication (SIOPv2),
Credential Issuance (OID4VCI) and Credential Presentation/Verification (OID4VP). These SSI-SDK modules offer
higher-level integrations for these specification than our lower level libraries,
like [OID4VCI](https://github.com/Sphereon-OpenSource/OID4VCI), [SIOPv2 & OID4VP](https://github.com/Sphereon-Opensource/SIOP-OID4VP), [Well-known DIDs](https://github.com/Sphereon-Opensource/wellknown-did-client).
These low-level libraries are typically not opinionated and require an implementor to do some more work like providing
signature/key callbacks. Contrary this
This is a new [set of specifications](https://openid.net/openid4vc/) by the [OpenID Foundation](https://openid.net/), that enable peer to peer authentication ([SIOPv2](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)),
Credential Issuance ([OID4VCI](https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html)) and Credential Presentation/Verification ([OID4VP](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html)). The SSI-SDK modules offer
higher-level and more tight integrations for these specification than our lower level libraries,
like [OID4VCI](https://github.com/Sphereon-OpenSource/OID4VCI), [SIOPv2 & OID4VP](https://github.com/Sphereon-Opensource/SIOP-OID4VP) and [Well-known DIDs](https://github.com/Sphereon-Opensource/wellknown-did-client).

These low-level libraries are typically not too opinionated and require an implementor to do some more work like providing
signature/key callback functions. Contrary this
SSI-SDK is more opinionated and requires you to use other modules of the SSI-SDK or Veramo to provide certain
functionalities, like DID and key management. The benefit however is that it provides a fully working agent solution
with a low amount of
configuration and/or additional coding in your solution, and a rich ecosystem of plugins.

If you want to test out some of these plugins, we highly recommend using
our [Open-Source wallet](https://github.com/Sphereon-Opensource/ssi-mobile-wallet)
and/or [SIOPv2-OID4VP demo](https://github.com/Sphereon-Opensource/SIOPv2-OpenID4VP-example) deployed
at https://ssi.sphereon.com, which are using the plugins below.

| Plugin | Description |
|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Presentation Exchange](./packages/presentation-exchange) | Allows to persist and manage v1 and v2 Presentation Definitions, as well as Verify Presentation Definitions, create Verifiable Presentations with Submission Data, select and match Credentials and DIDs all stored in the agent. Can be used in both Relying Party/Verified contexts as holder contexts |
| [Presentation Exchange](./packages/presentation-exchange) | Allows to persist and manage v1 and v2 Presentation Definitions, as well as Verify Presentation Definitions, create Verifiable Presentations with Submission Data, select and match Credentials and DIDs all stored in the agent. Can be used in both Relying Party/Verifier contexts as holder contexts |
| [SIOPv2 Authenticator with OID4VP support](./packages/siopv2-oid4vp-op-auth) | OpenID Provider for a wallet/holder context, that allows the agent to authenticate with SIOPv2 against the Relying Party and optionally use OpenID4VP to transport Verifiable Credentials. It is integrated into Key Management system, DID providers and VC modules. Supports JWT and JSON-LD VCs and has support for the [JWT VC Presentation Profile](https://identity.foundation/jwt-vc-presentation-profile/) |
| [SIOPv2 Relying Party logic with OID4VP support](./packages/siopv2-oid4vp-rp-auth) | Plugin for a Relying Party agent context, containing the core logic to create Authorization Requests, verify Authorization Responses, as well as handle/manage Presentation Definitions and verifications (OID4VP). It is integrated into the Key Management system, DID providers and VC modules. Supports JWT and JSON-LD VCs and has support for the [JWT VC Presentation Profile](https://identity.foundation/jwt-vc-presentation-profile/) |
| [SIOPv2 Relying Party REST API](./packages/siopv2-oid4vp-rp-rest-api) | Plugin for a Relying Party agent context, it exposes a REST API which allows to integrate into webapps/websites. Support sessions and multiple presentation definitions. You typically run this as a separate agent to your application, but it could be integrated if you want. |
| [SIOPv2 Relying Party REST client](./packages/siopv2-oid4vp-rp-rest-client) | Plugin for a Relying Party webapp, it exposes a REST client, allowing for easy integration and communication from the Webapp with the RESP API of the Agent. Support creating QR codes for different Presentation Definitions as well as Session Handling. |

## Microsoft :registered: Entra Verified ID
## Microsoft:registered: Entra Verified ID

The below packages add direct support for Microsoft :registered: Entra Verified ID. These plugins are using Microsoft
The below packages add direct support for Microsoft:registered: Entra Verified ID. These plugins are using Microsoft
libraries and REST APIs.
Please note that you do not have to use these plugins to be able to support Microsoft:registered: Authenticator, have
your agent
Expand All @@ -60,8 +62,8 @@ support for OID4VCI, until that time you will have to use their Request API to i

| Plugin | Description |
|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| [Microsoft :registered: Azure :registered: Authenticator](./packages/ms-authenticator) | Plugin to authenticate using the Microsoft :registered: Authentication Library (MSAL) against Microsoft :registered: Azure :registered:. |
| [Entra Verified ID Request API](./packages/ms-request-api) | Plugin to use Microsoft :registered: Entra Verified ID's Request API (REST) to issue/verify Verifiable Credentials |
| [Microsoft:registered: Azure :registered: Authenticator](./packages/ms-authenticator) | Plugin to authenticate using the Microsoft:registered: Authentication Library (MSAL) against Microsoft:registered: Azure :registered:. |
| [Entra Verified ID Request API](./packages/ms-request-api) | Plugin to use Microsoft:registered: Entra Verified ID's Request API (REST) to issue/verify Verifiable Credentials |

## Well-known DIDs

Expand Down
18 changes: 14 additions & 4 deletions jest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"ts",
"tsx",
"js",
"jsx"
"jsx",
"json",
"jsonld"
],
"collectCoverage": true,
"collectCoverageFrom": [
Expand All @@ -14,8 +16,6 @@
"!**/types/**",
"!**/dist/**",
"!**/.yalc/**",
"!**/node_modules/**/__tests__/**",
"!**/node_modules/**/*.test.ts",
"!**/node_modules/**",
"!**/packages/**/index.ts"
],
Expand All @@ -27,8 +27,18 @@
"coverageDirectory": "./coverage",
"transform": {
"\\.jsx?$": "babel-jest",
"\\.tsx?$": "ts-jest"
"\\.tsx?$": ["ts-jest", {
"tsconfig": "./packages/tsconfig-base.json"
}]
},
"modulePathIgnorePatterns": [
"<rootDir>/packages/presentation-exchange/.yalc/",
"<rootDir>/packages/siopv2-oid4vp-rp-auth/.yalc/",
"<rootDir>/packages/siopv2-oid4vp-rp-rest-api/.yalc/"
],
"transformIgnorePatterns": [
"node_modules/(?!(?:.pnpm/)?(nist-weierstrauss|multiformatsgggggg))"
],
"testMatch": [
"**/__tests__/**/*.test.*",
"!**/.yalc/**"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "SSI-SDK-workspace",
"name": "@sphereon/sphereon-sdk.workspace",
"private": true,
"version": "0.10.0",
"description": "Sphereon SSI Typescript SDK (Workspace)",
"description": "Sphereon SSI SDK (Workspace)",
"repository": "git@github.com:Sphereon-Opensource/SSI-SDK.git",
"author": "Sphereon <dev@sphereon.com>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -78,10 +78,10 @@
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/node": "^18.15.11",
"@types/debug": "^4.1.7",
"@types/node": "^16.18.14",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"codecov": "^3.8.3",
"cross-fetch": "^3.1.5",
"eslint": "^8.35.0",
Expand All @@ -91,12 +91,12 @@
"jest": "^27.5.1",
"jest-fetch-mock": "^3.0.3",
"json-schema": "^0.4.0",
"lerna": "^6.5.1",
"lerna": "^6.6.1",
"lerna-changelog": "^2.2.0",
"oas-resolver": "^2.5.6",
"openapi-types": "^12.1.0",
"patch-package": "^6.5.1",
"prettier": "^2.8.4",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"rimraf": "^4.4.0",
"semantic-release": "^19.0.5",
Expand Down
7 changes: 5 additions & 2 deletions packages/contact-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"scripts": {
"build": "tsc --build",
"build": "tsc",
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
Expand All @@ -19,7 +19,10 @@
"typeorm": "^0.3.12"
},
"devDependencies": {
"@veramo/cli": "4.2.0"
"@sphereon/ssi-sdk-data-store": "^0.10.0",
"@veramo/cli": "4.2.0",
"@veramo/remote-client": "4.2.0",
"@veramo/remote-server": "4.2.0"
},
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions packages/data-store/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"rootDir": "src",
"outDir": "dist",
"declarationDir": "dist",
"experimentalDecorators": true,
"strictPropertyInitialization": false
},
"references": []
Expand Down
6 changes: 3 additions & 3 deletions packages/ms-authenticator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"cross-fetch": "^3.1.5"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/jest": "^27.5.2",
"@veramo/cli": "4.2.0",
"jest": "^27.3.1",
"jest": "^27.5.1",
"prettier": "^2.4.1",
"ts-jest": "^27.0.7"
"ts-jest": "^27.1.5"
},
"files": [
"dist/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ms-request-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# ms-request-api

Microsoft :registered: Entra Verified ID allows you to issue Verifiable Credentials. This SSI-SDK plugin handles issuing a verifiable credential using issuer authentication info and issuer configuration using the Entra Verified ID Request API.
Microsoft:registered: Entra Verified ID allows you to issue Verifiable Credentials. This SSI-SDK plugin handles issuing a verifiable credential using issuer authentication info and issuer configuration using the Entra Verified ID Request API.

### Installation

Expand Down
18 changes: 13 additions & 5 deletions packages/ms-request-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
"typeorm": "^0.3.12"
},
"devDependencies": {
"@types/express-session": "^1.17.4",
"@types/jest": "^27.0.2",
"@types/uuid": "^9.0.1",
"uuid": "^9.0.0",
"@veramo/data-store": "4.2.0",
"@veramo/remote-client": "4.2.0",
"@veramo/remote-server": "4.2.0",
"@veramo/cli": "4.2.0",
"jest": "^27.3.1",
"prettier": "^2.4.1",
"ts-jest": "^27.0.7"
"@types/express": "^4.17.17",
"@types/express-session": "^1.17.4",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"prettier": "^2.8.8",
"ts-jest": "^27.1.5",
"@types/node": "^18.16.3",
"typescript": "4.9.5"
},
"files": [
"dist/**/*",
Expand Down
6 changes: 4 additions & 2 deletions packages/ms-request-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": "./src",
"outDir": "dist",
"declarationDir": "dist"
"declarationDir": "dist",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"references": [{ "path": "../ms-authenticator" }]
}
2 changes: 2 additions & 0 deletions packages/presentation-exchange/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"@veramo/cli": "4.2.0",
"@veramo/did-provider-key": "4.2.0",
"@veramo/did-resolver": "4.2.0",
"@veramo/remote-server": "4.2.0",
"@veramo/remote-client": "4.2.0",
"@veramo/utils": "4.2.0",
"did-resolver": "^4.1.0",
"nock": "^13.2.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/siopv2-oid4vp-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"uint8arrays": "3.1.1",
"@sphereon/did-auth-siop": "^0.3.1-unstable.0"
"@sphereon/did-auth-siop": "^0.3.1-unstable.1"
},
"scripts": {
"build": "tsc"
Expand Down
5 changes: 4 additions & 1 deletion packages/siopv2-oid4vp-op-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/did-auth-siop": "^0.3.1-unstable.0",
"@sphereon/did-auth-siop": "^0.3.1-unstable.1",
"@sphereon/pex": "2.0.1",
"@sphereon/pex-models": "2.0.2",
"@sphereon/ssi-sdk-presentation-exchange": "^0.10.0",
"@sphereon/ssi-sdk-core": "^0.10.0",
"@sphereon/ssi-sdk-ext.did-utils": "^0.11.0",
Expand All @@ -30,6 +31,8 @@
"devDependencies": {
"@sphereon/did-uni-client": "^0.6.0",
"@veramo/cli": "4.2.0",
"@veramo/remote-client": "4.2.0",
"@veramo/remote-server": "4.2.0",
"@veramo/did-provider-key": "4.2.0",
"@veramo/did-resolver": "4.2.0",
"@veramo/utils": "4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/siopv2-oid4vp-rp-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/did-auth-siop": "^0.3.1-unstable.0",
"@sphereon/did-auth-siop": "^0.3.1-unstable.1",
"@sphereon/pex": "2.0.1",
"@sphereon/ssi-sdk-core": "^0.10.0",
"@sphereon/ssi-sdk-ext.did-utils": "^0.11.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/siopv2-oid4vp-rp-auth/src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ResponseType,
RevocationVerification,
RP,
RPBuilder,
Scope,
SigningAlgo,
SubjectType,
Expand Down Expand Up @@ -79,7 +80,7 @@ export async function createRPBuilder(args: {
pexOpts?: IPEXOptions | undefined
definition?: IPresentationDefinition
context: IRequiredContext
}) {
}): Promise<RPBuilder> {
const { rpOpts, pexOpts, context } = args
const { didOpts } = rpOpts
const definition =
Expand Down
14 changes: 13 additions & 1 deletion packages/siopv2-oid4vp-rp-rest-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"dependencies": {
"@sphereon/ssi-sdk-siopv2-oid4vp-common": "^0.10.0",
"@sphereon/ssi-sdk-siopv2-oid4vp-rp-auth": "^0.10.0",
"@sphereon/ssi-sdk-presentation-exchange": "^0.10.0",
"@sphereon/did-auth-siop": "^0.3.1-unstable.1",
"@sphereon/ssi-types": "^0.10.0",
"@types/uuid": "^9.0.1",
"@veramo/core": "4.2.0",
Expand All @@ -30,7 +32,10 @@
"devDependencies": {
"@sphereon/did-uni-client": "^0.6.0",
"@sphereon/ssi-sdk-data-store": "^0.10.0",
"@sphereon/ssi-sdk-jwk-did-provider": "^0.10.0",
"@sphereon/ssi-sdk-ext.did-provider-jwk": "^0.11.0",
"@sphereon/ssi-sdk-vc-handler-ld-local": "^0.10.0",
"@sphereon/pex-models": "^2.0.2",
"@sphereon/pex": "^2.0.1",
"@types/body-parser": "^1.19.2",
"@types/cookie-parser": "^1.4.3",
"@types/cors": "^2.8.13",
Expand All @@ -40,10 +45,17 @@
"@types/express-http-proxy": "^1.6.3",
"@types/node": "^18.15.0",
"@veramo/cli": "4.2.0",
"typeorm": "^0.3.12",
"@decentralized-identity/ion-sdk": "^0.6.0",
"@veramo/did-provider-ion": "4.2.0",
"@veramo/did-provider-key": "4.2.0",
"@veramo/did-provider-web": "4.2.0",
"@veramo/did-provider-ethr": "4.2.0",
"@veramo/did-resolver": "4.2.0",
"@veramo/data-store": "4.2.0",
"@veramo/did-manager": "4.2.0",
"@veramo/key-manager": "4.2.0",
"@veramo/kms-local": "4.2.0",
"@veramo/utils": "4.2.0",
"did-resolver": "^4.1.0",
"nock": "^13.2.1",
Expand Down
1 change: 1 addition & 0 deletions packages/siopv2-oid4vp-rp-rest-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"references": [
{ "path": "../siopv2-oid4vp-common" },
{ "path": "../siopv2-oid4vp-rp-auth" },
{ "path": "../presentation-exchange" },
{ "path": "../ssi-types" },
{ "path": "../ssi-sdk-core" }
]
Expand Down
2 changes: 1 addition & 1 deletion packages/siopv2-oid4vp-rp-rest-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"did-resolver": "^4.1.0",
"typescript": "4.9.5",
"ts-node": "^10.9.1",
"@types/node": "^16.18.0",
"@types/node": "^18.16.3",
"nock": "^13.3.0"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { fetch } from 'cross-fetch'
import {
ISIOPv2OID4VPRPRestClient,
ISiopClientGenerateAuthRequestArgs,
ISiopClientGetAuthStatusArgs,
IRequiredContext,
ISiopClientRemoveAuthRequestSessionArgs,
ISIOPv2OID4VPRPRestClient,
} from '../types/ISIOPv2OID4VPRPRestClient'
import Debug from 'debug'
import { IAgentPlugin } from '@veramo/core'
import { AuthStatusResponse, GenerateAuthRequestURIResponse } from '@sphereon/ssi-sdk-siopv2-oid4vp-common'

const debug = Debug('ssi-sdk-siopv2-oid4vp-rp-rest-client:SiopV2OID4VpRpRestClient')
const debug = Debug('sphereon:ssi-sdk-siopv2-oid4vp-rp-rest-client')

/**
* @beta
*/
export class SIOPv2OID4VPRPRestClient implements IAgentPlugin {
readonly methods: ISIOPv2OID4VPRPRestClient = {
siopClientRemoveAuthRequestState: this.siopClientRemoveAuthRequestState.bind(this),
Expand All @@ -31,7 +33,7 @@ export class SIOPv2OID4VPRPRestClient implements IAgentPlugin {
}
}

private async siopClientRemoveAuthRequestState(args: ISiopClientRemoveAuthRequestSessionArgs, context: IRequiredContext): Promise<boolean> {
private async siopClientRemoveAuthRequestState(args: ISiopClientRemoveAuthRequestSessionArgs): Promise<boolean> {
const baseUrl = this.checkBaseUrlParameter(args.baseUrl)
const definitionId = this.checkDefinitionIdParameter(args.definitionId)
await fetch(this.uriWithBase(`/webapp/definitions/${definitionId}/auth-requests/${args.correlationId}`, baseUrl), {
Expand All @@ -40,7 +42,7 @@ export class SIOPv2OID4VPRPRestClient implements IAgentPlugin {
return true
}

private async siopClientGetAuthStatus(args: ISiopClientGetAuthStatusArgs, context: IRequiredContext): Promise<AuthStatusResponse> {
private async siopClientGetAuthStatus(args: ISiopClientGetAuthStatusArgs): Promise<AuthStatusResponse> {
const baseUrl = this.checkBaseUrlParameter(args.baseUrl)
const url = this.uriWithBase('/webapp/auth-status', baseUrl)
const definitionId = this.checkDefinitionIdParameter(args.definitionId)
Expand All @@ -63,8 +65,7 @@ export class SIOPv2OID4VPRPRestClient implements IAgentPlugin {
}

private async siopClientCreateAuthRequest(
args: ISiopClientGenerateAuthRequestArgs,
context: IRequiredContext
args: ISiopClientGenerateAuthRequestArgs
): Promise<GenerateAuthRequestURIResponse> {
const baseUrl = this.checkBaseUrlParameter(args.baseUrl)
const definitionId = this.checkDefinitionIdParameter(args.definitionId)
Expand Down
Loading

0 comments on commit 09d17aa

Please sign in to comment.