diff --git a/.changeset/brave-apricots-provide.md b/.changeset/brave-apricots-provide.md index 3f52dfb..50af9fe 100644 --- a/.changeset/brave-apricots-provide.md +++ b/.changeset/brave-apricots-provide.md @@ -1,5 +1,5 @@ --- -"@animo-id/oauth2": minor +"@openid4vc/oauth2": minor --- feat: add client attestations diff --git a/.changeset/config.json b/.changeset/config.json index 963f0f3..cffb415 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@3.0.1/schema.json", "changelog": "@changesets/cli/changelog", "privatePackages": false, - "fixed": [["@animo-id/*"]], + "fixed": [["@openid4vc/*"]], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", diff --git a/.changeset/old-feet-begin.md b/.changeset/old-feet-begin.md index 797e5de..b141ac8 100644 --- a/.changeset/old-feet-begin.md +++ b/.changeset/old-feet-begin.md @@ -1,5 +1,5 @@ --- -"@animo-id/oid4vci": minor +"@openid4vc/oid4vci": minor --- feat: add key attestations diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab55fa4..0e62a81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,7 +81,7 @@ jobs: # this ensures there's always a patch release created cat << 'EOF' > .changeset/snapshot-template-changeset.md --- - '@animo-id/oid4vci': patch + '@openid4vc/oid4vci': patch --- snapshot release diff --git a/README.md b/README.md index da97422..43178f7 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,30 @@ -

- - - - Animo Logo - -

-

OpenID for Verifiable Credentials - TypeScript

-

Powered by   - - - - Animo Logo - -


-

- +

- OAuth 2.0 + OAuth 2.0  |  - OpenID for Verifiable Credential Issuance + OpenID for Verifiable Credential Issuance  |  Supported Environments  |  Contributing  |  License +  |  + Credits

--- -## OAuth 2.0 - [`@animo-id/oauth2`](./packages/oauth2) +## OAuth 2.0 - [`@openid4vc/oauth2`](./packages/oauth2) -[![@animo-id/oauth2 version](https://img.shields.io/npm/v/@animo-id/oauth2)](https://npmjs.com/package/@animo-id/oauth2) +[![@openid4vc/oauth2 version](https://img.shields.io/npm/v/@openid4vc/oauth2)](https://npmjs.com/package/@openid4vc/oauth2) An implementation of the [OAuth 2.0 Authorization Framework](https://datatracker.ietf.org/doc/html/rfc6749), including extension specifications. @@ -55,12 +41,12 @@ import { ResourceServer, AuthorizationServer, Oauth2Client, -} from "@animo-id/oauth2"; +} from "@openid4vc/oauth2"; ``` -## OpenID for Verifiable Credential Issuance - [`@animo-id/oid4vc`](./packages/oid4vci) +## OpenID for Verifiable Credential Issuance - [`@openid4vc/oid4vc`](./packages/oid4vci) -[![@animo-id/oid4vci version](https://img.shields.io/npm/v/@animo-id/oid4vci)](https://npmjs.com/package/@animo-id/oid4vci) +[![@openid4vc/oid4vci version](https://img.shields.io/npm/v/@openid4vc/oid4vci)](https://npmjs.com/package/@openid4vc/oid4vci) An implementation of the [OpenID for Verifiable Credential Issuance](https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html) specification. @@ -74,7 +60,7 @@ An implementation of the [OpenID for Verifiable Credential Issuance](https://ope import { Oid4vciIssuer Oid4vciClient, -} from "@animo-id/oid4vci"; +} from "@openid4vc/oid4vci"; ``` ## Supported Environments @@ -89,3 +75,7 @@ contributions! To get involved, please follow our [contribution guidelines](./CO ## License This project is licensed under the Apache License Version 2.0 (Apache-2.0). + +## Credits + +This library was initially created by [Animo](https://github.com) as part of the [SPRIN-D EUDI Wallet Prototypes Funke](https://www.sprind.org/en/impulses/challenges/eudi-wallet-prototypes). diff --git a/package.json b/package.json index 9bc8471..978743d 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,9 @@ "name": "oid4vc-ts", "private": true, "description": "Environment agnostic TypeScript implementation of OpenID4VC specifications", - "packageManager": "pnpm@9.12.3+sha256.24235772cc4ac82a62627cd47f834c72667a2ce87799a846ec4e8e555e2d4b8b", + "packageManager": "pnpm@9.15.3+sha256.c1da43727ccbc1ed42aff4fd6bdb4b1e91e65a818e6efff5b240fbf070ba4eaf", "repository": { - "url": "https://github.com/openwallet-foundation/credo-ts", + "url": "https://github.com/openwallet-foundation-labs/oid4vc-ts", "type": "git" }, "author": "Animo Solutions", diff --git a/packages/oauth2/CHANGELOG.md b/packages/oauth2/CHANGELOG.md index 4474f11..3d450b1 100644 --- a/packages/oauth2/CHANGELOG.md +++ b/packages/oauth2/CHANGELOG.md @@ -1,11 +1,11 @@ -# @animo-id/oauth2 +# @openid4vc/oauth2 ## 0.1.4 ### Patch Changes - 12a517a: feat: add refresh_token grant type - - @animo-id/oauth2-utils@0.1.4 + - @openid4vc/utils@0.1.4 ## 0.1.3 @@ -13,7 +13,7 @@ - d4b9279: chore: create github release - Updated dependencies [d4b9279] - - @animo-id/oauth2-utils@0.1.3 + - @openid4vc/utils@0.1.3 ## 0.1.2 @@ -21,7 +21,7 @@ - 1de27e5: chore: correct formatting for publishing - Updated dependencies [1de27e5] - - @animo-id/oauth2-utils@0.1.2 + - @openid4vc/utils@0.1.2 ## 0.1.1 @@ -29,7 +29,7 @@ - 6434781: docs: add readme - Updated dependencies [6434781] - - @animo-id/oauth2-utils@0.1.1 + - @openid4vc/utils@0.1.1 ## 0.1.0 @@ -40,4 +40,4 @@ ### Patch Changes - Updated dependencies [71326c8] - - @animo-id/oauth2-utils@0.1.0 + - @openid4vc/utils@0.1.0 diff --git a/packages/oauth2/README.md b/packages/oauth2/README.md index a8ac56e..39dbfd8 100644 --- a/packages/oauth2/README.md +++ b/packages/oauth2/README.md @@ -1,25 +1,9 @@ -

- - - - Animo Logo - -

-

OpenID for Verifiable Credentials - OAuth2

-

Powered by   - - - - Animo Logo - -


-

-Check out the documentation in the [Github repository](https://github.com/animo/oid4vc-ts). +Check out the documentation in the [Github repository](https://github.com/openwallet-foundation-labs/oid4vc-ts). diff --git a/packages/oauth2/package.json b/packages/oauth2/package.json index fb3ad37..53b4c39 100644 --- a/packages/oauth2/package.json +++ b/packages/oauth2/package.json @@ -1,9 +1,15 @@ { - "name": "@animo-id/oauth2", + "name": "@openid4vc/oauth2", "version": "0.1.4", "exports": "./src/index.ts", "files": ["dist"], "license": "Apache-2.0", + "homepage": "https://github.com/openwallet-foundation-labs/oid4vc-ts/tree/main/packages/oauth2", + "repository": { + "type": "git", + "url": "https://github.com/openwallet-foundation-labs/oid4vc-ts", + "directory": "packages/oauth2" + }, "publishConfig": { "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -21,10 +27,10 @@ "build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap" }, "dependencies": { - "@animo-id/oauth2-utils": "workspace:*", - "valibot": "^0.42.1" + "@openid4vc/utils": "workspace:*", + "valibot": "catalog:" }, "devDependencies": { - "jose": "^5.9.6" + "jose": "catalog:" } } diff --git a/packages/oauth2/src/Oauth2AuthorizationServer.ts b/packages/oauth2/src/Oauth2AuthorizationServer.ts index 4274961..add4e9c 100644 --- a/packages/oauth2/src/Oauth2AuthorizationServer.ts +++ b/packages/oauth2/src/Oauth2AuthorizationServer.ts @@ -1,4 +1,4 @@ -import { type FetchHeaders, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { type FetchHeaders, parseWithErrorHandling } from '@openid4vc/utils' import { type CreateAccessTokenOptions, createAccessTokenJwt } from './access-token/create-access-token' import { type CreateAccessTokenResponseOptions, diff --git a/packages/oauth2/src/Oauth2Client.ts b/packages/oauth2/src/Oauth2Client.ts index a4ed38e..b7c9837 100644 --- a/packages/oauth2/src/Oauth2Client.ts +++ b/packages/oauth2/src/Oauth2Client.ts @@ -1,4 +1,4 @@ -import { objectToQueryParams } from '@animo-id/oauth2-utils' +import { objectToQueryParams } from '@openid4vc/utils' import { type RetrieveAuthorizationCodeAccessTokenOptions, type RetrievePreAuthorizedCodeAccessTokenOptions, diff --git a/packages/oauth2/src/__tests__/Oauth2ResourceServer.test.ts b/packages/oauth2/src/__tests__/Oauth2ResourceServer.test.ts index 9af60c7..42c607f 100644 --- a/packages/oauth2/src/__tests__/Oauth2ResourceServer.test.ts +++ b/packages/oauth2/src/__tests__/Oauth2ResourceServer.test.ts @@ -1,4 +1,4 @@ -import { ContentType } from '@animo-id/oauth2-utils' +import { ContentType } from '@openid4vc/utils' import { http, HttpResponse } from 'msw' import { setupServer } from 'msw/node' import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest' diff --git a/packages/oauth2/src/access-token/create-access-token-response.ts b/packages/oauth2/src/access-token/create-access-token-response.ts index 799c227..4a861de 100644 --- a/packages/oauth2/src/access-token/create-access-token-response.ts +++ b/packages/oauth2/src/access-token/create-access-token-response.ts @@ -1,4 +1,4 @@ -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { parseWithErrorHandling } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { type AccessTokenResponse, vAccessTokenResponse } from './v-access-token' diff --git a/packages/oauth2/src/access-token/create-access-token.ts b/packages/oauth2/src/access-token/create-access-token.ts index 9581738..e98bc3c 100644 --- a/packages/oauth2/src/access-token/create-access-token.ts +++ b/packages/oauth2/src/access-token/create-access-token.ts @@ -1,4 +1,4 @@ -import { addSecondsToDate, dateToSeconds, encodeToBase64Url, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { addSecondsToDate, dateToSeconds, encodeToBase64Url, parseWithErrorHandling } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { HashAlgorithm } from '../callbacks' import { calculateJwkThumbprint } from '../common/jwk/jwk-thumbprint' diff --git a/packages/oauth2/src/access-token/introspect-token.ts b/packages/oauth2/src/access-token/introspect-token.ts index 1bef9c7..b2f9b32 100644 --- a/packages/oauth2/src/access-token/introspect-token.ts +++ b/packages/oauth2/src/access-token/introspect-token.ts @@ -1,9 +1,9 @@ -import { ContentType, createValibotFetcher, objectToQueryParams, parseWithErrorHandling } from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +import { ContentType, createValibotFetcher, objectToQueryParams, parseWithErrorHandling } from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import { Oauth2Error } from '../error/Oauth2Error' import type { AuthorizationServerMetadata } from '../metadata/authorization-server/v-authorization-server-metadata' -import { Headers } from '@animo-id/oauth2-utils' +import { Headers } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { type TokenIntrospectionRequest, diff --git a/packages/oauth2/src/access-token/parse-access-token-request.ts b/packages/oauth2/src/access-token/parse-access-token-request.ts index 56c91cc..f325028 100644 --- a/packages/oauth2/src/access-token/parse-access-token-request.ts +++ b/packages/oauth2/src/access-token/parse-access-token-request.ts @@ -1,4 +1,4 @@ -import { valibotRecursiveFlattenIssues } from '@animo-id/oauth2-utils' +import { valibotRecursiveFlattenIssues } from '@openid4vc/utils' import * as v from 'valibot' import type { RequestLike } from '../common/v-common' import { Oauth2ErrorCodes } from '../common/v-oauth2-error' diff --git a/packages/oauth2/src/access-token/retrieve-access-token.ts b/packages/oauth2/src/access-token/retrieve-access-token.ts index 1afdec2..51a4b27 100644 --- a/packages/oauth2/src/access-token/retrieve-access-token.ts +++ b/packages/oauth2/src/access-token/retrieve-access-token.ts @@ -1,5 +1,5 @@ -import { ContentType, createValibotFetcher, objectToQueryParams, parseWithErrorHandling } from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +import { ContentType, createValibotFetcher, objectToQueryParams, parseWithErrorHandling } from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import * as v from 'valibot' import { ValidationError } from '../../../utils/src/error/ValidationError' import type { CallbackContext } from '../callbacks' diff --git a/packages/oauth2/src/access-token/v-access-token-jwt.ts b/packages/oauth2/src/access-token/v-access-token-jwt.ts index f71d67b..d27d998 100644 --- a/packages/oauth2/src/access-token/v-access-token-jwt.ts +++ b/packages/oauth2/src/access-token/v-access-token-jwt.ts @@ -1,4 +1,4 @@ -import { vInteger } from '@animo-id/oauth2-utils' +import { vInteger } from '@openid4vc/utils' import * as v from 'valibot' import { vJwtHeader, vJwtPayload } from '../common/jwt/v-jwt' diff --git a/packages/oauth2/src/access-token/v-access-token.ts b/packages/oauth2/src/access-token/v-access-token.ts index 3a8dbb9..64cacfb 100644 --- a/packages/oauth2/src/access-token/v-access-token.ts +++ b/packages/oauth2/src/access-token/v-access-token.ts @@ -1,6 +1,6 @@ import * as v from 'valibot' -import { vHttpsUrl } from '@animo-id/oauth2-utils' +import { vHttpsUrl } from '@openid4vc/utils' import { vOauth2ErrorResponse } from '../common/v-oauth2-error' import { vAuthorizationCodeGrantIdentifier, diff --git a/packages/oauth2/src/access-token/v-token-introspection.ts b/packages/oauth2/src/access-token/v-token-introspection.ts index 8b980bc..f8e430f 100644 --- a/packages/oauth2/src/access-token/v-token-introspection.ts +++ b/packages/oauth2/src/access-token/v-token-introspection.ts @@ -1,4 +1,4 @@ -import { vInteger } from '@animo-id/oauth2-utils' +import { vInteger } from '@openid4vc/utils' import * as v from 'valibot' import { vJwtConfirmationPayload } from '../common/jwt/v-jwt' diff --git a/packages/oauth2/src/authorization-challenge/create-authorization-challenge-response.ts b/packages/oauth2/src/authorization-challenge/create-authorization-challenge-response.ts index ff525db..b5dcb67 100644 --- a/packages/oauth2/src/authorization-challenge/create-authorization-challenge-response.ts +++ b/packages/oauth2/src/authorization-challenge/create-authorization-challenge-response.ts @@ -1,4 +1,4 @@ -import { type StringWithAutoCompletion, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { type StringWithAutoCompletion, parseWithErrorHandling } from '@openid4vc/utils' import type { Oauth2ErrorCodes } from '../common/v-oauth2-error' import { type AuthorizationChallengeErrorResponse, diff --git a/packages/oauth2/src/authorization-challenge/parse-authorization-challenge-request.ts b/packages/oauth2/src/authorization-challenge/parse-authorization-challenge-request.ts index caf3e6d..91058f5 100644 --- a/packages/oauth2/src/authorization-challenge/parse-authorization-challenge-request.ts +++ b/packages/oauth2/src/authorization-challenge/parse-authorization-challenge-request.ts @@ -1,4 +1,4 @@ -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { parseWithErrorHandling } from '@openid4vc/utils' import { vAuthorizationChallengeRequest } from './v-authorization-challenge' export interface ParseAuthorizationChallengeRequestOptions { diff --git a/packages/oauth2/src/authorization-challenge/send-authorization-challenge.ts b/packages/oauth2/src/authorization-challenge/send-authorization-challenge.ts index a96086d..ed5ea5e 100644 --- a/packages/oauth2/src/authorization-challenge/send-authorization-challenge.ts +++ b/packages/oauth2/src/authorization-challenge/send-authorization-challenge.ts @@ -4,8 +4,8 @@ import { createValibotFetcher, objectToQueryParams, parseWithErrorHandling, -} from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +} from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import * as v from 'valibot' import type { CallbackContext } from '../callbacks' import { diff --git a/packages/oauth2/src/authorization-challenge/v-authorization-challenge.ts b/packages/oauth2/src/authorization-challenge/v-authorization-challenge.ts index 63651d4..bab279c 100644 --- a/packages/oauth2/src/authorization-challenge/v-authorization-challenge.ts +++ b/packages/oauth2/src/authorization-challenge/v-authorization-challenge.ts @@ -1,4 +1,4 @@ -import { vInteger } from '@animo-id/oauth2-utils' +import { vInteger } from '@openid4vc/utils' import * as v from 'valibot' import { vAuthorizationRequest } from '../authorization-request/v-authorization-request' import { vOauth2ErrorResponse } from '../common/v-oauth2-error' diff --git a/packages/oauth2/src/authorization-request/create-authorization-request.ts b/packages/oauth2/src/authorization-request/create-authorization-request.ts index a1325f4..189428a 100644 --- a/packages/oauth2/src/authorization-request/create-authorization-request.ts +++ b/packages/oauth2/src/authorization-request/create-authorization-request.ts @@ -1,5 +1,5 @@ -import { ContentType, type Fetch, createValibotFetcher, objectToQueryParams } from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +import { ContentType, type Fetch, createValibotFetcher, objectToQueryParams } from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import * as v from 'valibot' import { ValidationError } from '../../../utils/src/error/ValidationError' import { type CallbackContext, HashAlgorithm } from '../callbacks' diff --git a/packages/oauth2/src/authorization-request/v-authorization-request.ts b/packages/oauth2/src/authorization-request/v-authorization-request.ts index 0109c51..3d3bce9 100644 --- a/packages/oauth2/src/authorization-request/v-authorization-request.ts +++ b/packages/oauth2/src/authorization-request/v-authorization-request.ts @@ -1,4 +1,4 @@ -import { vHttpsUrl } from '@animo-id/oauth2-utils' +import { vHttpsUrl } from '@openid4vc/utils' import * as v from 'valibot' // TODO: should create different request validations for different diff --git a/packages/oauth2/src/callbacks.ts b/packages/oauth2/src/callbacks.ts index 4c0c19d..5cd1832 100644 --- a/packages/oauth2/src/callbacks.ts +++ b/packages/oauth2/src/callbacks.ts @@ -1,4 +1,4 @@ -import type { Fetch, OrPromise } from '@animo-id/oauth2-utils' +import type { Fetch, OrPromise } from '@openid4vc/utils' import type { ClientAuthenticationCallback } from './client-authentication' import type { Jwk } from './common/jwk/v-jwk' import type { JwtHeader, JwtPayload, JwtSigner } from './common/jwt/v-jwt' diff --git a/packages/oauth2/src/client-attestation/clent-attestation.ts b/packages/oauth2/src/client-attestation/clent-attestation.ts index cfef5b6..1912cea 100644 --- a/packages/oauth2/src/client-attestation/clent-attestation.ts +++ b/packages/oauth2/src/client-attestation/clent-attestation.ts @@ -1,4 +1,4 @@ -import { type FetchHeaders, dateToSeconds, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { type FetchHeaders, dateToSeconds, parseWithErrorHandling } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { decodeJwt, jwtHeaderFromJwtSigner, jwtSignerFromJwt } from '../common/jwt/decode-jwt' import type { JwtSigner } from '../common/jwt/v-jwt' diff --git a/packages/oauth2/src/client-attestation/client-attestation-pop.ts b/packages/oauth2/src/client-attestation/client-attestation-pop.ts index ce7c352..ec7f264 100644 --- a/packages/oauth2/src/client-attestation/client-attestation-pop.ts +++ b/packages/oauth2/src/client-attestation/client-attestation-pop.ts @@ -1,4 +1,4 @@ -import { addSecondsToDate, dateToSeconds, encodeToBase64Url, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { addSecondsToDate, dateToSeconds, encodeToBase64Url, parseWithErrorHandling } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { decodeJwt } from '../common/jwt/decode-jwt' import type { JwtSignerJwk } from '../common/jwt/v-jwt' diff --git a/packages/oauth2/src/client-attestation/v-client-attestation.ts b/packages/oauth2/src/client-attestation/v-client-attestation.ts index 322bcb5..ecb251b 100644 --- a/packages/oauth2/src/client-attestation/v-client-attestation.ts +++ b/packages/oauth2/src/client-attestation/v-client-attestation.ts @@ -1,7 +1,7 @@ import * as v from 'valibot' import { vJwtHeader, vJwtPayload } from '../common/jwt/v-jwt' -import { vHttpsUrl, vInteger } from '@animo-id/oauth2-utils' +import { vHttpsUrl, vInteger } from '@openid4vc/utils' import { vJwk } from '../common/jwk/v-jwk' export const vOauthClientAttestationHeader = v.literal('OAuth-Client-Attestation') diff --git a/packages/oauth2/src/client-authentication.ts b/packages/oauth2/src/client-authentication.ts index 93e6242..3437aba 100644 --- a/packages/oauth2/src/client-authentication.ts +++ b/packages/oauth2/src/client-authentication.ts @@ -1,7 +1,7 @@ -import type { ContentType, FetchHeaders, HttpMethod } from '@animo-id/oauth2-utils' +import type { ContentType, FetchHeaders, HttpMethod } from '@openid4vc/utils' import type { AuthorizationServerMetadata } from './metadata/authorization-server/v-authorization-server-metadata' -import { decodeUtf8String, encodeToBase64Url } from '@animo-id/oauth2-utils' +import { decodeUtf8String, encodeToBase64Url } from '@openid4vc/utils' import { Oauth2Error } from './error/Oauth2Error' // These two are well-supported and easy to implement diff --git a/packages/oauth2/src/common/jwk/jwk-thumbprint.ts b/packages/oauth2/src/common/jwk/jwk-thumbprint.ts index 0ef9557..3cce3fc 100644 --- a/packages/oauth2/src/common/jwk/jwk-thumbprint.ts +++ b/packages/oauth2/src/common/jwk/jwk-thumbprint.ts @@ -1,7 +1,7 @@ import * as v from 'valibot' import type { HashAlgorithm, HashCallback } from '../../callbacks' -import { decodeUtf8String, encodeToBase64Url, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { decodeUtf8String, encodeToBase64Url, parseWithErrorHandling } from '@openid4vc/utils' import type { Jwk } from './v-jwk' const vJwkThumbprintComponents = v.variant('kty', [ diff --git a/packages/oauth2/src/common/jwt/decode-jwt.ts b/packages/oauth2/src/common/jwt/decode-jwt.ts index 74046a8..79296ea 100644 --- a/packages/oauth2/src/common/jwt/decode-jwt.ts +++ b/packages/oauth2/src/common/jwt/decode-jwt.ts @@ -6,7 +6,7 @@ import { encodeToUtf8String, parseWithErrorHandling, stringToJsonWithErrorHandling, -} from '@animo-id/oauth2-utils' +} from '@openid4vc/utils' import { Oauth2JwtParseError } from '../../error/Oauth2JwtParseError' import { type JwtSigner, vJwtHeader, vJwtPayload } from './v-jwt' diff --git a/packages/oauth2/src/common/jwt/v-jwt.ts b/packages/oauth2/src/common/jwt/v-jwt.ts index 99106b6..795fdc4 100644 --- a/packages/oauth2/src/common/jwt/v-jwt.ts +++ b/packages/oauth2/src/common/jwt/v-jwt.ts @@ -1,4 +1,4 @@ -import { vInteger } from '@animo-id/oauth2-utils' +import { vInteger } from '@openid4vc/utils' import * as v from 'valibot' import { type Jwk, vJwk } from '../jwk/v-jwk' import { vAlgValueNotNone } from '../v-common' diff --git a/packages/oauth2/src/common/jwt/verify-jwt.ts b/packages/oauth2/src/common/jwt/verify-jwt.ts index e358537..d2688aa 100644 --- a/packages/oauth2/src/common/jwt/verify-jwt.ts +++ b/packages/oauth2/src/common/jwt/verify-jwt.ts @@ -1,4 +1,4 @@ -import { dateToSeconds } from '@animo-id/oauth2-utils' +import { dateToSeconds } from '@openid4vc/utils' import type { VerifyJwtCallback } from '../../callbacks' import { Oauth2JwtVerificationError } from '../../error/Oauth2JwtVerificationError' import type { Jwk } from '../jwk/v-jwk' diff --git a/packages/oauth2/src/common/v-common.ts b/packages/oauth2/src/common/v-common.ts index 1e36d7e..71036f1 100644 --- a/packages/oauth2/src/common/v-common.ts +++ b/packages/oauth2/src/common/v-common.ts @@ -1,4 +1,4 @@ -import type { FetchHeaders, HttpMethod } from '@animo-id/oauth2-utils' +import type { FetchHeaders, HttpMethod } from '@openid4vc/utils' import * as v from 'valibot' export const vAlgValueNotNone = v.pipe( diff --git a/packages/oauth2/src/dpop/dpop-retry.ts b/packages/oauth2/src/dpop/dpop-retry.ts index 247deb9..5a73d18 100644 --- a/packages/oauth2/src/dpop/dpop-retry.ts +++ b/packages/oauth2/src/dpop/dpop-retry.ts @@ -1,4 +1,4 @@ -import type { FetchHeaders } from '@animo-id/oauth2-utils' +import type { FetchHeaders } from '@openid4vc/utils' import { SupportedAuthenticationScheme } from '../access-token/verify-access-token' import { Oauth2ErrorCodes, type Oauth2ErrorResponse } from '../common/v-oauth2-error' import { Oauth2ClientErrorResponseError } from '../error/Oauth2ClientErrorResponseError' diff --git a/packages/oauth2/src/dpop/dpop.ts b/packages/oauth2/src/dpop/dpop.ts index 225aa5b..5928b17 100644 --- a/packages/oauth2/src/dpop/dpop.ts +++ b/packages/oauth2/src/dpop/dpop.ts @@ -11,7 +11,7 @@ import { decodeUtf8String, encodeToBase64Url, parseWithErrorHandling, -} from '@animo-id/oauth2-utils' +} from '@openid4vc/utils' import { verifyJwt } from '../common/jwt/verify-jwt' import type { RequestLike } from '../common/v-common' import { type DpopJwtHeader, type DpopJwtPayload, vDpopJwtHeader, vDpopJwtPayload } from './v-dpop' diff --git a/packages/oauth2/src/dpop/v-dpop.ts b/packages/oauth2/src/dpop/v-dpop.ts index 30da02c..0c8ec3c 100644 --- a/packages/oauth2/src/dpop/v-dpop.ts +++ b/packages/oauth2/src/dpop/v-dpop.ts @@ -1,7 +1,7 @@ import * as v from 'valibot' import { vJwtHeader, vJwtPayload } from '../common/jwt/v-jwt' -import { vHttpMethod, vHttpsUrl, vInteger } from '@animo-id/oauth2-utils' +import { vHttpMethod, vHttpsUrl, vInteger } from '@openid4vc/utils' import { vJwk } from '../common/jwk/v-jwk' export const vDpopJwtPayload = v.looseObject({ diff --git a/packages/oauth2/src/error/Oauth2ClientAuthorizationChallengeError.ts b/packages/oauth2/src/error/Oauth2ClientAuthorizationChallengeError.ts index fdf26c4..b83ecdf 100644 --- a/packages/oauth2/src/error/Oauth2ClientAuthorizationChallengeError.ts +++ b/packages/oauth2/src/error/Oauth2ClientAuthorizationChallengeError.ts @@ -1,4 +1,4 @@ -import type { FetchResponse } from '@animo-id/oauth2-utils' +import type { FetchResponse } from '@openid4vc/utils' import type { AuthorizationChallengeErrorResponse } from '../authorization-challenge/v-authorization-challenge' import { Oauth2ClientErrorResponseError } from './Oauth2ClientErrorResponseError' diff --git a/packages/oauth2/src/error/Oauth2ClientErrorResponseError.ts b/packages/oauth2/src/error/Oauth2ClientErrorResponseError.ts index c30d731..7b7e337 100644 --- a/packages/oauth2/src/error/Oauth2ClientErrorResponseError.ts +++ b/packages/oauth2/src/error/Oauth2ClientErrorResponseError.ts @@ -1,4 +1,4 @@ -import type { FetchResponse } from '@animo-id/oauth2-utils' +import type { FetchResponse } from '@openid4vc/utils' import type { Oauth2ErrorResponse } from '../common/v-oauth2-error' import { Oauth2Error } from './Oauth2Error' diff --git a/packages/oauth2/src/error/Oauth2InvalidFetchResponseError.ts b/packages/oauth2/src/error/Oauth2InvalidFetchResponseError.ts index 253811e..e7a012e 100644 --- a/packages/oauth2/src/error/Oauth2InvalidFetchResponseError.ts +++ b/packages/oauth2/src/error/Oauth2InvalidFetchResponseError.ts @@ -1,4 +1,4 @@ -import type { FetchResponse } from '@animo-id/oauth2-utils' +import type { FetchResponse } from '@openid4vc/utils' import { Oauth2Error } from './Oauth2Error' export class InvalidFetchResponseError extends Oauth2Error { diff --git a/packages/oauth2/src/error/Oauth2ResourceUnauthorizedError.ts b/packages/oauth2/src/error/Oauth2ResourceUnauthorizedError.ts index d221d5d..4799467 100644 --- a/packages/oauth2/src/error/Oauth2ResourceUnauthorizedError.ts +++ b/packages/oauth2/src/error/Oauth2ResourceUnauthorizedError.ts @@ -1,4 +1,4 @@ -import { encodeWwwAuthenticateHeader, parseWwwAuthenticateHeader } from '@animo-id/oauth2-utils' +import { encodeWwwAuthenticateHeader, parseWwwAuthenticateHeader } from '@openid4vc/utils' import type { SupportedAuthenticationScheme } from '../access-token/verify-access-token' import type { Oauth2ErrorCodes } from '../common/v-oauth2-error' import { Oauth2Error } from './Oauth2Error' diff --git a/packages/oauth2/src/index.ts b/packages/oauth2/src/index.ts index 1087712..fa62218 100644 --- a/packages/oauth2/src/index.ts +++ b/packages/oauth2/src/index.ts @@ -4,7 +4,7 @@ export type { } from './access-token/v-access-token' // Re-export some types from utils (we don't want people depending on that lib) -export { type HttpMethod, getGlobalConfig, setGlobalConfig, type Oid4vcTsConfig } from '@animo-id/oauth2-utils' +export { type HttpMethod, getGlobalConfig, setGlobalConfig, type Oid4vcTsConfig } from '@openid4vc/utils' export { Oauth2ErrorCodes, type Oauth2ErrorResponse, vOauth2ErrorResponse } from './common/v-oauth2-error' export { calculateJwkThumbprint, type CalculateJwkThumbprintOptions } from './common/jwk/jwk-thumbprint' @@ -54,7 +54,7 @@ export { Oauth2ResourceUnauthorizedError, type WwwAuthenticateHeaderChallenge, } from './error/Oauth2ResourceUnauthorizedError' -export { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +export { InvalidFetchResponseError } from '@openid4vc/utils' export { Oauth2ClientErrorResponseError } from './error/Oauth2ClientErrorResponseError' export { Oauth2ClientAuthorizationChallengeError } from './error/Oauth2ClientAuthorizationChallengeError' export { Oauth2ServerErrorResponseError } from './error/Oauth2ServerErrorResponseError' diff --git a/packages/oauth2/src/metadata/authorization-server/authorization-server-metadata.ts b/packages/oauth2/src/metadata/authorization-server/authorization-server-metadata.ts index 6096bd4..1feffcc 100644 --- a/packages/oauth2/src/metadata/authorization-server/authorization-server-metadata.ts +++ b/packages/oauth2/src/metadata/authorization-server/authorization-server-metadata.ts @@ -1,4 +1,4 @@ -import { type Fetch, joinUriParts } from '@animo-id/oauth2-utils' +import { type Fetch, joinUriParts } from '@openid4vc/utils' import { Oauth2Error } from '../../error/Oauth2Error' import { fetchWellKnownMetadata } from '../fetch-well-known-metadata' import { type AuthorizationServerMetadata, vAuthorizationServerMetadata } from './v-authorization-server-metadata' diff --git a/packages/oauth2/src/metadata/authorization-server/v-authorization-server-metadata.ts b/packages/oauth2/src/metadata/authorization-server/v-authorization-server-metadata.ts index 67c2277..704ca0d 100644 --- a/packages/oauth2/src/metadata/authorization-server/v-authorization-server-metadata.ts +++ b/packages/oauth2/src/metadata/authorization-server/v-authorization-server-metadata.ts @@ -1,4 +1,4 @@ -import { vHttpsUrl } from '@animo-id/oauth2-utils' +import { vHttpsUrl } from '@openid4vc/utils' import * as v from 'valibot' import { vAlgValueNotNone } from '../../common/v-common' diff --git a/packages/oauth2/src/metadata/fetch-jwks-uri.ts b/packages/oauth2/src/metadata/fetch-jwks-uri.ts index 00793bb..0457cb5 100644 --- a/packages/oauth2/src/metadata/fetch-jwks-uri.ts +++ b/packages/oauth2/src/metadata/fetch-jwks-uri.ts @@ -1,5 +1,5 @@ -import { ContentType, type Fetch, createValibotFetcher } from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +import { ContentType, type Fetch, createValibotFetcher } from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import { ValidationError } from '../../../utils/src/error/ValidationError' import { type JwkSet, vJwkSet } from '../common/jwk/v-jwk' import { Oauth2Error } from '../error/Oauth2Error' diff --git a/packages/oauth2/src/metadata/fetch-well-known-metadata.ts b/packages/oauth2/src/metadata/fetch-well-known-metadata.ts index 7bad40c..2e83578 100644 --- a/packages/oauth2/src/metadata/fetch-well-known-metadata.ts +++ b/packages/oauth2/src/metadata/fetch-well-known-metadata.ts @@ -1,5 +1,5 @@ -import { type BaseSchema, ContentType, type Fetch, createValibotFetcher } from '@animo-id/oauth2-utils' -import { InvalidFetchResponseError } from '@animo-id/oauth2-utils' +import { type BaseSchema, ContentType, type Fetch, createValibotFetcher } from '@openid4vc/utils' +import { InvalidFetchResponseError } from '@openid4vc/utils' import type * as v from 'valibot' import { ValidationError } from '../../../utils/src/error/ValidationError' diff --git a/packages/oauth2/src/pkce.ts b/packages/oauth2/src/pkce.ts index fc11a09..9919e60 100644 --- a/packages/oauth2/src/pkce.ts +++ b/packages/oauth2/src/pkce.ts @@ -1,4 +1,4 @@ -import { decodeUtf8String, encodeToBase64Url } from '@animo-id/oauth2-utils' +import { decodeUtf8String, encodeToBase64Url } from '@openid4vc/utils' import { type CallbackContext, HashAlgorithm, type HashCallback } from './callbacks' import { Oauth2Error } from './error/Oauth2Error' diff --git a/packages/oauth2/src/resource-request/make-resource-request.ts b/packages/oauth2/src/resource-request/make-resource-request.ts index c56be20..db6b6c8 100644 --- a/packages/oauth2/src/resource-request/make-resource-request.ts +++ b/packages/oauth2/src/resource-request/make-resource-request.ts @@ -1,4 +1,4 @@ -import { type FetchRequestInit, type FetchResponse, type HttpMethod, defaultFetcher } from '@animo-id/oauth2-utils' +import { type FetchRequestInit, type FetchResponse, type HttpMethod, defaultFetcher } from '@openid4vc/utils' import type { CallbackContext } from '../callbacks' import { type RequestDpopOptions, createDpopHeadersForRequest, extractDpopNonceFromHeaders } from '../dpop/dpop' import { shouldRetryResourceRequestWithDPoPNonce } from '../dpop/dpop-retry' diff --git a/packages/oauth2/src/resource-request/verify-resource-request.ts b/packages/oauth2/src/resource-request/verify-resource-request.ts index f6223f1..91ec23d 100644 --- a/packages/oauth2/src/resource-request/verify-resource-request.ts +++ b/packages/oauth2/src/resource-request/verify-resource-request.ts @@ -1,4 +1,4 @@ -import { ValidationError } from '@animo-id/oauth2-utils' +import { ValidationError } from '@openid4vc/utils' import { introspectToken } from '../access-token/introspect-token' import type { AccessTokenProfileJwtPayload } from '../access-token/v-access-token-jwt' import type { TokenIntrospectionResponse } from '../access-token/v-token-introspection' diff --git a/packages/oauth2/tests/util.ts b/packages/oauth2/tests/util.ts index 7c98408..4e4d422 100644 --- a/packages/oauth2/tests/util.ts +++ b/packages/oauth2/tests/util.ts @@ -1,5 +1,5 @@ import crypto from 'node:crypto' -import { decodeBase64, encodeToUtf8String } from '@animo-id/oauth2-utils' +import { decodeBase64, encodeToUtf8String } from '@openid4vc/utils' import * as jose from 'jose' import { type CallbackContext, HashAlgorithm, type SignJwtCallback } from '../src/callbacks' import { clientAuthenticationNone } from '../src/client-authentication' diff --git a/packages/oid4vci/CHANGELOG.md b/packages/oid4vci/CHANGELOG.md index 2b4cb4d..aa88a8f 100644 --- a/packages/oid4vci/CHANGELOG.md +++ b/packages/oid4vci/CHANGELOG.md @@ -1,12 +1,12 @@ -# @animo-id/oid4vci +# @openid4vc/oid4vci ## 0.1.4 ### Patch Changes - Updated dependencies [12a517a] - - @animo-id/oauth2@0.1.4 - - @animo-id/oauth2-utils@0.1.4 + - @openid4vc/oauth2@0.1.4 + - @openid4vc/utils@0.1.4 ## 0.1.3 @@ -14,8 +14,8 @@ - d4b9279: chore: create github release - Updated dependencies [d4b9279] - - @animo-id/oauth2@0.1.3 - - @animo-id/oauth2-utils@0.1.3 + - @openid4vc/oauth2@0.1.3 + - @openid4vc/utils@0.1.3 ## 0.1.2 @@ -23,8 +23,8 @@ - 1de27e5: chore: correct formatting for publishing - Updated dependencies [1de27e5] - - @animo-id/oauth2@0.1.2 - - @animo-id/oauth2-utils@0.1.2 + - @openid4vc/oauth2@0.1.2 + - @openid4vc/utils@0.1.2 ## 0.1.1 @@ -32,8 +32,8 @@ - 6434781: docs: add readme - Updated dependencies [6434781] - - @animo-id/oauth2@0.1.1 - - @animo-id/oauth2-utils@0.1.1 + - @openid4vc/oauth2@0.1.1 + - @openid4vc/utils@0.1.1 ## 0.1.0 @@ -45,5 +45,5 @@ - 3bcbd08: export additional types - Updated dependencies [71326c8] - - @animo-id/oauth2@0.1.0 - - @animo-id/oauth2-utils@0.1.0 + - @openid4vc/oauth2@0.1.0 + - @openid4vc/utils@0.1.0 diff --git a/packages/oid4vci/README.md b/packages/oid4vci/README.md index d39972b..f9d6305 100644 --- a/packages/oid4vci/README.md +++ b/packages/oid4vci/README.md @@ -1,25 +1,9 @@ -

- - - - Animo Logo - -

-

OpenID for Verifiable Credentials - OpenID4VCI

-

Powered by   - - - - Animo Logo - -


-

-Check out the documentation in the [Github repository](https://github.com/animo/oid4vc-ts). +Check out the documentation in the [Github repository](https://github.com/openwallet-foundation-labs/oid4vc-ts). diff --git a/packages/oid4vci/package.json b/packages/oid4vci/package.json index 5652779..43f33a6 100644 --- a/packages/oid4vci/package.json +++ b/packages/oid4vci/package.json @@ -1,9 +1,15 @@ { - "name": "@animo-id/oid4vci", + "name": "@openid4vc/oid4vci", "version": "0.1.4", "exports": "./src/index.ts", "files": ["dist"], "license": "Apache-2.0", + "homepage": "https://github.com/openwallet-foundation-labs/oid4vc-ts/tree/main/packages/oid4vci", + "repository": { + "type": "git", + "url": "https://github.com/openwallet-foundation-labs/oid4vc-ts", + "directory": "packages/oid4vci" + }, "publishConfig": { "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -21,11 +27,11 @@ "build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap" }, "dependencies": { - "@animo-id/oauth2": "workspace:*", - "@animo-id/oauth2-utils": "workspace:*", - "valibot": "^0.42.1" + "@openid4vc/oauth2": "workspace:*", + "@openid4vc/utils": "workspace:*", + "valibot": "catalog:" }, "devDependencies": { - "jose": "^5.9.6" + "jose": "catalog:" } } diff --git a/packages/oid4vci/src/Oid4vciClient.ts b/packages/oid4vci/src/Oid4vciClient.ts index c80cb79..387e379 100644 --- a/packages/oid4vci/src/Oid4vciClient.ts +++ b/packages/oid4vci/src/Oid4vciClient.ts @@ -12,7 +12,7 @@ import { authorizationCodeGrantIdentifier, getAuthorizationServerMetadataFromList, preAuthorizedCodeGrantIdentifier, -} from '@animo-id/oauth2' +} from '@openid4vc/oauth2' import { determineAuthorizationServerForCredentialOffer, diff --git a/packages/oid4vci/src/Oid4vciIssuer.ts b/packages/oid4vci/src/Oid4vciIssuer.ts index e099093..97dd703 100644 --- a/packages/oid4vci/src/Oid4vciIssuer.ts +++ b/packages/oid4vci/src/Oid4vciIssuer.ts @@ -3,8 +3,8 @@ import { Oauth2ErrorCodes, Oauth2JwtVerificationError, Oauth2ServerErrorResponseError, -} from '@animo-id/oauth2' -import { ValidationError, parseWithErrorHandling } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import { ValidationError, parseWithErrorHandling } from '@openid4vc/utils' import { type CreateCredentialOfferOptions, createCredentialOffer } from './credential-offer/credential-offer' import { type CreateCredentialResponseOptions, diff --git a/packages/oid4vci/src/__tests__/Oid4vciClient.test.ts b/packages/oid4vci/src/__tests__/Oid4vciClient.test.ts index a823dca..35a528c 100644 --- a/packages/oid4vci/src/__tests__/Oid4vciClient.test.ts +++ b/packages/oid4vci/src/__tests__/Oid4vciClient.test.ts @@ -1,5 +1,5 @@ -import { decodeJwt, preAuthorizedCodeGrantIdentifier } from '@animo-id/oauth2' -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { decodeJwt, preAuthorizedCodeGrantIdentifier } from '@openid4vc/oauth2' +import { parseWithErrorHandling } from '@openid4vc/utils' import { http, HttpResponse } from 'msw' import { setupServer } from 'msw/node' import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest' diff --git a/packages/oid4vci/src/__tests__/Oid4vciIssuer.test.ts b/packages/oid4vci/src/__tests__/Oid4vciIssuer.test.ts index 41fe210..932a8ca 100644 --- a/packages/oid4vci/src/__tests__/Oid4vciIssuer.test.ts +++ b/packages/oid4vci/src/__tests__/Oid4vciIssuer.test.ts @@ -1,5 +1,5 @@ -import { preAuthorizedCodeGrantIdentifier } from '@animo-id/oauth2' -import { addSecondsToDate } from '@animo-id/oauth2-utils' +import { preAuthorizedCodeGrantIdentifier } from '@openid4vc/oauth2' +import { addSecondsToDate } from '@openid4vc/utils' import { describe, expect, test } from 'vitest' import { callbacks, getSignJwtCallback } from '../../../oauth2/tests/util' import { Oid4vciIssuer } from '../Oid4vciIssuer' diff --git a/packages/oid4vci/src/credential-offer/__tests__/credential-offer.test.ts b/packages/oid4vci/src/credential-offer/__tests__/credential-offer.test.ts index 60749ea..455e1e4 100644 --- a/packages/oid4vci/src/credential-offer/__tests__/credential-offer.test.ts +++ b/packages/oid4vci/src/credential-offer/__tests__/credential-offer.test.ts @@ -1,4 +1,4 @@ -import { authorizationCodeGrantIdentifier, preAuthorizedCodeGrantIdentifier } from '@animo-id/oauth2' +import { authorizationCodeGrantIdentifier, preAuthorizedCodeGrantIdentifier } from '@openid4vc/oauth2' import { describe, expect, test } from 'vitest' import { callbacks } from '../../../../oauth2/tests/util' import type { IssuerMetadataResult } from '../../metadata/fetch-issuer-metadata' diff --git a/packages/oid4vci/src/credential-offer/__tests__/v-credential-offer.test.ts b/packages/oid4vci/src/credential-offer/__tests__/v-credential-offer.test.ts index 476c925..1bca152 100644 --- a/packages/oid4vci/src/credential-offer/__tests__/v-credential-offer.test.ts +++ b/packages/oid4vci/src/credential-offer/__tests__/v-credential-offer.test.ts @@ -1,4 +1,4 @@ -import { preAuthorizedCodeGrantIdentifier } from '@animo-id/oauth2' +import { preAuthorizedCodeGrantIdentifier } from '@openid4vc/oauth2' import * as v from 'valibot' import { describe, expect, test } from 'vitest' import { vCredentialOfferObject, vCredentialOfferObjectDraft11To14 } from '../v-credential-offer' diff --git a/packages/oid4vci/src/credential-offer/credential-offer.ts b/packages/oid4vci/src/credential-offer/credential-offer.ts index 685755a..c622880 100644 --- a/packages/oid4vci/src/credential-offer/credential-offer.ts +++ b/packages/oid4vci/src/credential-offer/credential-offer.ts @@ -9,7 +9,7 @@ import { authorizationCodeGrantIdentifier, getAuthorizationServerMetadataFromList, preAuthorizedCodeGrantIdentifier, -} from '@animo-id/oauth2' +} from '@openid4vc/oauth2' import { ContentType, type Fetch, @@ -21,7 +21,7 @@ import { getQueryParams, objectToQueryParams, parseWithErrorHandling, -} from '@animo-id/oauth2-utils' +} from '@openid4vc/utils' import type { IssuerMetadataResult } from '../metadata/fetch-issuer-metadata' import { Oid4vciDraftVersion } from '../version' import { diff --git a/packages/oid4vci/src/credential-offer/v-credential-offer.ts b/packages/oid4vci/src/credential-offer/v-credential-offer.ts index 939d886..32e9a48 100644 --- a/packages/oid4vci/src/credential-offer/v-credential-offer.ts +++ b/packages/oid4vci/src/credential-offer/v-credential-offer.ts @@ -2,8 +2,8 @@ import { type AuthorizationCodeGrantIdentifier, type PreAuthorizedCodeGrantIdentifier, preAuthorizedCodeGrantIdentifier, -} from '@animo-id/oauth2' -import { vHttpsUrl } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import { vHttpsUrl } from '@openid4vc/utils' import * as v from 'valibot' const vTxCode = v.looseObject({ diff --git a/packages/oid4vci/src/credential-request/__tests__/v-credential-request.test.ts b/packages/oid4vci/src/credential-request/__tests__/v-credential-request.test.ts index d4ca407..056f246 100644 --- a/packages/oid4vci/src/credential-request/__tests__/v-credential-request.test.ts +++ b/packages/oid4vci/src/credential-request/__tests__/v-credential-request.test.ts @@ -1,4 +1,4 @@ -import { valibotRecursiveFlattenIssues } from '@animo-id/oauth2-utils' +import { valibotRecursiveFlattenIssues } from '@openid4vc/utils' import * as v from 'valibot' import { describe, expect, test } from 'vitest' import { vCredentialRequest, vCredentialRequestDraft11To14 } from '../v-credential-request' diff --git a/packages/oid4vci/src/credential-request/credential-request-configurations.ts b/packages/oid4vci/src/credential-request/credential-request-configurations.ts index 76d1f3a..a4de1ef 100644 --- a/packages/oid4vci/src/credential-request/credential-request-configurations.ts +++ b/packages/oid4vci/src/credential-request/credential-request-configurations.ts @@ -1,4 +1,4 @@ -import { arrayEqualsIgnoreOrder } from '@animo-id/oauth2-utils' +import { arrayEqualsIgnoreOrder } from '@openid4vc/utils' import { extractKnownCredentialConfigurationSupportedFormats } from '../metadata/credential-issuer/credential-issuer-metadata' import type { CredentialConfigurationsSupported, diff --git a/packages/oid4vci/src/credential-request/credential-response.ts b/packages/oid4vci/src/credential-request/credential-response.ts index 408caca..dba924b 100644 --- a/packages/oid4vci/src/credential-request/credential-response.ts +++ b/packages/oid4vci/src/credential-request/credential-response.ts @@ -1,4 +1,4 @@ -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { parseWithErrorHandling } from '@openid4vc/utils' import type { ParseCredentialRequestReturn } from './parse-credential-request' import { type CredentialResponse, vCredentialResponse } from './v-credential-response' diff --git a/packages/oid4vci/src/credential-request/parse-credential-request.ts b/packages/oid4vci/src/credential-request/parse-credential-request.ts index 24d72e0..96c6891 100644 --- a/packages/oid4vci/src/credential-request/parse-credential-request.ts +++ b/packages/oid4vci/src/credential-request/parse-credential-request.ts @@ -1,4 +1,4 @@ -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { parseWithErrorHandling } from '@openid4vc/utils' import * as v from 'valibot' import type { CredentialFormatIdentifier } from '../formats/credential' import { attestationProofTypeIdentifier } from '../formats/proof-type/attestation/v-attestation-proof-type' diff --git a/packages/oid4vci/src/credential-request/retrieve-credentials.ts b/packages/oid4vci/src/credential-request/retrieve-credentials.ts index 0ca9e49..cd32d5b 100644 --- a/packages/oid4vci/src/credential-request/retrieve-credentials.ts +++ b/packages/oid4vci/src/credential-request/retrieve-credentials.ts @@ -5,8 +5,8 @@ import { type ResourceRequestResponseNotOk, type ResourceRequestResponseOk, resourceRequest, -} from '@animo-id/oauth2' -import { ContentType, isResponseContentType, parseWithErrorHandling } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import { ContentType, isResponseContentType, parseWithErrorHandling } from '@openid4vc/utils' import { type SafeParseResult, safeParse } from 'valibot' import type { IssuerMetadataResult } from '../metadata/fetch-issuer-metadata' import { Oid4vciDraftVersion } from '../version' diff --git a/packages/oid4vci/src/credential-request/v-credential-request-common.ts b/packages/oid4vci/src/credential-request/v-credential-request-common.ts index a7f40a3..7d1c0cc 100644 --- a/packages/oid4vci/src/credential-request/v-credential-request-common.ts +++ b/packages/oid4vci/src/credential-request/v-credential-request-common.ts @@ -1,5 +1,5 @@ -import { vJwk } from '@animo-id/oauth2' -import type { InferOutputUnion, Simplify } from '@animo-id/oauth2-utils' +import { vJwk } from '@openid4vc/oauth2' +import type { InferOutputUnion, Simplify } from '@openid4vc/utils' import * as v from 'valibot' import { type ProofTypeIdentifier, diff --git a/packages/oid4vci/src/credential-request/v-credential-request.ts b/packages/oid4vci/src/credential-request/v-credential-request.ts index a72ad4d..1e92a42 100644 --- a/packages/oid4vci/src/credential-request/v-credential-request.ts +++ b/packages/oid4vci/src/credential-request/v-credential-request.ts @@ -1,6 +1,6 @@ import * as v from 'valibot' -import type { InferOutputUnion } from '@animo-id/oauth2-utils' +import type { InferOutputUnion } from '@openid4vc/utils' import { type CredentialFormatIdentifier, vJwtVcJsonCredentialRequestFormat, diff --git a/packages/oid4vci/src/formats/proof-type/attestation/v-attestation-proof-type.ts b/packages/oid4vci/src/formats/proof-type/attestation/v-attestation-proof-type.ts index 0827bf8..d835702 100644 --- a/packages/oid4vci/src/formats/proof-type/attestation/v-attestation-proof-type.ts +++ b/packages/oid4vci/src/formats/proof-type/attestation/v-attestation-proof-type.ts @@ -1,6 +1,6 @@ import * as v from 'valibot' -import { vCompactJwt } from '@animo-id/oauth2' +import { vCompactJwt } from '@openid4vc/oauth2' import { type KeyAttestationJwtHeader, vKeyAttestationJwtHeader, diff --git a/packages/oid4vci/src/formats/proof-type/jwt/jwt-proof-type.ts b/packages/oid4vci/src/formats/proof-type/jwt/jwt-proof-type.ts index b6c71f0..c1d3cd5 100644 --- a/packages/oid4vci/src/formats/proof-type/jwt/jwt-proof-type.ts +++ b/packages/oid4vci/src/formats/proof-type/jwt/jwt-proof-type.ts @@ -1,4 +1,4 @@ -import { type JwtSigner, decodeJwt, isJwkInSet, jwtHeaderFromJwtSigner } from '@animo-id/oauth2' +import { type JwtSigner, decodeJwt, isJwkInSet, jwtHeaderFromJwtSigner } from '@openid4vc/oauth2' import { type CredentialRequestJwtProofTypeHeader, type CredentialRequestJwtProofTypePayload, @@ -6,8 +6,8 @@ import { vCredentialRequestJwtProofTypePayload, } from './v-jwt-proof-type' -import { type CallbackContext, jwtSignerFromJwt, verifyJwt } from '@animo-id/oauth2' -import { dateToSeconds, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { type CallbackContext, jwtSignerFromJwt, verifyJwt } from '@openid4vc/oauth2' +import { dateToSeconds, parseWithErrorHandling } from '@openid4vc/utils' import { Oid4vciError } from '../../../error/Oid4vciError' import { type VerifyKeyAttestationJwtReturn, verifyKeyAttestationJwt } from '../../../key-attestation/key-attestation' import { vKeyAttestationJwtHeader, vKeyAttestationJwtPayload } from '../../../key-attestation/v-key-attestation' diff --git a/packages/oid4vci/src/formats/proof-type/jwt/v-jwt-proof-type.ts b/packages/oid4vci/src/formats/proof-type/jwt/v-jwt-proof-type.ts index 82d931e..be5d20d 100644 --- a/packages/oid4vci/src/formats/proof-type/jwt/v-jwt-proof-type.ts +++ b/packages/oid4vci/src/formats/proof-type/jwt/v-jwt-proof-type.ts @@ -1,7 +1,7 @@ import * as v from 'valibot' -import { vCompactJwt, vJwtHeader, vJwtPayload } from '@animo-id/oauth2' -import { vHttpsUrl, vInteger } from '@animo-id/oauth2-utils' +import { vCompactJwt, vJwtHeader, vJwtPayload } from '@openid4vc/oauth2' +import { vHttpsUrl, vInteger } from '@openid4vc/utils' export const vJwtProofTypeIdentifier = v.literal('jwt') export const jwtProofTypeIdentifier = vJwtProofTypeIdentifier.literal diff --git a/packages/oid4vci/src/index.ts b/packages/oid4vci/src/index.ts index e89f290..f201aab 100644 --- a/packages/oid4vci/src/index.ts +++ b/packages/oid4vci/src/index.ts @@ -7,7 +7,7 @@ export type { } from './credential-offer/v-credential-offer' // Re-export some types from utils (we don't want people depending on that lib) -export { getGlobalConfig, setGlobalConfig, type Oid4vcTsConfig } from '@animo-id/oauth2-utils' +export { getGlobalConfig, setGlobalConfig, type Oid4vcTsConfig } from '@openid4vc/utils' export type { ParseCredentialRequestReturn } from './credential-request/parse-credential-request' export type { diff --git a/packages/oid4vci/src/key-attestation/key-attestation.ts b/packages/oid4vci/src/key-attestation/key-attestation.ts index f2ce851..596d8b2 100644 --- a/packages/oid4vci/src/key-attestation/key-attestation.ts +++ b/packages/oid4vci/src/key-attestation/key-attestation.ts @@ -1,7 +1,7 @@ -import { type Jwk, type JwtSigner, decodeJwt, jwtHeaderFromJwtSigner } from '@animo-id/oauth2' +import { type Jwk, type JwtSigner, decodeJwt, jwtHeaderFromJwtSigner } from '@openid4vc/oauth2' -import { type CallbackContext, jwtSignerFromJwt, verifyJwt } from '@animo-id/oauth2' -import { type StringWithAutoCompletion, dateToSeconds, parseWithErrorHandling } from '@animo-id/oauth2-utils' +import { type CallbackContext, jwtSignerFromJwt, verifyJwt } from '@openid4vc/oauth2' +import { type StringWithAutoCompletion, dateToSeconds, parseWithErrorHandling } from '@openid4vc/utils' import { Oid4vciError } from '../error/Oid4vciError' import { type Iso18045, diff --git a/packages/oid4vci/src/key-attestation/v-key-attestation.ts b/packages/oid4vci/src/key-attestation/v-key-attestation.ts index 13f8d2e..05a6660 100644 --- a/packages/oid4vci/src/key-attestation/v-key-attestation.ts +++ b/packages/oid4vci/src/key-attestation/v-key-attestation.ts @@ -1,7 +1,7 @@ import * as v from 'valibot' -import { vJwk, vJwtHeader, vJwtPayload } from '@animo-id/oauth2' -import { vInteger } from '@animo-id/oauth2-utils' +import { vJwk, vJwtHeader, vJwtPayload } from '@openid4vc/oauth2' +import { vInteger } from '@openid4vc/utils' export type KeyAttestationJwtUse = 'proof_type.jwt' | 'proof_type.attestation' diff --git a/packages/oid4vci/src/metadata/credential-issuer/credential-configurations.ts b/packages/oid4vci/src/metadata/credential-issuer/credential-configurations.ts index 162cb41..0e3d322 100644 --- a/packages/oid4vci/src/metadata/credential-issuer/credential-configurations.ts +++ b/packages/oid4vci/src/metadata/credential-issuer/credential-configurations.ts @@ -1,5 +1,5 @@ -import { Oauth2Error } from '@animo-id/oauth2' -import { ValidationError } from '@animo-id/oauth2-utils' +import { Oauth2Error } from '@openid4vc/oauth2' +import { ValidationError } from '@openid4vc/utils' import * as v from 'valibot' import { Oid4vciError } from '../../error/Oid4vciError' import type { IssuerMetadataResult } from '../fetch-issuer-metadata' diff --git a/packages/oid4vci/src/metadata/credential-issuer/credential-issuer-metadata.ts b/packages/oid4vci/src/metadata/credential-issuer/credential-issuer-metadata.ts index ee10c90..5162025 100644 --- a/packages/oid4vci/src/metadata/credential-issuer/credential-issuer-metadata.ts +++ b/packages/oid4vci/src/metadata/credential-issuer/credential-issuer-metadata.ts @@ -1,5 +1,5 @@ -import { Oauth2Error, fetchWellKnownMetadata } from '@animo-id/oauth2' -import { type Fetch, joinUriParts } from '@animo-id/oauth2-utils' +import { Oauth2Error, fetchWellKnownMetadata } from '@openid4vc/oauth2' +import { type Fetch, joinUriParts } from '@openid4vc/utils' import type { CredentialFormatIdentifier } from '../../formats/credential' import type { Oid4vciDraftVersion } from '../../version' import { diff --git a/packages/oid4vci/src/metadata/credential-issuer/v-credential-issuer-metadata.ts b/packages/oid4vci/src/metadata/credential-issuer/v-credential-issuer-metadata.ts index fc5352e..34f98fb 100644 --- a/packages/oid4vci/src/metadata/credential-issuer/v-credential-issuer-metadata.ts +++ b/packages/oid4vci/src/metadata/credential-issuer/v-credential-issuer-metadata.ts @@ -1,5 +1,5 @@ -import { vCompactJwt } from '@animo-id/oauth2' -import { type InferOutputUnion, type Simplify, vHttpsUrl } from '@animo-id/oauth2-utils' +import { vCompactJwt } from '@openid4vc/oauth2' +import { type InferOutputUnion, type Simplify, vHttpsUrl } from '@openid4vc/utils' import * as v from 'valibot' import { type CredentialFormatIdentifier, diff --git a/packages/oid4vci/src/metadata/fetch-issuer-metadata.ts b/packages/oid4vci/src/metadata/fetch-issuer-metadata.ts index 2425267..e6eeec3 100644 --- a/packages/oid4vci/src/metadata/fetch-issuer-metadata.ts +++ b/packages/oid4vci/src/metadata/fetch-issuer-metadata.ts @@ -3,9 +3,9 @@ import { Oauth2Error, fetchAuthorizationServerMetadata, vAuthorizationServerMetadata, -} from '@animo-id/oauth2' -import type { Fetch } from '@animo-id/oauth2-utils' -import { parseWithErrorHandling } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import type { Fetch } from '@openid4vc/utils' +import { parseWithErrorHandling } from '@openid4vc/utils' import type { Oid4vciDraftVersion } from '../version' import { fetchCredentialIssuerMetadata } from './credential-issuer/credential-issuer-metadata' import type { CredentialIssuerMetadata } from './credential-issuer/v-credential-issuer-metadata' diff --git a/packages/oid4vci/src/nonce/nonce-request.ts b/packages/oid4vci/src/nonce/nonce-request.ts index 42dfee2..784b39a 100644 --- a/packages/oid4vci/src/nonce/nonce-request.ts +++ b/packages/oid4vci/src/nonce/nonce-request.ts @@ -1,11 +1,11 @@ -import { InvalidFetchResponseError } from '@animo-id/oauth2' +import { InvalidFetchResponseError } from '@openid4vc/oauth2' import { ContentType, type Fetch, ValidationError, createValibotFetcher, parseWithErrorHandling, -} from '@animo-id/oauth2-utils' +} from '@openid4vc/utils' import { Oid4vciError } from '../error/Oid4vciError' import type { IssuerMetadataResult } from '../metadata/fetch-issuer-metadata' import { type NonceResponse, vNonceResponse } from './v-nonce' diff --git a/packages/oid4vci/src/nonce/v-nonce.ts b/packages/oid4vci/src/nonce/v-nonce.ts index b408d5d..9304380 100644 --- a/packages/oid4vci/src/nonce/v-nonce.ts +++ b/packages/oid4vci/src/nonce/v-nonce.ts @@ -1,4 +1,4 @@ -import { vInteger } from '@animo-id/oauth2-utils' +import { vInteger } from '@openid4vc/utils' import * as v from 'valibot' export const vNonceResponse = v.looseObject({ diff --git a/packages/oid4vci/src/notification/notification.ts b/packages/oid4vci/src/notification/notification.ts index 33167df..a3894ab 100644 --- a/packages/oid4vci/src/notification/notification.ts +++ b/packages/oid4vci/src/notification/notification.ts @@ -7,8 +7,8 @@ import { type ResourceRequestResponseNotOk, type ResourceRequestResponseOk, resourceRequest, -} from '@animo-id/oauth2' -import { ContentType, isResponseContentType, parseWithErrorHandling } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import { ContentType, isResponseContentType, parseWithErrorHandling } from '@openid4vc/utils' import type { IssuerMetadataResult } from '../metadata/fetch-issuer-metadata' import { type NotificationEvent, diff --git a/packages/oid4vci/tests/full-flow.test.ts b/packages/oid4vci/tests/full-flow.test.ts index c197c40..04572e7 100644 --- a/packages/oid4vci/tests/full-flow.test.ts +++ b/packages/oid4vci/tests/full-flow.test.ts @@ -10,8 +10,8 @@ import { authorizationCodeGrantIdentifier, calculateJwkThumbprint, preAuthorizedCodeGrantIdentifier, -} from '@animo-id/oauth2' -import { ContentType, type HttpMethod, decodeUtf8String, encodeToBase64Url } from '@animo-id/oauth2-utils' +} from '@openid4vc/oauth2' +import { ContentType, type HttpMethod, decodeUtf8String, encodeToBase64Url } from '@openid4vc/utils' import { http, HttpResponse } from 'msw' import { setupServer } from 'msw/node' import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest' diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 0d3b45d..ce0cce5 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,4 +1,4 @@ -# @animo-id/oauth2-utils +# @openid4vc/utils ## 0.1.4 diff --git a/packages/utils/README.md b/packages/utils/README.md index e5aa7cd..ade9353 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -1,25 +1,9 @@ -

- - - - Animo Logo - -

-

OpenID for Verifiable Credentials - OAuth2 Utils

-

Powered by   - - - - Animo Logo - -


-

-Check out the documentation in the [Github repository](https://github.com/animo/oid4vc-ts). +Check out the documentation in the [Github repository](https://github.com/openwallet-foundation-labs/oid4vc-ts). diff --git a/packages/utils/package.json b/packages/utils/package.json index 844b0ea..2846582 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,9 +1,15 @@ { - "name": "@animo-id/oauth2-utils", + "name": "@openid4vc/utils", "version": "0.1.4", "exports": "./src/index.ts", "files": ["dist"], "license": "Apache-2.0", + "homepage": "https://github.com/openwallet-foundation-labs/oid4vc-ts/tree/main/packages/utils", + "repository": { + "type": "git", + "url": "https://github.com/openwallet-foundation-labs/oid4vc-ts", + "directory": "packages/utils" + }, "publishConfig": { "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -21,7 +27,7 @@ "build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap" }, "dependencies": { - "buffer": "^6.0.3", - "valibot": "^0.42.1" + "buffer": "catalog:", + "valibot": "catalog:" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 65d28d0..4bce8dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,18 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +catalogs: + default: + buffer: + specifier: ^6.0.3 + version: 6.0.3 + jose: + specifier: ^5.9.6 + version: 5.9.6 + valibot: + specifier: ^0.42.1 + version: 0.42.1 + importers: .: @@ -29,40 +41,40 @@ importers: packages/oauth2: dependencies: - '@animo-id/oauth2-utils': + '@openid4vc/utils': specifier: workspace:* version: link:../utils valibot: - specifier: ^0.42.1 + specifier: 'catalog:' version: 0.42.1(typescript@5.6.3) devDependencies: jose: - specifier: ^5.9.6 + specifier: 'catalog:' version: 5.9.6 packages/oid4vci: dependencies: - '@animo-id/oauth2': + '@openid4vc/oauth2': specifier: workspace:* version: link:../oauth2 - '@animo-id/oauth2-utils': + '@openid4vc/utils': specifier: workspace:* version: link:../utils valibot: - specifier: ^0.42.1 + specifier: 'catalog:' version: 0.42.1(typescript@5.6.3) devDependencies: jose: - specifier: ^5.9.6 + specifier: 'catalog:' version: 5.9.6 packages/utils: dependencies: buffer: - specifier: ^6.0.3 + specifier: 'catalog:' version: 6.0.3 valibot: - specifier: ^0.42.1 + specifier: 'catalog:' version: 0.42.1(typescript@5.6.3) packages: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f10aa33..f409c65 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,7 @@ packages: - packages/** + +catalog: + valibot: ^0.42.1 + buffer: ^6.0.3 + jose: ^5.9.6