Skip to content

Commit

Permalink
chore: Prepare v0.3.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Nov 21, 2022
1 parent 40bfafc commit ee1f155
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release Notes

## v0.3.2 - 2022-11-21
Release with support for the pre-authorized code flow only!

- Changed:
- renamed `jwtArgs` to `jwt` in the callback type
- Documentation updates/fixes

- Fixes:
- The acquireCredential in the OpenID4VCIClient was not using the access token, resulting in auth issues.


## v0.3.1 - 2022-11-20
Release with support for the pre-authorized code flow only!

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const { privateKey, publicKey } = await jose.generateKeyPair('ES256');
// Must be JWS
async function signCallback(args: Jwt, kid: string): Promise<string> {
return await new jose.SignJWT({ ...args.payload })
.setProtectedHeader({ args.header.alg })
.setProtectedHeader({ alg: args.header.alg })
.setIssuedAt()
.setIssuer(kid)
.setAudience(args.payload.aud)
Expand Down Expand Up @@ -272,21 +272,21 @@ to sign the JWT and optionally a callback to verify the JWT.
The signature of the callback functions you need to implement are:

````typescript
export type JWTSignerCallback = (jwtArgs: Jwt, kid: string) => Promise<string>;
export type JWTSignerCallback = (jwt: Jwt, kid: string) => Promise<string>;
export type JWTVerifyCallback = (args: { jwt: string; kid: string }) => Promise<void>;
````

This is an example of the signature callback function created using the `jose` library.

````typescript
import { JwtArgs } from "./CredentialIssuance.types";
import { Jwt } from "@sphereon/openid4vci-client";

const { privateKey, publicKey } = await jose.generateKeyPair('ES256');

// Must be JWS
async function signCallback(args: JwtArgs, kid: string): Promise<string> {
async function signCallback(args: Jwt, kid: string): Promise<string> {
return await new jose.SignJWT({ ...args.payload })
.setProtectedHeader({ alg: 'ES256' })
.setProtectedHeader({ alg: args.header.alg })
.setIssuedAt()
.setIssuer(kid)
.setAudience(args.payload.aud)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sphereon/openid4vci-client",
"version": "0.3.2-unstable.1",
"version": "0.3.2",
"description": "OpenID for Verifiable Credential Issuance (OpenID4VCI) client",
"main": "dist/main/index.js",
"types": "dist/main/index.d.ts",
Expand Down

0 comments on commit ee1f155

Please sign in to comment.