Skip to content

Commit ef0b1ee

Browse files
authored
Merge pull request #106 from Sphereon-Opensource/develop
New release
2 parents 80fe8f1 + afc2a8a commit ef0b1ee

22 files changed

Lines changed: 3522 additions & 3141 deletions

.github/workflows/build-test-on-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222
- name: Use Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '18.18.0'
26-
- uses: pnpm/action-setup@v2
25+
node-version: '20.x'
26+
- uses: pnpm/action-setup@v3
2727
with:
28-
version: 8
28+
version: 8.15.7
2929
- run: pnpm install
3030
- run: pnpm build
3131
- name: run CI tests

.github/workflows/build-test-publish-on-push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
- 5432:5432
3131
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
3636
- name: Use Node.js
3737
uses: actions/setup-node@v4
3838
with:
39-
node-version: '18.18.0'
40-
- uses: pnpm/action-setup@v2
39+
node-version: '20.x'
40+
- uses: pnpm/action-setup@v3
4141
with:
42-
version: 8
42+
version: 8.15.7
4343
# - name: Get yarn cache directory path
4444
# id: yarn-cache-dir-path
4545
# run: echo "::set-output name=dir::$(yarn cache dir)"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[![CI](https://github.com/Sphereon-Opensource/OID4VCI/actions/workflows/build-test-on-pr.yml/badge.svg)](https://github.com/Sphereon-Opensource/OID4VCI/actions/workflows/build-test-on-pr.yml) [![codecov](https://codecov.io/gh/Sphereon-Opensource/OID4VCI/branch/develop/graph/badge.svg)](https://codecov.io/gh/Sphereon-Opensource/OID4VCI) [![NPM Version](https://img.shields.io/npm/v/@sphereon/oid4vci-client.svg)](https://npm.im/@sphereon/oid4vci-client)
99

10-
_IMPORTANT the packages are still in an early development stage, as such breaking changes are to be expected_
10+
_IMPORTANT the packages are still in an early development stage, which means that breaking changes are to be expected_
1111

1212
# Background
1313

@@ -19,10 +19,10 @@ OpenID4VCI defines an API designated as Credential Endpoint that is used to issu
1919
corresponding OAuth 2.0 based authorization mechanisms (see [RFC6749]) that a Wallet uses to obtain authorization to
2020
receive verifiable credentials. W3C formats as well as other Credential formats are supported. This allows existing
2121
OAuth 2.0 deployments and OpenID Connect OPs (see [OpenID.Core]) to extend their service and become Credential Issuers.
22-
It also allows new applications built using Verifiable Credentials to utilize OAuth 2.0 as integration and
22+
It also allows new applications built using Verifiable Credentials to utilize OAuth 2.0 as an integration and
2323
interoperability layer. This package provides holder/wallet support to interact with OpenID4VCI capable Issuer systems.
2424

25-
Next to the client and issuer, there is also a common package, which has all the types and payloads shared between the client and issuer.
25+
In addition to the client and issuer, there is also a common package, which has all the types and payloads shared between the client and issuer.
2626

2727
# Packages
2828
There are 2 main packages in this mono-repository
@@ -34,7 +34,7 @@ The OpenID4VCI client is typically used in wallet type of applications, where th
3434
## OpenID for VCI Issuer
3535

