Skip to content

Commit

Permalink
chore: prepare for migration (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Jan 9, 2025
1 parent 379a9c9 commit 8bbd9e2
Show file tree
Hide file tree
Showing 89 changed files with 200 additions and 223 deletions.
2 changes: 1 addition & 1 deletion .changeset/brave-apricots-provide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@animo-id/oauth2": minor
"@openid4vc/oauth2": minor
---

feat: add client attestations
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"privatePackages": false,
"fixed": [["@animo-id/*"]],
"fixed": [["@openid4vc/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
2 changes: 1 addition & 1 deletion .changeset/old-feet-begin.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@animo-id/oid4vci": minor
"@openid4vc/oid4vci": minor
---

feat: add key attestations
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 15 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,30 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-light-no-text_ok9auy.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-dark-no-text_fqqdq9.svg">
<img alt="Animo Logo" height="250px" />
</picture>
</p>

<h1 align="center" ><b>OpenID for Verifiable Credentials - TypeScript</b></h1>

<h4 align="center">Powered by &nbsp;
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-light-text_cma2yo.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-dark-text_uccvqa.svg">
<img alt="Animo Logo" height="12px" />
</picture>
</h4><br>

<p align="center">
<a href="https://typescriptlang.org">
<img src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" />
<img src="https://imgk.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" />
</a>
</p>

<p align="center">
<a href="#oauth-20---animo-idoauth2">OAuth 2.0</a>
<a href="#oauth-20---openid4vcoauth2">OAuth 2.0</a>
&nbsp;|&nbsp;
<a href="#openid-for-verifiable-credential-issuance---animo-idoid4vc">OpenID for Verifiable Credential Issuance</a>
<a href="#openid-for-verifiable-credential-issuance---openid4vcoid4vc">OpenID for Verifiable Credential Issuance</a>
&nbsp;|&nbsp;
<a href="#supported-environments">Supported Environments</a>
&nbsp;|&nbsp;
<a href="#contributing">Contributing</a>
&nbsp;|&nbsp;
<a href="#license">License</a>
&nbsp;|&nbsp;
<a href="#license">Credits</a>
</p>

---

## 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.

Expand All @@ -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.

Expand All @@ -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
Expand All @@ -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).
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions packages/oauth2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# @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

### Patch Changes

- d4b9279: chore: create github release
- Updated dependencies [d4b9279]
- @animo-id/oauth2-utils@0.1.3
- @openid4vc/utils@0.1.3

## 0.1.2

### Patch Changes

- 1de27e5: chore: correct formatting for publishing
- Updated dependencies [1de27e5]
- @animo-id/oauth2-utils@0.1.2
- @openid4vc/utils@0.1.2

## 0.1.1

### Patch Changes

- 6434781: docs: add readme
- Updated dependencies [6434781]
- @animo-id/oauth2-utils@0.1.1
- @openid4vc/utils@0.1.1

## 0.1.0

Expand All @@ -40,4 +40,4 @@
### Patch Changes

- Updated dependencies [71326c8]
- @animo-id/oauth2-utils@0.1.0
- @openid4vc/utils@0.1.0
18 changes: 1 addition & 17 deletions packages/oauth2/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-light-no-text_ok9auy.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-dark-no-text_fqqdq9.svg">
<img alt="Animo Logo" height="250px" />
</picture>
</p>

<h1 align="center" ><b>OpenID for Verifiable Credentials - OAuth2</b></h1>

<h4 align="center">Powered by &nbsp;
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-light-text_cma2yo.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-dark-text_uccvqa.svg">
<img alt="Animo Logo" height="12px" />
</picture>
</h4><br>

<p align="center">
<a href="https://typescriptlang.org">
<img src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" />
</a>
</p>

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).
14 changes: 10 additions & 4 deletions packages/oauth2/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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:"
}
}
2 changes: 1 addition & 1 deletion packages/oauth2/src/Oauth2AuthorizationServer.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/Oauth2Client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { objectToQueryParams } from '@animo-id/oauth2-utils'
import { objectToQueryParams } from '@openid4vc/utils'
import {
type RetrieveAuthorizationCodeAccessTokenOptions,
type RetrievePreAuthorizedCodeAccessTokenOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/__tests__/Oauth2ResourceServer.test.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/create-access-token.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
6 changes: 3 additions & 3 deletions packages/oauth2/src/access-token/introspect-token.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions packages/oauth2/src/access-token/retrieve-access-token.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/v-access-token-jwt.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/v-access-token.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/v-token-introspection.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/callbacks.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
4 changes: 2 additions & 2 deletions packages/oauth2/src/client-authentication.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/common/jwk/jwk-thumbprint.ts
Original file line number Diff line number Diff line change
@@ -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', [
Expand Down
Loading

0 comments on commit 8bbd9e2

Please sign in to comment.