Skip to content

Commit

Permalink
feat: Pass more information about the jwt
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Lanser <[email protected]>
  • Loading branch information
Tommylans committed Nov 7, 2024
1 parent 1625de5 commit 11d5011
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"files": {
"maxSize": 10000000
"maxSize": 10000000,
"ignore": ["lerna.json"]
},
"formatter": {
"lineWidth": 120,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"style:fix": "pnpm style:check --write --unsafe",
"types:check": "pnpm build --noEmit",
"test": "pnpm -r test",
"release": "lerna publish"
"release": "lerna publish",
"validate": "pnpm types:check && pnpm style:check"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/jsonWeb/verifyJsonWebToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const verifyJwtSignature = async ({ jwt, jwks, verifyJwtCallback }: Verif

try {
const isValid = await verifyJwtCallback({
jwt,
header,
claims,
signature,
jwk,
data: signableInput,
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export type SignCallback = (options: {
}) => Promise<Uint8Array>

export type VerifyCallback = (options: {
jwt: string
header: Record<string, unknown>
claims: Record<string, unknown>
data: Uint8Array
signature: Uint8Array
jwk: JsonWebKey
Expand Down

0 comments on commit 11d5011

Please sign in to comment.