3636
The OpenID4VCI issuer is used in issuer type applications, where an organization is issuing the credential(s). More info can be found in the issuer [README](./packages/issuer/README.md).
37-
Please not that the Issuer is a library. It has some examples how to run it with REST endpoints. If you however are looking for a full solution we suggest our [SSI SDK](https://github.com/Sphereon-Opensource/ssi-sdk) or the [demo](https://github.com/Sphereon-Opensource/OID4VC-demo)
37+
Please note that the Issuer is a library. It has some examples on how to run it with REST endpoints. If you are however looking for a full solution we suggest our [SSI SDK](https://github.com/Sphereon-Opensource/ssi-sdk) or the [demo](https://github.com/Sphereon-Opensource/OID4VC-demo)
3838

3939

4040
# Flows
@@ -47,9 +47,9 @@ This flow is supported but might need more work, so you might run into issues tr
4747

4848
## Pre-authorized Code Flow
4949

50-
The pre-authorized code flow assumes the user is using an out of bound mechanism outside the issuance flow to
50+
The pre-authorized code flow assumes that the user is using an out of bound mechanism outside the issuance flow to
5151
authenticate first.
5252

53-
The below diagram shows the steps involved in the pre-authorized code flow. Note that wallet inner functionalities (like
54-
saving VCs) are out of scope for this library. Also This library doesn't involve any functionalities of a VC Issuer
53+
The below diagram shows the steps involved in the pre-authorized code flow. Note that inner wallet functionalities (like
54+
saving VCs) are out of scope for this library. Also This library doesn't include any functionalities of a VC Issuer
5555
![Flow diagram](https://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/Sphereon-Opensource/OID4VCI-client/develop/docs/preauthorized-code-flow.puml)

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
"@types/node": "^18.17.3",
3838
"codecov": "^3.8.3",
3939
"jest": "^29.6.2",
40-
"lerna": "^7.1.4",
40+
"lerna": "^8.1.2",
4141
"lerna-changelog": "^2.2.0",
4242
"npm-run-all": "^4.1.5",
43-
"prettier": "^3.0.1",
44-
"rimraf": "^5.0.1",
45-
"ts-jest": "^29.1.1",
46-
"typescript": "5.3.3"
43+
"prettier": "^3.2.5",
44+
"rimraf": "^5.0.5",
45+
"ts-jest": "^29.1.2",
46+
"typescript": "5.4.5"
4747
},
4848
"keywords": [
4949
"Sphereon",

packages/callback-example/lib/__tests__/issuerCallback.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function proofOfPossessionCallbackFunction(args: Jwt, kid?: string): Promi
3737
}
3838
return await new jose.SignJWT({ ...args.payload })
3939
.setProtectedHeader({ ...args.header })
40-
.setIssuedAt(+new Date())
40+
.setIssuedAt(args.payload.iat ?? Math.round(+new Date()/1000))
4141
.setIssuer(kid)
4242
.setAudience(args.payload.aud)
4343
.setExpirationTime('2h')

packages/client/lib/AccessTokenClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export class AccessTokenClient {
7777
metadata: metadata
7878
? metadata
7979
: issuerOpts?.fetchMetadata
80-
? await MetadataClient.retrieveAllMetadata(issuerOpts.issuer, { errorOnNotFound: false })
81-
: undefined,
80+
? await MetadataClient.retrieveAllMetadata(issuerOpts.issuer, { errorOnNotFound: false })
81+
: undefined,
8282
});
8383

8484
return this.sendAuthCode(requestTokenURL, accessTokenRequest);

packages/client/lib/CredentialOfferClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export class CredentialOfferClient {
102102
uriTypeProperties: isUri
103103
? ['credential_offer_uri']
104104
: version >= OpenId4VCIVersion.VER_1_0_11
105-
? ['credential_issuer', 'credential_type']
106-
: ['issuer', 'credential_type'],
105+
? ['credential_issuer', 'credential_type']
106+
: ['issuer', 'credential_type'],
107107
param,
108108
version,
109109
});

packages/client/lib/OpenID4VCIClient.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,9 @@ export class OpenID4VCIClient {
306306
} else if (!response.successBody) {
307307
debug(`Access token error. No success body`);
308308
throw Error(
309-
`Retrieving an access token from ${this._state.endpointMetadata
310-
?.token_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`,
309+
`Retrieving an access token from ${
310+
this._state.endpointMetadata?.token_endpoint
311+
} for issuer ${this.getIssuer()} failed as there was no success response body`,
311312
);
312313
}
313314
this._state.accessTokenResponse = response.successBody;
@@ -428,8 +429,9 @@ export class OpenID4VCIClient {
428429
} else if (!response.successBody) {
429430
debug(`Credential request error. No success body`);
430431
throw Error(
431-
`Retrieving a credential from ${this._state.endpointMetadata
432-
?.credential_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`,
432+
`Retrieving a credential from ${
433+
this._state.endpointMetadata?.credential_endpoint
434+
} for issuer ${this.getIssuer()} failed as there was no success response body`,
433435
);
434436
}
435437
return response.successBody;

packages/client/lib/__tests__/ProofOfPossessionBuilder.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IDENTIPROOF_ISSUER_URL } from './MetadataMocks';
99

1010
const jwt: Jwt = {
1111
header: { alg: Alg.ES256, kid: 'did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1', typ: 'jwt' },
12-
payload: { iss: 'sphereon:wallet', nonce: 'tZignsnFbp', jti: 'tZignsnFbp223', aud: IDENTIPROOF_ISSUER_URL, iat: Date.now() },
12+
payload: { iss: 'sphereon:wallet', nonce: 'tZignsnFbp', jti: 'tZignsnFbp223', aud: IDENTIPROOF_ISSUER_URL, iat: Date.now()/1000 },
1313
};
1414

1515
const kid = 'did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1';

packages/client/lib/__tests__/SdJwt.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const vcIssuer = new VcIssuerBuilder()
4343
},
4444
payload: {
4545
aud: issuerMetadata.credential_issuer,
46-
iat: +new Date(),
46+
iat: +new Date()/1000,
4747
nonce: 'a-c-nonce',
4848
},
4949
},

0 commit comments

Comments
 (0)