Skip to content

Commit e206509

Browse files
authored
feat: deferred credential issuance (#86)
Signed-off-by: Henrique Dias <mail@hacdias.com>
1 parent 919ef7c commit e206509

42 files changed

Lines changed: 684 additions & 147 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/four-olives-tease.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@openid4vc/openid4vci": minor
3+
"@openid4vc/oauth2": patch
4+
---
5+
6+
Add support for deferred credential issuance and Draft 16 of the OpenID for Verifiable Credential Issuance.

.changeset/fruity-spiders-stare.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@openid4vc/openid4vci": patch
3+
"@openid4vc/oauth2": patch
4+
---
5+
6+
Fix a myriad of typos across errors, comments, and variable names.

packages/oauth2/src/Oauth2AuthorizationServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
verifyPushedAuthorizationRequest,
4141
} from './authorization-request/verify-pushed-authorization-request'
4242
import type { CallbackContext } from './callbacks'
43-
import { type VerifyClientAttestationOptions, verifyClientAttestation } from './client-attestation/clent-attestation'
43+
import { type VerifyClientAttestationOptions, verifyClientAttestation } from './client-attestation/client-attestation'
4444
import { Oauth2ErrorCodes } from './common/z-oauth2-error'
4545
import { type VerifyDpopJwtOptions, verifyDpopJwt } from './dpop/dpop'
4646
import {

packages/oauth2/src/access-token/__tests__/parse-access-token-request.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Parse Access Token Request', () => {
1414
url: 'https://request.com/token',
1515
},
1616
})
17-
).toThrow('Error occured during validation of authorization request.')
17+
).toThrow('Error occurred during validation of authorization request.')
1818
})
1919

