Skip to content

Commit

Permalink
fix: draft 11
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Nov 8, 2024
1 parent 0556a42 commit 8a175e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/oid4vci/src/__tests__/Oid4vciIssuer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe('Oid4vciIssuer', () => {
grants: {
[preAuthorizedCodeGrantIdentifier]: {
'pre-authorized_code': 'qbRsnksAVad5J33Tw231MQDf5nvyiR-xsnvWXfo35NI',
tx_code: {},
},
authorization_code: {},
},
Expand All @@ -98,14 +99,17 @@ describe('Oid4vciIssuer', () => {

expect(credentialOffer).toStrictEqual({
credentialOffer:
'openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fcredential-issuer.com%22%2C%22credential_configuration_ids%22%3A%5B%22pidSdJwt%22%5D%2C%22grants%22%3A%7B%22authorization_code%22%3A%7B%7D%2C%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22qbRsnksAVad5J33Tw231MQDf5nvyiR-xsnvWXfo35NI%22%7D%7D%7D',
'openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fcredential-issuer.com%22%2C%22credential_configuration_ids%22%3A%5B%22pidSdJwt%22%5D%2C%22grants%22%3A%7B%22authorization_code%22%3A%7B%7D%2C%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22qbRsnksAVad5J33Tw231MQDf5nvyiR-xsnvWXfo35NI%22%2C%22tx_code%22%3A%7B%7D%2C%22user_pin_required%22%3Atrue%7D%7D%2C%22credentials%22%3A%5B%22pidSdJwt%22%5D%7D',
credentialOfferObject: {
credential_configuration_ids: ['pidSdJwt'],
credentials: ['pidSdJwt'],
credential_issuer: 'https://credential-issuer.com',
grants: {
authorization_code: {},
'urn:ietf:params:oauth:grant-type:pre-authorized_code': {
'pre-authorized_code': 'qbRsnksAVad5J33Tw231MQDf5nvyiR-xsnvWXfo35NI',
user_pin_required: true,
tx_code: {},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('Credential Offer', () => {
},
[preAuthorizedCodeGrantIdentifier]: {
tx_code: {
input_mode: 'numeric',
length: 8,
},
authoriztation_server: 'https://authorization.com',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { vHttpsUrl } from '@animo-id/oauth2-utils'
import * as v from 'valibot'

const vTxCode = v.looseObject({
input_mode: v.optional(v.union([v.literal('numeric'), v.literal('text')]), 'numeric'),
input_mode: v.optional(v.union([v.literal('numeric'), v.literal('text')])),
length: v.optional(v.pipe(v.number(), v.integer())),
description: v.optional(v.pipe(v.string(), v.maxLength(300))),
})
Expand Down

0 comments on commit 8a175e2

Please sign in to comment.