diff --git a/CHANGELOG.md b/CHANGELOG.md index c8f7eb023c..6050abc14a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [4.12.2](https://github.com/panva/jose/compare/v4.12.1...v4.12.2) (2023-02-27) + + +### Fixes + +* **types:** declare explicit return from EmbeddedJWK ([46934ac](https://github.com/panva/jose/commit/46934ac474ba0119976c5ac15cce4ea7bf50de8c)) + ## [4.12.1](https://github.com/panva/jose/compare/v4.12.0...v4.12.1) (2023-02-27) diff --git a/README.md b/README.md index c6ccb86f89..2fec0c18d4 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ const jose = require('jose') **`example`** Deno import ```js -import * as jose from 'https://deno.land/x/jose@v4.12.1/index.ts' +import * as jose from 'https://deno.land/x/jose@v4.12.2/index.ts' ``` - JSON Web Tokens (JWT) diff --git a/dist/deno/README.md b/dist/deno/README.md index 173a302ad6..fa6e72bc68 100644 --- a/dist/deno/README.md +++ b/dist/deno/README.md @@ -2,50 +2,50 @@ > "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto. -## [💗 Help the project](https://github.com/panva/jose/blob/v4.12.1/docs/https://github.com/sponsors/panva) +## [💗 Help the project](https://github.com/panva/jose/blob/v4.12.2/docs/https://github.com/sponsors/panva) ## Available modules **`example`** Deno import ```js -import * as jose from 'https://deno.land/x/jose@v4.12.1/index.ts' +import * as jose from 'https://deno.land/x/jose@v4.12.2/index.ts' ``` - JSON Web Tokens (JWT) - - [Signing](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwt_sign.SignJWT.md#readme) - - [Verification & JWT Claims Set Validation](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwt_verify.jwtVerify.md#readme) + - [Signing](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwt_sign.SignJWT.md#readme) + - [Verification & JWT Claims Set Validation](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwt_verify.jwtVerify.md#readme) - Encrypted JSON Web Tokens - - [Encryption](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwt_encrypt.EncryptJWT.md#readme) - - [Decryption & JWT Claims Set Validation](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwt_decrypt.jwtDecrypt.md#readme) + - [Encryption](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwt_encrypt.EncryptJWT.md#readme) + - [Decryption & JWT Claims Set Validation](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwt_decrypt.jwtDecrypt.md#readme) - Key Import - - [JWK Import](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_import.importJWK.md#readme) - - [Public Key Import (SPKI)](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_import.importSPKI.md#readme) - - [Public Key Import (X.509 Certificate)](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_import.importX509.md#readme) - - [Private Key Import (PKCS #8)](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_import.importPKCS8.md#readme) + - [JWK Import](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_import.importJWK.md#readme) + - [Public Key Import (SPKI)](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_import.importSPKI.md#readme) + - [Public Key Import (X.509 Certificate)](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_import.importX509.md#readme) + - [Private Key Import (PKCS #8)](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_import.importPKCS8.md#readme) - JSON Web Encryption (JWE) - - Encryption - [Compact](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwe_compact_encrypt.CompactEncrypt.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwe_flattened_encrypt.FlattenedEncrypt.md#readme), [General](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwe_general_encrypt.GeneralEncrypt.md#readme) - - Decryption - [Compact](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwe_compact_decrypt.compactDecrypt.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwe_flattened_decrypt.flattenedDecrypt.md#readme), [General](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwe_general_decrypt.generalDecrypt.md#readme) + - Encryption - [Compact](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwe_compact_encrypt.CompactEncrypt.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwe_flattened_encrypt.FlattenedEncrypt.md#readme), [General](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwe_general_encrypt.GeneralEncrypt.md#readme) + - Decryption - [Compact](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwe_compact_decrypt.compactDecrypt.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwe_flattened_decrypt.flattenedDecrypt.md#readme), [General](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwe_general_decrypt.generalDecrypt.md#readme) - JSON Web Signature (JWS) - - Signing - [Compact](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jws_compact_sign.CompactSign.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jws_flattened_sign.FlattenedSign.md#readme), [General](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jws_general_sign.GeneralSign.md#readme) - - Verification - [Compact](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jws_compact_verify.compactVerify.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jws_flattened_verify.flattenedVerify.md#readme), [General](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jws_general_verify.generalVerify.md#readme) + - Signing - [Compact](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jws_compact_sign.CompactSign.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jws_flattened_sign.FlattenedSign.md#readme), [General](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jws_general_sign.GeneralSign.md#readme) + - Verification - [Compact](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jws_compact_verify.compactVerify.md#readme), [Flattened](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jws_flattened_verify.flattenedVerify.md#readme), [General](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jws_general_verify.generalVerify.md#readme) - JSON Web Key (JWK) - - [Calculating JWK Thumbprint](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwk_thumbprint.calculateJwkThumbprint.md#readme) - - [Calculating JWK Thumbprint URI](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwk_thumbprint.calculateJwkThumbprintUri.md#readme) - - [Verification using a JWK Embedded in a JWS Header](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwk_embedded.EmbeddedJWK.md#readme) + - [Calculating JWK Thumbprint](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwk_thumbprint.calculateJwkThumbprint.md#readme) + - [Calculating JWK Thumbprint URI](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwk_thumbprint.calculateJwkThumbprintUri.md#readme) + - [Verification using a JWK Embedded in a JWS Header](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwk_embedded.EmbeddedJWK.md#readme) - JSON Web Key Set (JWKS) - - [Verify using a local JWKSet](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwks_local.createLocalJWKSet.md#readme) - - [Verify using a remote JWKSet](https://github.com/panva/jose/blob/v4.12.1/docs/functions/jwks_remote.createRemoteJWKSet.md#readme) + - [Verify using a local JWKSet](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwks_local.createLocalJWKSet.md#readme) + - [Verify using a remote JWKSet](https://github.com/panva/jose/blob/v4.12.2/docs/functions/jwks_remote.createRemoteJWKSet.md#readme) - Key Pair or Secret Generation - - [Asymmetric Key Pair Generation](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_generate_key_pair.generateKeyPair.md#readme) - - [Symmetric Secret Generation](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_generate_secret.generateSecret.md#readme) + - [Asymmetric Key Pair Generation](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_generate_key_pair.generateKeyPair.md#readme) + - [Symmetric Secret Generation](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_generate_secret.generateSecret.md#readme) - Key Export - - [JWK Export](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_export.exportJWK.md#readme) - - [Private Key Export](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_export.exportPKCS8.md#readme) - - [Public Key Export](https://github.com/panva/jose/blob/v4.12.1/docs/functions/key_export.exportSPKI.md#readme) + - [JWK Export](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_export.exportJWK.md#readme) + - [Private Key Export](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_export.exportPKCS8.md#readme) + - [Public Key Export](https://github.com/panva/jose/blob/v4.12.2/docs/functions/key_export.exportSPKI.md#readme) - Utilities - - [Decoding Token's Protected Header](https://github.com/panva/jose/blob/v4.12.1/docs/functions/util_decode_protected_header.decodeProtectedHeader.md#readme) - - [Decoding JWT Claims Set](https://github.com/panva/jose/blob/v4.12.1/docs/functions/util_decode_jwt.decodeJwt.md#readme) -- [Unsecured JWT](https://github.com/panva/jose/blob/v4.12.1/docs/classes/jwt_unsecured.UnsecuredJWT.md#readme) -- [JOSE Errors](https://github.com/panva/jose/blob/v4.12.1/docs/modules/util_errors.md#readme) + - [Decoding Token's Protected Header](https://github.com/panva/jose/blob/v4.12.2/docs/functions/util_decode_protected_header.decodeProtectedHeader.md#readme) + - [Decoding JWT Claims Set](https://github.com/panva/jose/blob/v4.12.2/docs/functions/util_decode_jwt.decodeJwt.md#readme) +- [Unsecured JWT](https://github.com/panva/jose/blob/v4.12.2/docs/classes/jwt_unsecured.UnsecuredJWT.md#readme) +- [JOSE Errors](https://github.com/panva/jose/blob/v4.12.2/docs/modules/util_errors.md#readme) [support-sponsor]: https://github.com/sponsors/panva diff --git a/dist/deno/jwk/embedded.ts b/dist/deno/jwk/embedded.ts index f56e12fc52..2a69bc0a2c 100644 --- a/dist/deno/jwk/embedded.ts +++ b/dist/deno/jwk/embedded.ts @@ -1,4 +1,4 @@ -import type { FlattenedJWSInput, JWSHeaderParameters } from '../types.d.ts' +import type { KeyLike, FlattenedJWSInput, JWSHeaderParameters } from '../types.d.ts' import { importJWK } from '../key/import.ts' import isObject from '../lib/is_object.ts' import { JWSInvalid } from '../util/errors.ts' @@ -24,7 +24,10 @@ import { JWSInvalid } from '../util/errors.ts' * console.log(payload) * ``` */ -export async function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput) { +export async function EmbeddedJWK( + protectedHeader: JWSHeaderParameters, + token: FlattenedJWSInput, +): Promise { const joseHeader = { ...protectedHeader, ...token.header, diff --git a/dist/types/jwk/embedded.d.ts b/dist/types/jwk/embedded.d.ts index 6f6e160729..d5756b3d18 100644 --- a/dist/types/jwk/embedded.d.ts +++ b/dist/types/jwk/embedded.d.ts @@ -1,4 +1,4 @@ -import type { FlattenedJWSInput, JWSHeaderParameters } from '../types'; +import type { KeyLike, FlattenedJWSInput, JWSHeaderParameters } from '../types'; /** * EmbeddedJWK is an implementation of a GetKeyFunction intended to be used with the JWS/JWT verify * operations whenever you need to opt-in to verify signatures with a public key embedded in the @@ -20,4 +20,4 @@ import type { FlattenedJWSInput, JWSHeaderParameters } from '../types'; * console.log(payload) * ``` */ -export declare function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput): Promise; +export declare function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput): Promise; diff --git a/docs/README.md b/docs/README.md index c015043285..37f907f867 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,7 +18,7 @@ const jose = require('jose') **`example`** Deno import ```js -import * as jose from 'https://deno.land/x/jose@v4.12.1/index.ts' +import * as jose from 'https://deno.land/x/jose@v4.12.2/index.ts' ``` - JSON Web Tokens (JWT) diff --git a/package-lock.json b/package-lock.json index 93f779f682..8f1a533176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jose", - "version": "4.12.1", + "version": "4.12.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jose", - "version": "4.12.1", + "version": "4.12.2", "license": "MIT", "devDependencies": { "@types/node": "^18.11.9", diff --git a/package.json b/package.json index 36b2369406..7601b5e2ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jose", - "version": "4.12.1", + "version": "4.12.2", "description": "'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes", "keywords": [ "browser", diff --git a/src/jwk/embedded.ts b/src/jwk/embedded.ts index b75dc532d9..a538f5cf0d 100644 --- a/src/jwk/embedded.ts +++ b/src/jwk/embedded.ts @@ -1,4 +1,4 @@ -import type { FlattenedJWSInput, JWSHeaderParameters } from '../types.d' +import type { KeyLike, FlattenedJWSInput, JWSHeaderParameters } from '../types.d' import { importJWK } from '../key/import.js' import isObject from '../lib/is_object.js' import { JWSInvalid } from '../util/errors.js' @@ -24,7 +24,10 @@ import { JWSInvalid } from '../util/errors.js' * console.log(payload) * ``` */ -export async function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput) { +export async function EmbeddedJWK( + protectedHeader: JWSHeaderParameters, + token: FlattenedJWSInput, +): Promise { const joseHeader = { ...protectedHeader, ...token.header,