nextidp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Access, ID and logout tokens signed with `Ed25519` are accepted: RFC 9864's fully specified
6
+ name for an Edwards-curve signature. The name it deprecates, `EdDSA`, still works for now and
7
+ will be dropped in a later release, as nextidp for Python already has.
8
+
3
9
  ## 0.3.0
4
10
 
5
11
  ### Pushed authorization requests
@@ -43,7 +43,7 @@ var import_jose = require("jose");
43
43
  var v = __toESM(require("valibot"), 1);
44
44
  var import_errors = require("./errors.js");
45
45
  const ACCESS_TOKEN_TYPES = /* @__PURE__ */ new Set(["at+jwt", "application/at+jwt"]);
46
- const ALGORITHMS = ["RS256", "PS256", "ES256", "EdDSA"];
46
+ const ALGORITHMS = ["RS256", "PS256", "ES256", "Ed25519", "EdDSA"];
47
47
  const BEARER = /^Bearer +([A-Za-z0-9\-._~+/]+=*)\s*$/i;
48
48
  const invalid = (message, cause) => new import_errors.IdpError("invalid_token", message, { status: 401, cause });
49
49
  function bearerToken(authorization) {
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(id_token_exports);
26
26
  var import_jose = require("jose");
27
27
  var import_errors = require("./errors.js");
28
28
  var import_pkce = require("./pkce.js");
29
- const ALLOWED_ALGORITHMS = ["RS256", "PS256", "ES256", "EdDSA"];
29
+ const ALLOWED_ALGORITHMS = ["RS256", "PS256", "ES256", "Ed25519", "EdDSA"];
30
30
  function signingAlgorithms(listed) {
31
31
  const algorithms = listed ? listed.filter((alg) => ALLOWED_ALGORITHMS.includes(alg)) : [];
32
32
  return algorithms.length > 0 ? algorithms : ["RS256"];
@@ -2,7 +2,7 @@ import { decodeProtectedHeader, jwtVerify } from "jose";
2
2
  import * as v from "valibot";
3
3
  import { IdpError } from "./errors.js";
4
4
  const ACCESS_TOKEN_TYPES = /* @__PURE__ */ new Set(["at+jwt", "application/at+jwt"]);
5
- const ALGORITHMS = ["RS256", "PS256", "ES256", "EdDSA"];
5
+ const ALGORITHMS = ["RS256", "PS256", "ES256", "Ed25519", "EdDSA"];
6
6
  const BEARER = /^Bearer +([A-Za-z0-9\-._~+/]+=*)\s*$/i;
7
7
  const invalid = (message, cause) => new IdpError("invalid_token", message, { status: 401, cause });
8
8
  function bearerToken(authorization) {
@@ -1,7 +1,7 @@
1
1
  import { createRemoteJWKSet, jwtVerify } from "jose";
2
2
  import { IdpError } from "./errors.js";
3
3
  import { sameString } from "./pkce.js";
4
- const ALLOWED_ALGORITHMS = ["RS256", "PS256", "ES256", "EdDSA"];
4
+ const ALLOWED_ALGORITHMS = ["RS256", "PS256", "ES256", "Ed25519", "EdDSA"];
5
5
  function signingAlgorithms(listed) {
6
6
  const algorithms = listed ? listed.filter((alg) => ALLOWED_ALGORITHMS.includes(alg)) : [];
7
7
  return algorithms.length > 0 ? algorithms : ["RS256"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextidp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Sign people in to Next.js, Express, Fastify, Hono and Node apps, and protect NestJS, Express, Fastify, Hono and Next.js APIs, with Next-Identity Server, in one call. Runs on Node and edge runtimes.",
5
5
  "keywords": [
6
6
  "oidc",