2020
test('handles unknown grant_type', () => {

packages/oauth2/src/access-token/introspect-token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface IntrospectTokenOptions {
1818
authorizationServerMetadata: AuthorizationServerMetadata
1919

2020
/**
21-
* The provided acccess token
21+
* The provided access token
2222
*/
2323
token: string
2424

@@ -29,7 +29,7 @@ export interface IntrospectTokenOptions {
2929
tokenTypeHint?: string
3030

3131
/**
32-
* Additional payload to include in the introspection equest. Items will be encoded and sent
32+
* Additional payload to include in the introspection request. Items will be encoded and sent
3333
* using x-www-form-urlencoded format. Nested items (JSON) will be stringified and url encoded.
3434
*/
3535
additionalPayload?: Record<string, unknown>

packages/oauth2/src/access-token/parse-access-token-request.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { formatZodError } from '@openid4vc/utils'
2-
import { extractClientAttestationJwtsFromHeaders } from '../client-attestation/clent-attestation'
2+
import { extractClientAttestationJwtsFromHeaders } from '../client-attestation/client-attestation'
33
import type { RequestLike } from '../common/z-common'
44
import { Oauth2ErrorCodes } from '../common/z-oauth2-error'
55
import { extractDpopJwtFromHeaders } from '../dpop/dpop'
@@ -57,7 +57,7 @@ export interface ParseAccessTokenRequestOptions {
5757

5858
/**
5959
* The access token request as a JSON object. Your server should decode the
60-
* `x-www-url-form-urlencoded` body into an object (e.g. using `bodyParser.urlEncoed()` in express)
60+
* `x-www-url-form-urlencoded` body into an object (e.g. using `bodyParser.urlEncoded()` in express)
6161
*/
6262
accessTokenRequest: Record<string, unknown>
6363
}
@@ -74,7 +74,7 @@ export function parseAccessTokenRequest(options: ParseAccessTokenRequestOptions)
7474
if (!parsedAccessTokenRequest.success) {
7575
throw new Oauth2ServerErrorResponseError({
7676
error: Oauth2ErrorCodes.InvalidRequest,
77-
error_description: `Error occured during validation of authorization request.\n${formatZodError(parsedAccessTokenRequest.error)}`,
77+
error_description: `Error occurred during validation of authorization request.\n${formatZodError(parsedAccessTokenRequest.error)}`,
7878
})
7979
}
8080

packages/oauth2/src/access-token/verify-access-token-request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type CallbackContext, HashAlgorithm } from '../callbacks'
2-
import { type VerifiedClientAttestationJwt, verifyClientAttestation } from '../client-attestation/clent-attestation'
2+
import { type VerifiedClientAttestationJwt, verifyClientAttestation } from '../client-attestation/client-attestation'
33
import type { VerifiedClientAttestationPopJwt } from '../client-attestation/client-attestation-pop'
44
import {
55
oauthClientAttestationHeader,
@@ -306,7 +306,7 @@ async function verifyAccessTokenRequestClientAttestation(
306306
{
307307
error: Oauth2ErrorCodes.InvalidRequest,
308308
error_description:
309-
'Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensrue both DPoP and client attestation use the same key.',
309+
'Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensure both DPoP and client attestation use the same key.',
310310
},
311311
{
312312
status: 401,

packages/oauth2/src/authorization-challenge/parse-authorization-challenge-request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function parseAuthorizationChallengeRequest(
3232
if (!parsedAuthorizationChallengeRequest.success) {
3333
throw new Oauth2ServerErrorResponseError({
3434
error: Oauth2ErrorCodes.InvalidRequest,
35-
error_description: `Error occured during validation of authorization challenge request.\n${formatZodError(parsedAuthorizationChallengeRequest.error)}`,
35+
error_description: `Error occurred during validation of authorization challenge request.\n${formatZodError(parsedAuthorizationChallengeRequest.error)}`,
3636
})
3737
}
3838

packages/oauth2/src/authorization-request/parse-authorization-request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { extractClientAttestationJwtsFromHeaders } from '../client-attestation/clent-attestation'
1+
import { extractClientAttestationJwtsFromHeaders } from '../client-attestation/client-attestation'
22
import type { RequestLike } from '../common/z-common'
33
import { Oauth2ErrorCodes } from '../common/z-oauth2-error'
44
import { extractDpopJwtFromHeaders } from '../dpop/dpop'
@@ -31,7 +31,7 @@ export interface ParseAuthorizationRequestResult {
3131
jwt: string
3232
}
3333

34-
// TOOD: we should revampt this to generic client authentication so we can suppor other
34+
// TODO: we should revampt this to generic client authentication so we can suppor other
3535
// method as well. We should also create a generic verify client authentication method.
3636
/**
3737
* The client attestation jwts from the authorization request headers.

packages/oauth2/src/authorization-request/verify-authorization-request.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type CallbackContext, HashAlgorithm } from '../callbacks'
2-
import { type VerifiedClientAttestationJwt, verifyClientAttestation } from '../client-attestation/clent-attestation'
2+
import { type VerifiedClientAttestationJwt, verifyClientAttestation } from '../client-attestation/client-attestation'
33
import type { VerifiedClientAttestationPopJwt } from '../client-attestation/client-attestation-pop'
44
import {
55
oauthClientAttestationHeader,
@@ -23,15 +23,15 @@ export interface VerifyAuthorizationRequestDpop {
2323
* The dpop jwt from the pushed authorization request.
2424
*
2525
* If dpop is required, at least one of `jwt` or `jwkThumbprint` MUST
26-
* be provided. If both are provided, the jwk thubmprints are matched
26+
* be provided. If both are provided, the jwk thumbprints are matched
2727
*/
2828
jwt?: string
2929

3030
/**
3131
* The jwk thumbprint as provided in the `dpop_jkt` parameter.
3232
*
3333
* If dpop is required, at least one of `jwt` or `jwkThumbprint` MUST
34-
* be provided. If both are provided, the jwk thubmprints are matched
34+
* be provided. If both are provided, the jwk thumbprints are matched
3535
*/
3636
jwkThumbprint?: string
3737

@@ -73,7 +73,7 @@ export interface VerifyAuthorizationRequestReturn {
7373
jwkThumbprint: string
7474

7575
/**
76-
* The JWK will be returend if a DPoP proof was provided in the header.
76+
* The JWK will be returned if a DPoP proof was provided in the header.
7777
*/
7878
jwk?: Jwk
7979
}
@@ -188,7 +188,7 @@ async function verifyAuthorizationRequestClientAttestation(
188188
{
189189
error: Oauth2ErrorCodes.InvalidRequest,
190190
error_description:
191-
'Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensrue both DPoP and client attestation use the same key.',
191+
'Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensure both DPoP and client attestation use the same key.',
192192
},
193193
{
194194
status: 401,

0 commit comments

Comments
 (0)