@coro-ai/runner 0.1.34 → 0.1.36
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/dashboard-dist/assets/{index-C7l2FOsX.js → index-DVdRvXW2.js} +1 -1
- package/dashboard-dist/index.html +1 -1
- package/dist/src/clients/github.d.ts +21 -10
- package/dist/src/clients/github.js +48 -40
- package/dist/src/clients/github.js.map +1 -1
- package/dist/src/cloud/db/postgres-backend.js +21 -13
- package/dist/src/cloud/db/postgres-backend.js.map +1 -1
- package/dist/src/cloud/db/schema.d.ts +1 -1
- package/dist/src/intake/system-prompt.js +3 -0
- package/dist/src/intake/system-prompt.js.map +1 -1
- package/dist/src/jobs/phase-assignment.d.ts +42 -0
- package/dist/src/jobs/phase-assignment.js +46 -43
- package/dist/src/jobs/phase-assignment.js.map +1 -1
- package/dist/src/jobs/runner.js +63 -34
- package/dist/src/jobs/runner.js.map +1 -1
- package/dist/src/plugins/refs.d.ts +50 -1
- package/dist/src/plugins/refs.js +97 -1
- package/dist/src/plugins/refs.js.map +1 -1
- package/dist/src/plugins/registry.d.ts +6 -0
- package/dist/src/plugins/registry.js +11 -2
- package/dist/src/plugins/registry.js.map +1 -1
- package/dist/src/plugins/types.d.ts +1 -1
- package/dist/src/prompt/builder.d.ts +2 -1
- package/dist/src/prompt/builder.js +42 -1
- package/dist/src/prompt/builder.js.map +1 -1
- package/dist/src/runner/build-settings.js +16 -4
- package/dist/src/runner/build-settings.js.map +1 -1
- package/dist/src/state/polling-transport.d.ts +41 -12
- package/dist/src/state/polling-transport.js +95 -56
- package/dist/src/state/polling-transport.js.map +1 -1
- package/dist/src/state/sqlite-backend.js +19 -13
- package/dist/src/state/sqlite-backend.js.map +1 -1
- package/dist/src/tools/run-subagent.js +10 -5
- package/dist/src/tools/run-subagent.js.map +1 -1
- package/node_modules/@coro-ai/cloud-protocol/package.json +1 -1
- package/node_modules/@coro-ai/intelligence-base/layer/agents/coder.md +1 -1
- package/node_modules/@coro-ai/intelligence-base/layer/agents/planner.md +1 -1
- package/node_modules/@coro-ai/intelligence-base/package.json +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.d.ts +58 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.d.ts.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.js +278 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.js.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts +12 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.js +67 -44
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js +4 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts +2 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.js +6 -2
- package/node_modules/@coro-ai/llm-anthropic/dist/index.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.d.ts +11 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.d.ts.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.js +112 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.js.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts +0 -26
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js +40 -106
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/package.json +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/executor.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/executor.js +13 -10
- package/node_modules/@coro-ai/llm-openai/dist/executor.js.map +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/models.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/models.js +3 -0
- package/node_modules/@coro-ai/llm-openai/dist/models.js.map +1 -1
- package/node_modules/@coro-ai/llm-openai/package.json +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts +10 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js +16 -2
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/helpers.d.ts +27 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/helpers.d.ts.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/helpers.js +47 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/helpers.js.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts +65 -4
- package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/package.json +1 -1
- package/node_modules/@hono/node-server/README.md +104 -25
- package/node_modules/@hono/node-server/dist/conninfo.cjs +22 -0
- package/node_modules/@hono/node-server/dist/{conninfo.d.ts → conninfo.d.cts} +4 -3
- package/node_modules/@hono/node-server/dist/conninfo.d.mts +4 -3
- package/node_modules/@hono/node-server/dist/conninfo.mjs +19 -16
- package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +5 -0
- package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +11 -0
- package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1176 -0
- package/node_modules/@hono/node-server/dist/index.d.cts +101 -0
- package/node_modules/@hono/node-server/dist/index.d.mts +101 -8
- package/node_modules/@hono/node-server/dist/index.mjs +1146 -637
- package/node_modules/@hono/node-server/dist/serve-static.cjs +151 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.cts +18 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.mts +14 -13
- package/node_modules/@hono/node-server/dist/serve-static.mjs +143 -145
- package/node_modules/@hono/node-server/dist/utils/response.cjs +8 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.cts +4 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.mts +3 -2
- package/node_modules/@hono/node-server/dist/utils/response.mjs +6 -9
- package/node_modules/@hono/node-server/dist/utils/stream.cjs +65 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.cts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.mts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.mjs +64 -0
- package/node_modules/@hono/node-server/package.json +78 -54
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +1 -12
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts +7 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +9 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +5 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +1 -12
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js +17 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +10 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +21 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +239 -41
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +25 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts +32 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +10 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +2 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +7 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +9 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +5 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +2 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +10 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +21 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +239 -41
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +25 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts +32 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js +57 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +9 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/README.md +15 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/index.js +0 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/package.json +16 -12
- package/node_modules/@modelcontextprotocol/sdk/package.json +4 -3
- package/node_modules/express-rate-limit/dist/index.cjs +6 -1
- package/node_modules/express-rate-limit/dist/index.d.cts +10 -12
- package/node_modules/express-rate-limit/dist/index.d.mts +10 -12
- package/node_modules/express-rate-limit/dist/index.d.ts +10 -12
- package/node_modules/express-rate-limit/dist/index.mjs +6 -1
- package/node_modules/express-rate-limit/package.json +8 -8
- package/node_modules/express-rate-limit/readme.md +2 -2
- package/node_modules/fast-uri/index.js +54 -1
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/security.test.js +198 -0
- package/node_modules/hono/dist/cjs/context.js +28 -13
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +5 -4
- package/node_modules/hono/dist/cjs/hono-base.js +3 -2
- package/node_modules/hono/dist/cjs/jsx/base.js +27 -23
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +4 -1
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +10 -4
- package/node_modules/hono/dist/cjs/request.js +14 -11
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +1 -1
- package/node_modules/hono/dist/cjs/router.js +1 -1
- package/node_modules/hono/dist/cjs/utils/accept.js +1 -1
- package/node_modules/hono/dist/cjs/utils/body.js +6 -0
- package/node_modules/hono/dist/cjs/utils/cookie.js +3 -2
- package/node_modules/hono/dist/cjs/utils/stream.js +5 -2
- package/node_modules/hono/dist/cjs/utils/url.js +8 -8
- package/node_modules/hono/dist/context.js +28 -13
- package/node_modules/hono/dist/helper/proxy/index.js +4 -0
- package/node_modules/hono/dist/helper/streaming/sse.js +5 -4
- package/node_modules/hono/dist/hono-base.js +3 -2
- package/node_modules/hono/dist/jsx/base.js +27 -23
- package/node_modules/hono/dist/jsx/hooks/index.js +16 -13
- package/node_modules/hono/dist/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/middleware/cors/index.js +2 -2
- package/node_modules/hono/dist/middleware/etag/index.js +4 -1
- package/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/middleware/language/language.js +10 -6
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +10 -4
- package/node_modules/hono/dist/request.js +15 -12
- package/node_modules/hono/dist/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/router/trie-router/node.js +1 -1
- package/node_modules/hono/dist/router.js +1 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
- package/node_modules/hono/dist/types/client/types.d.ts +1 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +4 -3
- package/node_modules/hono/dist/types/jsx/base.d.ts +4 -2
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +1 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
- package/node_modules/hono/dist/types/router.d.ts +1 -1
- package/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/hono/dist/utils/accept.js +1 -1
- package/node_modules/hono/dist/utils/body.js +6 -0
- package/node_modules/hono/dist/utils/cookie.js +4 -3
- package/node_modules/hono/dist/utils/stream.js +5 -2
- package/node_modules/hono/dist/utils/url.js +6 -7
- package/node_modules/hono/package.json +10 -3
- package/node_modules/ip-address/README.md +146 -126
- package/node_modules/ip-address/dist/common.d.ts +29 -0
- package/node_modules/ip-address/dist/common.js +44 -5
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +8 -1
- package/node_modules/ip-address/dist/ipv4.js +24 -20
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +68 -3
- package/node_modules/ip-address/dist/ipv6.js +180 -53
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.js +5 -1
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.js +3 -2
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +6 -4
- package/node_modules/jose/README.md +13 -16
- package/node_modules/jose/dist/types/index.d.ts +6 -5
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +17 -11
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +7 -19
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +17 -11
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +7 -19
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +18 -13
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +20 -21
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +8 -12
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -15
- package/node_modules/jose/dist/types/jwks/local.d.ts +12 -21
- package/node_modules/jose/dist/types/jwks/remote.d.ts +34 -165
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +2 -13
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +17 -13
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +2 -13
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +17 -13
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +16 -17
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +18 -15
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +17 -11
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +10 -34
- package/node_modules/jose/dist/types/jwt/sign.d.ts +2 -13
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +4 -13
- package/node_modules/jose/dist/types/jwt/verify.d.ts +14 -13
- package/node_modules/jose/dist/types/key/export.d.ts +0 -14
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +7 -14
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +16 -14
- package/node_modules/jose/dist/types/key/import.d.ts +18 -28
- package/node_modules/jose/dist/types/types.d.ts +239 -222
- package/node_modules/jose/dist/types/util/base64url.d.ts +11 -4
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -9
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
- package/node_modules/jose/dist/types/util/errors.d.ts +128 -121
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +4 -22
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +5 -153
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +16 -111
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +23 -3
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +66 -82
- package/node_modules/jose/dist/webapi/jwk/embedded.js +5 -3
- package/node_modules/jose/dist/webapi/jwks/local.js +32 -73
- package/node_modules/jose/dist/webapi/jwks/remote.js +19 -28
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +5 -2
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +4 -16
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +7 -65
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +3 -89
- package/node_modules/jose/dist/webapi/jws/general/sign.js +19 -15
- package/node_modules/jose/dist/webapi/jws/general/verify.js +29 -9
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +5 -5
- package/node_modules/jose/dist/webapi/jwt/sign.js +2 -3
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +4 -3
- package/node_modules/jose/dist/webapi/jwt/verify.js +6 -6
- package/node_modules/jose/dist/webapi/key/export.js +37 -4
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +33 -82
- package/node_modules/jose/dist/webapi/key/generate_secret.js +2 -2
- package/node_modules/jose/dist/webapi/key/import.js +8 -8
- package/node_modules/jose/dist/webapi/lib/asn1.js +53 -122
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +1 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +34 -109
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +18 -126
- package/node_modules/jose/dist/webapi/lib/helpers.js +23 -0
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -1
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +186 -0
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +110 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +8 -98
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +73 -0
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +74 -0
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +68 -109
- package/node_modules/jose/dist/webapi/lib/key.js +132 -0
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +10 -0
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +162 -92
- package/node_modules/jose/dist/webapi/lib/options.js +48 -0
- package/node_modules/jose/dist/webapi/lib/signing.js +14 -56
- package/node_modules/jose/dist/webapi/lib/type_checks.js +13 -18
- package/node_modules/jose/dist/webapi/util/base64url.js +13 -4
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +2 -2
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -15
- package/node_modules/jose/dist/webapi/util/errors.js +1 -1
- package/node_modules/jose/package.json +2 -4
- package/node_modules/js-yaml/dist/js-yaml.js +5 -2
- package/node_modules/js-yaml/dist/js-yaml.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.min.js +1 -1
- package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.mjs +3 -3
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/lib/type/omap.js +3 -3
- package/node_modules/js-yaml/package.json +1 -1
- package/node_modules/openai/CHANGELOG.md +32 -0
- package/node_modules/openai/azure.d.mts.map +1 -1
- package/node_modules/openai/azure.d.ts.map +1 -1
- package/node_modules/openai/azure.js +5 -1
- package/node_modules/openai/azure.js.map +1 -1
- package/node_modules/openai/azure.mjs +5 -1
- package/node_modules/openai/azure.mjs.map +1 -1
- package/node_modules/openai/helpers/standard-schema.d.mts +104 -0
- package/node_modules/openai/helpers/standard-schema.d.mts.map +1 -0
- package/node_modules/openai/helpers/standard-schema.d.ts +104 -0
- package/node_modules/openai/helpers/standard-schema.d.ts.map +1 -0
- package/node_modules/openai/helpers/standard-schema.js +320 -0
- package/node_modules/openai/helpers/standard-schema.js.map +1 -0
- package/node_modules/openai/helpers/standard-schema.mjs +314 -0
- package/node_modules/openai/helpers/standard-schema.mjs.map +1 -0
- package/node_modules/openai/helpers/zod.d.mts +26 -3
- package/node_modules/openai/helpers/zod.d.mts.map +1 -1
- package/node_modules/openai/helpers/zod.d.ts +26 -3
- package/node_modules/openai/helpers/zod.d.ts.map +1 -1
- package/node_modules/openai/helpers/zod.js +97 -7
- package/node_modules/openai/helpers/zod.js.map +1 -1
- package/node_modules/openai/helpers/zod.mjs +96 -7
- package/node_modules/openai/helpers/zod.mjs.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.js +43 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs +43 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.mts +2 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.mts.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.ts +2 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.ts.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.js +53 -14
- package/node_modules/openai/lib/ChatCompletionStream.js.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.mjs +53 -14
- package/node_modules/openai/lib/ChatCompletionStream.mjs.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.d.mts.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.d.ts.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.js +3 -5
- package/node_modules/openai/lib/ResponsesParser.js.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.mjs +3 -5
- package/node_modules/openai/lib/ResponsesParser.mjs.map +1 -1
- package/node_modules/openai/lib/jsonschema.d.mts +3 -0
- package/node_modules/openai/lib/jsonschema.d.mts.map +1 -1
- package/node_modules/openai/lib/jsonschema.d.ts +3 -0
- package/node_modules/openai/lib/jsonschema.d.ts.map +1 -1
- package/node_modules/openai/lib/transform.d.mts +25 -1
- package/node_modules/openai/lib/transform.d.mts.map +1 -1
- package/node_modules/openai/lib/transform.d.ts +25 -1
- package/node_modules/openai/lib/transform.d.ts.map +1 -1
- package/node_modules/openai/lib/transform.js +1521 -82
- package/node_modules/openai/lib/transform.js.map +1 -1
- package/node_modules/openai/lib/transform.mjs +1515 -82
- package/node_modules/openai/lib/transform.mjs.map +1 -1
- package/node_modules/openai/package.json +1 -1
- package/node_modules/openai/resources/admin/organization/index.d.mts +1 -0
- package/node_modules/openai/resources/admin/organization/index.d.mts.map +1 -1
- package/node_modules/openai/resources/admin/organization/index.d.ts +1 -0
- package/node_modules/openai/resources/admin/organization/index.d.ts.map +1 -1
- package/node_modules/openai/resources/admin/organization/index.js +3 -1
- package/node_modules/openai/resources/admin/organization/index.js.map +1 -1
- package/node_modules/openai/resources/admin/organization/index.mjs +1 -0
- package/node_modules/openai/resources/admin/organization/index.mjs.map +1 -1
- package/node_modules/openai/resources/admin/organization/organization.d.mts +4 -0
- package/node_modules/openai/resources/admin/organization/organization.d.mts.map +1 -1
- package/node_modules/openai/resources/admin/organization/organization.d.ts +4 -0
- package/node_modules/openai/resources/admin/organization/organization.d.ts.map +1 -1
- package/node_modules/openai/resources/admin/organization/organization.js +4 -0
- package/node_modules/openai/resources/admin/organization/organization.js.map +1 -1
- package/node_modules/openai/resources/admin/organization/organization.mjs +4 -0
- package/node_modules/openai/resources/admin/organization/organization.mjs.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/index.d.mts +1 -0
- package/node_modules/openai/resources/admin/organization/projects/index.d.mts.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/index.d.ts +1 -0
- package/node_modules/openai/resources/admin/organization/projects/index.d.ts.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/index.js +3 -1
- package/node_modules/openai/resources/admin/organization/projects/index.js.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/index.mjs +1 -0
- package/node_modules/openai/resources/admin/organization/projects/index.mjs.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/projects.d.mts +4 -0
- package/node_modules/openai/resources/admin/organization/projects/projects.d.mts.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/projects.d.ts +4 -0
- package/node_modules/openai/resources/admin/organization/projects/projects.d.ts.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/projects.js +4 -0
- package/node_modules/openai/resources/admin/organization/projects/projects.js.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/projects.mjs +4 -0
- package/node_modules/openai/resources/admin/organization/projects/projects.mjs.map +1 -1
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.mts +115 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.mts.map +1 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.ts +115 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.ts.map +1 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.js +67 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.js.map +1 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs +63 -0
- package/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs.map +1 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.d.mts +108 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.d.mts.map +1 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.d.ts +108 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.d.ts.map +1 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.js +59 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.js.map +1 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.mjs +55 -0
- package/node_modules/openai/resources/admin/organization/spend-limit.mjs.map +1 -0
- package/node_modules/openai/resources/beta/responses/input-tokens.d.mts +6 -2
- package/node_modules/openai/resources/beta/responses/input-tokens.d.mts.map +1 -1
- package/node_modules/openai/resources/beta/responses/input-tokens.d.ts +6 -2
- package/node_modules/openai/resources/beta/responses/input-tokens.d.ts.map +1 -1
- package/node_modules/openai/resources/beta/responses/responses.d.mts +21 -11
- package/node_modules/openai/resources/beta/responses/responses.d.mts.map +1 -1
- package/node_modules/openai/resources/beta/responses/responses.d.ts +21 -11
- package/node_modules/openai/resources/beta/responses/responses.d.ts.map +1 -1
- package/node_modules/openai/resources/beta/responses/responses.js.map +1 -1
- package/node_modules/openai/resources/beta/responses/responses.mjs.map +1 -1
- package/node_modules/openai/resources/chat/completions/completions.d.mts +4 -3
- package/node_modules/openai/resources/chat/completions/completions.d.mts.map +1 -1
- package/node_modules/openai/resources/chat/completions/completions.d.ts +4 -3
- package/node_modules/openai/resources/chat/completions/completions.d.ts.map +1 -1
- package/node_modules/openai/resources/chat/completions/completions.js.map +1 -1
- package/node_modules/openai/resources/chat/completions/completions.mjs.map +1 -1
- package/node_modules/openai/resources/responses/input-tokens.d.mts +2 -1
- package/node_modules/openai/resources/responses/input-tokens.d.mts.map +1 -1
- package/node_modules/openai/resources/responses/input-tokens.d.ts +2 -1
- package/node_modules/openai/resources/responses/input-tokens.d.ts.map +1 -1
- package/node_modules/openai/resources/responses/responses.d.mts +9 -8
- package/node_modules/openai/resources/responses/responses.d.mts.map +1 -1
- package/node_modules/openai/resources/responses/responses.d.ts +9 -8
- package/node_modules/openai/resources/responses/responses.d.ts.map +1 -1
- package/node_modules/openai/resources/responses/responses.js.map +1 -1
- package/node_modules/openai/resources/responses/responses.mjs.map +1 -1
- package/node_modules/openai/resources/shared.d.mts +4 -1
- package/node_modules/openai/resources/shared.d.mts.map +1 -1
- package/node_modules/openai/resources/shared.d.ts +4 -1
- package/node_modules/openai/resources/shared.d.ts.map +1 -1
- package/node_modules/openai/src/azure.ts +5 -1
- package/node_modules/openai/src/helpers/standard-schema.ts +570 -0
- package/node_modules/openai/src/helpers/zod.ts +158 -29
- package/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts +43 -1
- package/node_modules/openai/src/lib/ChatCompletionStream.ts +56 -8
- package/node_modules/openai/src/lib/ResponsesParser.ts +7 -5
- package/node_modules/openai/src/lib/jsonschema.ts +3 -0
- package/node_modules/openai/src/lib/transform.ts +1930 -103
- package/node_modules/openai/src/resources/admin/organization/index.ts +6 -0
- package/node_modules/openai/src/resources/admin/organization/organization.ts +16 -0
- package/node_modules/openai/src/resources/admin/organization/projects/index.ts +6 -0
- package/node_modules/openai/src/resources/admin/organization/projects/projects.ts +16 -0
- package/node_modules/openai/src/resources/admin/organization/projects/spend-limit.ts +156 -0
- package/node_modules/openai/src/resources/admin/organization/spend-limit.ts +144 -0
- package/node_modules/openai/src/resources/beta/responses/input-tokens.ts +6 -2
- package/node_modules/openai/src/resources/beta/responses/responses.ts +21 -10
- package/node_modules/openai/src/resources/chat/completions/completions.ts +4 -3
- package/node_modules/openai/src/resources/responses/input-tokens.ts +2 -1
- package/node_modules/openai/src/resources/responses/responses.ts +9 -7
- package/node_modules/openai/src/resources/shared.ts +4 -1
- package/node_modules/openai/src/version.ts +1 -1
- package/node_modules/openai/version.d.mts +1 -1
- package/node_modules/openai/version.d.ts +1 -1
- package/node_modules/openai/version.js +1 -1
- package/node_modules/openai/version.mjs +1 -1
- package/node_modules/process-warning/LICENSE +1 -1
- package/node_modules/process-warning/README.md +41 -2
- package/node_modules/process-warning/index.js +85 -17
- package/node_modules/process-warning/package.json +6 -7
- package/node_modules/process-warning/test/emit-once-only.test.js +3 -3
- package/node_modules/process-warning/test/emit-reset.test.js +4 -4
- package/node_modules/process-warning/test/emit-unlimited.test.js +2 -2
- package/node_modules/process-warning/test/spy-warning.test.js +143 -0
- package/node_modules/process-warning/types/index.d.ts +15 -1
- package/node_modules/process-warning/types/index.tst.ts +48 -0
- package/node_modules/ws/package.json +1 -1
- package/package.json +6 -6
- package/node_modules/@hono/node-server/dist/conninfo.js +0 -42
- package/node_modules/@hono/node-server/dist/globals.d.mts +0 -2
- package/node_modules/@hono/node-server/dist/globals.d.ts +0 -2
- package/node_modules/@hono/node-server/dist/globals.js +0 -29
- package/node_modules/@hono/node-server/dist/globals.mjs +0 -5
- package/node_modules/@hono/node-server/dist/index.d.ts +0 -8
- package/node_modules/@hono/node-server/dist/index.js +0 -702
- package/node_modules/@hono/node-server/dist/listener.d.mts +0 -13
- package/node_modules/@hono/node-server/dist/listener.d.ts +0 -13
- package/node_modules/@hono/node-server/dist/listener.js +0 -670
- package/node_modules/@hono/node-server/dist/listener.mjs +0 -635
- package/node_modules/@hono/node-server/dist/request.d.mts +0 -25
- package/node_modules/@hono/node-server/dist/request.d.ts +0 -25
- package/node_modules/@hono/node-server/dist/request.js +0 -238
- package/node_modules/@hono/node-server/dist/request.mjs +0 -206
- package/node_modules/@hono/node-server/dist/response.d.mts +0 -26
- package/node_modules/@hono/node-server/dist/response.d.ts +0 -26
- package/node_modules/@hono/node-server/dist/response.js +0 -112
- package/node_modules/@hono/node-server/dist/response.mjs +0 -85
- package/node_modules/@hono/node-server/dist/serve-static.d.ts +0 -17
- package/node_modules/@hono/node-server/dist/serve-static.js +0 -177
- package/node_modules/@hono/node-server/dist/server.d.mts +0 -10
- package/node_modules/@hono/node-server/dist/server.d.ts +0 -10
- package/node_modules/@hono/node-server/dist/server.js +0 -696
- package/node_modules/@hono/node-server/dist/server.mjs +0 -660
- package/node_modules/@hono/node-server/dist/types.d.mts +0 -44
- package/node_modules/@hono/node-server/dist/types.d.ts +0 -44
- package/node_modules/@hono/node-server/dist/types.js +0 -18
- package/node_modules/@hono/node-server/dist/types.mjs +0 -0
- package/node_modules/@hono/node-server/dist/utils/response/constants.d.mts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response/constants.d.ts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response/constants.js +0 -30
- package/node_modules/@hono/node-server/dist/utils/response/constants.mjs +0 -5
- package/node_modules/@hono/node-server/dist/utils/response.d.ts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response.js +0 -37
- package/node_modules/@hono/node-server/dist/utils.d.mts +0 -9
- package/node_modules/@hono/node-server/dist/utils.d.ts +0 -9
- package/node_modules/@hono/node-server/dist/utils.js +0 -99
- package/node_modules/@hono/node-server/dist/utils.mjs +0 -71
- package/node_modules/@hono/node-server/dist/vercel.d.mts +0 -7
- package/node_modules/@hono/node-server/dist/vercel.d.ts +0 -7
- package/node_modules/@hono/node-server/dist/vercel.js +0 -677
- package/node_modules/@hono/node-server/dist/vercel.mjs +0 -640
- package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
- package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
- package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
- package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
- package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
- package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
- package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
- package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
- package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
- package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
- package/node_modules/process-warning/types/index.test-d.ts +0 -36
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { withAlg as invalidKeyInput } from './invalid_key_input.js';
|
|
2
|
-
import { isKeyLike } from './is_key_like.js';
|
|
3
|
-
import * as jwk from './type_checks.js';
|
|
4
|
-
const tag = (key) => key?.[Symbol.toStringTag];
|
|
5
|
-
const jwkMatchesOp = (alg, key, usage) => {
|
|
6
|
-
if (key.use !== undefined) {
|
|
7
|
-
let expected;
|
|
8
|
-
switch (usage) {
|
|
9
|
-
case 'sign':
|
|
10
|
-
case 'verify':
|
|
11
|
-
expected = 'sig';
|
|
12
|
-
break;
|
|
13
|
-
case 'encrypt':
|
|
14
|
-
case 'decrypt':
|
|
15
|
-
expected = 'enc';
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
if (key.use !== expected) {
|
|
19
|
-
throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (key.alg !== undefined && key.alg !== alg) {
|
|
23
|
-
throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
|
|
24
|
-
}
|
|
25
|
-
if (Array.isArray(key.key_ops)) {
|
|
26
|
-
let expectedKeyOp;
|
|
27
|
-
switch (true) {
|
|
28
|
-
case usage === 'sign' || usage === 'verify':
|
|
29
|
-
case alg === 'dir':
|
|
30
|
-
case alg.includes('CBC-HS'):
|
|
31
|
-
expectedKeyOp = usage;
|
|
32
|
-
break;
|
|
33
|
-
case alg.startsWith('PBES2'):
|
|
34
|
-
expectedKeyOp = 'deriveBits';
|
|
35
|
-
break;
|
|
36
|
-
case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg):
|
|
37
|
-
if (!alg.includes('GCM') && alg.endsWith('KW')) {
|
|
38
|
-
expectedKeyOp = usage === 'encrypt' ? 'wrapKey' : 'unwrapKey';
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
expectedKeyOp = usage;
|
|
42
|
-
}
|
|
43
|
-
break;
|
|
44
|
-
case usage === 'encrypt' && alg.startsWith('RSA'):
|
|
45
|
-
expectedKeyOp = 'wrapKey';
|
|
46
|
-
break;
|
|
47
|
-
case usage === 'decrypt':
|
|
48
|
-
expectedKeyOp = alg.startsWith('RSA') ? 'unwrapKey' : 'deriveBits';
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) {
|
|
52
|
-
throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return true;
|
|
56
|
-
};
|
|
57
|
-
const symmetricTypeCheck = (alg, key, usage) => {
|
|
58
|
-
if (key instanceof Uint8Array)
|
|
59
|
-
return;
|
|
60
|
-
if (jwk.isJWK(key)) {
|
|
61
|
-
if (jwk.isSecretJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
62
|
-
return;
|
|
63
|
-
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
|
|
64
|
-
}
|
|
65
|
-
if (!isKeyLike(key)) {
|
|
66
|
-
throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key', 'Uint8Array'));
|
|
67
|
-
}
|
|
68
|
-
if (key.type !== 'secret') {
|
|
69
|
-
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const asymmetricTypeCheck = (alg, key, usage) => {
|
|
73
|
-
if (jwk.isJWK(key)) {
|
|
74
|
-
switch (usage) {
|
|
75
|
-
case 'decrypt':
|
|
76
|
-
case 'sign':
|
|
77
|
-
if (jwk.isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
78
|
-
return;
|
|
79
|
-
throw new TypeError(`JSON Web Key for this operation must be a private JWK`);
|
|
80
|
-
case 'encrypt':
|
|
81
|
-
case 'verify':
|
|
82
|
-
if (jwk.isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
83
|
-
return;
|
|
84
|
-
throw new TypeError(`JSON Web Key for this operation must be a public JWK`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (!isKeyLike(key)) {
|
|
88
|
-
throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key'));
|
|
89
|
-
}
|
|
90
|
-
if (key.type === 'secret') {
|
|
91
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
92
|
-
}
|
|
93
|
-
if (key.type === 'public') {
|
|
94
|
-
switch (usage) {
|
|
95
|
-
case 'sign':
|
|
96
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
97
|
-
case 'decrypt':
|
|
98
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (key.type === 'private') {
|
|
102
|
-
switch (usage) {
|
|
103
|
-
case 'verify':
|
|
104
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
105
|
-
case 'encrypt':
|
|
106
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
export function checkKeyType(alg, key, usage) {
|
|
111
|
-
switch (alg.substring(0, 2)) {
|
|
112
|
-
case 'A1':
|
|
113
|
-
case 'A2':
|
|
114
|
-
case 'di':
|
|
115
|
-
case 'HS':
|
|
116
|
-
case 'PB':
|
|
117
|
-
symmetricTypeCheck(alg, key, usage);
|
|
118
|
-
break;
|
|
119
|
-
default:
|
|
120
|
-
asymmetricTypeCheck(alg, key, usage);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { encode, concat, uint32be } from './buffer_utils.js';
|
|
2
|
-
import { checkEncCryptoKey } from './crypto_key.js';
|
|
3
|
-
import { digest } from './helpers.js';
|
|
4
|
-
function lengthAndInput(input) {
|
|
5
|
-
return concat(uint32be(input.length), input);
|
|
6
|
-
}
|
|
7
|
-
async function concatKdf(Z, L, OtherInfo) {
|
|
8
|
-
const dkLen = L >> 3;
|
|
9
|
-
const hashLen = 32;
|
|
10
|
-
const reps = Math.ceil(dkLen / hashLen);
|
|
11
|
-
const dk = new Uint8Array(reps * hashLen);
|
|
12
|
-
for (let i = 1; i <= reps; i++) {
|
|
13
|
-
const hashInput = new Uint8Array(4 + Z.length + OtherInfo.length);
|
|
14
|
-
hashInput.set(uint32be(i), 0);
|
|
15
|
-
hashInput.set(Z, 4);
|
|
16
|
-
hashInput.set(OtherInfo, 4 + Z.length);
|
|
17
|
-
const hashResult = await digest('sha256', hashInput);
|
|
18
|
-
dk.set(hashResult, (i - 1) * hashLen);
|
|
19
|
-
}
|
|
20
|
-
return dk.slice(0, dkLen);
|
|
21
|
-
}
|
|
22
|
-
export async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(), apv = new Uint8Array()) {
|
|
23
|
-
checkEncCryptoKey(publicKey, 'ECDH');
|
|
24
|
-
checkEncCryptoKey(privateKey, 'ECDH', 'deriveBits');
|
|
25
|
-
const algorithmID = lengthAndInput(encode(algorithm));
|
|
26
|
-
const partyUInfo = lengthAndInput(apu);
|
|
27
|
-
const partyVInfo = lengthAndInput(apv);
|
|
28
|
-
const suppPubInfo = uint32be(keyLength);
|
|
29
|
-
const suppPrivInfo = new Uint8Array();
|
|
30
|
-
const otherInfo = concat(algorithmID, partyUInfo, partyVInfo, suppPubInfo, suppPrivInfo);
|
|
31
|
-
const Z = new Uint8Array(await crypto.subtle.deriveBits({
|
|
32
|
-
name: publicKey.algorithm.name,
|
|
33
|
-
public: publicKey,
|
|
34
|
-
}, privateKey, getEcdhBitLength(publicKey)));
|
|
35
|
-
return concatKdf(Z, keyLength, otherInfo);
|
|
36
|
-
}
|
|
37
|
-
function getEcdhBitLength(publicKey) {
|
|
38
|
-
if (publicKey.algorithm.name === 'X25519') {
|
|
39
|
-
return 256;
|
|
40
|
-
}
|
|
41
|
-
return (Math.ceil(parseInt(publicKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3);
|
|
42
|
-
}
|
|
43
|
-
export function allowed(key) {
|
|
44
|
-
switch (key.algorithm.namedCurve) {
|
|
45
|
-
case 'P-256':
|
|
46
|
-
case 'P-384':
|
|
47
|
-
case 'P-521':
|
|
48
|
-
return true;
|
|
49
|
-
default:
|
|
50
|
-
return key.algorithm.name === 'X25519';
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { invalidKeyInput } from './invalid_key_input.js';
|
|
2
|
-
import { encode as b64u } from '../util/base64url.js';
|
|
3
|
-
import { isCryptoKey, isKeyObject } from './is_key_like.js';
|
|
4
|
-
export async function keyToJWK(key) {
|
|
5
|
-
if (isKeyObject(key)) {
|
|
6
|
-
if (key.type === 'secret') {
|
|
7
|
-
key = key.export();
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
return key.export({ format: 'jwk' });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (key instanceof Uint8Array) {
|
|
14
|
-
return {
|
|
15
|
-
kty: 'oct',
|
|
16
|
-
k: b64u(key),
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
if (!isCryptoKey(key)) {
|
|
20
|
-
throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'Uint8Array'));
|
|
21
|
-
}
|
|
22
|
-
if (!key.extractable) {
|
|
23
|
-
throw new TypeError('non-extractable CryptoKey cannot be exported as a JWK');
|
|
24
|
-
}
|
|
25
|
-
const { ext, key_ops, alg, use, ...jwk } = await crypto.subtle.exportKey('jwk', key);
|
|
26
|
-
if (jwk.kty === 'AKP') {
|
|
27
|
-
;
|
|
28
|
-
jwk.alg = alg;
|
|
29
|
-
}
|
|
30
|
-
return jwk;
|
|
31
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { isJWK } from './type_checks.js';
|
|
2
|
-
import { decode } from '../util/base64url.js';
|
|
3
|
-
import { jwkToKey } from './jwk_to_key.js';
|
|
4
|
-
import { isCryptoKey, isKeyObject } from './is_key_like.js';
|
|
5
|
-
const unusableForAlg = 'given KeyObject instance cannot be used for this algorithm';
|
|
6
|
-
let cache;
|
|
7
|
-
const handleJWK = async (key, jwk, alg, freeze = false) => {
|
|
8
|
-
cache ||= new WeakMap();
|
|
9
|
-
let cached = cache.get(key);
|
|
10
|
-
if (cached?.[alg]) {
|
|
11
|
-
return cached[alg];
|
|
12
|
-
}
|
|
13
|
-
const cryptoKey = await jwkToKey({ ...jwk, alg });
|
|
14
|
-
if (freeze)
|
|
15
|
-
Object.freeze(key);
|
|
16
|
-
if (!cached) {
|
|
17
|
-
cache.set(key, { [alg]: cryptoKey });
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
cached[alg] = cryptoKey;
|
|
21
|
-
}
|
|
22
|
-
return cryptoKey;
|
|
23
|
-
};
|
|
24
|
-
const handleKeyObject = (keyObject, alg) => {
|
|
25
|
-
cache ||= new WeakMap();
|
|
26
|
-
let cached = cache.get(keyObject);
|
|
27
|
-
if (cached?.[alg]) {
|
|
28
|
-
return cached[alg];
|
|
29
|
-
}
|
|
30
|
-
const isPublic = keyObject.type === 'public';
|
|
31
|
-
const extractable = isPublic ? true : false;
|
|
32
|
-
let cryptoKey;
|
|
33
|
-
if (keyObject.asymmetricKeyType === 'x25519') {
|
|
34
|
-
switch (alg) {
|
|
35
|
-
case 'ECDH-ES':
|
|
36
|
-
case 'ECDH-ES+A128KW':
|
|
37
|
-
case 'ECDH-ES+A192KW':
|
|
38
|
-
case 'ECDH-ES+A256KW':
|
|
39
|
-
break;
|
|
40
|
-
default:
|
|
41
|
-
throw new TypeError(unusableForAlg);
|
|
42
|
-
}
|
|
43
|
-
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, isPublic ? [] : ['deriveBits']);
|
|
44
|
-
}
|
|
45
|
-
if (keyObject.asymmetricKeyType === 'ed25519') {
|
|
46
|
-
if (alg !== 'EdDSA' && alg !== 'Ed25519') {
|
|
47
|
-
throw new TypeError(unusableForAlg);
|
|
48
|
-
}
|
|
49
|
-
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [
|
|
50
|
-
isPublic ? 'verify' : 'sign',
|
|
51
|
-
]);
|
|
52
|
-
}
|
|
53
|
-
switch (keyObject.asymmetricKeyType) {
|
|
54
|
-
case 'ml-dsa-44':
|
|
55
|
-
case 'ml-dsa-65':
|
|
56
|
-
case 'ml-dsa-87': {
|
|
57
|
-
if (alg !== keyObject.asymmetricKeyType.toUpperCase()) {
|
|
58
|
-
throw new TypeError(unusableForAlg);
|
|
59
|
-
}
|
|
60
|
-
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [
|
|
61
|
-
isPublic ? 'verify' : 'sign',
|
|
62
|
-
]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (keyObject.asymmetricKeyType === 'rsa') {
|
|
66
|
-
let hash;
|
|
67
|
-
switch (alg) {
|
|
68
|
-
case 'RSA-OAEP':
|
|
69
|
-
hash = 'SHA-1';
|
|
70
|
-
break;
|
|
71
|
-
case 'RS256':
|
|
72
|
-
case 'PS256':
|
|
73
|
-
case 'RSA-OAEP-256':
|
|
74
|
-
hash = 'SHA-256';
|
|
75
|
-
break;
|
|
76
|
-
case 'RS384':
|
|
77
|
-
case 'PS384':
|
|
78
|
-
case 'RSA-OAEP-384':
|
|
79
|
-
hash = 'SHA-384';
|
|
80
|
-
break;
|
|
81
|
-
case 'RS512':
|
|
82
|
-
case 'PS512':
|
|
83
|
-
case 'RSA-OAEP-512':
|
|
84
|
-
hash = 'SHA-512';
|
|
85
|
-
break;
|
|
86
|
-
default:
|
|
87
|
-
throw new TypeError(unusableForAlg);
|
|
88
|
-
}
|
|
89
|
-
if (alg.startsWith('RSA-OAEP')) {
|
|
90
|
-
return keyObject.toCryptoKey({
|
|
91
|
-
name: 'RSA-OAEP',
|
|
92
|
-
hash,
|
|
93
|
-
}, extractable, isPublic ? ['encrypt'] : ['decrypt']);
|
|
94
|
-
}
|
|
95
|
-
cryptoKey = keyObject.toCryptoKey({
|
|
96
|
-
name: alg.startsWith('PS') ? 'RSA-PSS' : 'RSASSA-PKCS1-v1_5',
|
|
97
|
-
hash,
|
|
98
|
-
}, extractable, [isPublic ? 'verify' : 'sign']);
|
|
99
|
-
}
|
|
100
|
-
if (keyObject.asymmetricKeyType === 'ec') {
|
|
101
|
-
const nist = new Map([
|
|
102
|
-
['prime256v1', 'P-256'],
|
|
103
|
-
['secp384r1', 'P-384'],
|
|
104
|
-
['secp521r1', 'P-521'],
|
|
105
|
-
]);
|
|
106
|
-
const namedCurve = nist.get(keyObject.asymmetricKeyDetails?.namedCurve);
|
|
107
|
-
if (!namedCurve) {
|
|
108
|
-
throw new TypeError(unusableForAlg);
|
|
109
|
-
}
|
|
110
|
-
const expectedCurve = { ES256: 'P-256', ES384: 'P-384', ES512: 'P-521' };
|
|
111
|
-
if (expectedCurve[alg] && namedCurve === expectedCurve[alg]) {
|
|
112
|
-
cryptoKey = keyObject.toCryptoKey({
|
|
113
|
-
name: 'ECDSA',
|
|
114
|
-
namedCurve,
|
|
115
|
-
}, extractable, [isPublic ? 'verify' : 'sign']);
|
|
116
|
-
}
|
|
117
|
-
if (alg.startsWith('ECDH-ES')) {
|
|
118
|
-
cryptoKey = keyObject.toCryptoKey({
|
|
119
|
-
name: 'ECDH',
|
|
120
|
-
namedCurve,
|
|
121
|
-
}, extractable, isPublic ? [] : ['deriveBits']);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (!cryptoKey) {
|
|
125
|
-
throw new TypeError(unusableForAlg);
|
|
126
|
-
}
|
|
127
|
-
if (!cached) {
|
|
128
|
-
cache.set(keyObject, { [alg]: cryptoKey });
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
cached[alg] = cryptoKey;
|
|
132
|
-
}
|
|
133
|
-
return cryptoKey;
|
|
134
|
-
};
|
|
135
|
-
export async function normalizeKey(key, alg) {
|
|
136
|
-
if (key instanceof Uint8Array) {
|
|
137
|
-
return key;
|
|
138
|
-
}
|
|
139
|
-
if (isCryptoKey(key)) {
|
|
140
|
-
return key;
|
|
141
|
-
}
|
|
142
|
-
if (isKeyObject(key)) {
|
|
143
|
-
if (key.type === 'secret') {
|
|
144
|
-
return key.export();
|
|
145
|
-
}
|
|
146
|
-
if ('toCryptoKey' in key && typeof key.toCryptoKey === 'function') {
|
|
147
|
-
try {
|
|
148
|
-
return handleKeyObject(key, alg);
|
|
149
|
-
}
|
|
150
|
-
catch (err) {
|
|
151
|
-
if (err instanceof TypeError) {
|
|
152
|
-
throw err;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
let jwk = key.export({ format: 'jwk' });
|
|
157
|
-
return handleJWK(key, jwk, alg);
|
|
158
|
-
}
|
|
159
|
-
if (isJWK(key)) {
|
|
160
|
-
if (key.k) {
|
|
161
|
-
return decode(key.k);
|
|
162
|
-
}
|
|
163
|
-
return handleJWK(key, key, alg, true);
|
|
164
|
-
}
|
|
165
|
-
throw new Error('unreachable');
|
|
166
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { encode as b64u } from '../util/base64url.js';
|
|
2
|
-
import * as aeskw from './aeskw.js';
|
|
3
|
-
import { checkEncCryptoKey } from './crypto_key.js';
|
|
4
|
-
import { concat, encode } from './buffer_utils.js';
|
|
5
|
-
import { JWEInvalid } from '../util/errors.js';
|
|
6
|
-
function getCryptoKey(key, alg) {
|
|
7
|
-
if (key instanceof Uint8Array) {
|
|
8
|
-
return crypto.subtle.importKey('raw', key, 'PBKDF2', false, [
|
|
9
|
-
'deriveBits',
|
|
10
|
-
]);
|
|
11
|
-
}
|
|
12
|
-
checkEncCryptoKey(key, alg, 'deriveBits');
|
|
13
|
-
return key;
|
|
14
|
-
}
|
|
15
|
-
const concatSalt = (alg, p2sInput) => concat(encode(alg), Uint8Array.of(0x00), p2sInput);
|
|
16
|
-
async function deriveKey(p2s, alg, p2c, key) {
|
|
17
|
-
if (!(p2s instanceof Uint8Array) || p2s.length < 8) {
|
|
18
|
-
throw new JWEInvalid('PBES2 Salt Input must be 8 or more octets');
|
|
19
|
-
}
|
|
20
|
-
if (!Number.isSafeInteger(p2c) || Math.sign(p2c) !== 1) {
|
|
21
|
-
throw new JWEInvalid('PBES2 Count Input must be a positive integer');
|
|
22
|
-
}
|
|
23
|
-
const salt = concatSalt(alg, p2s);
|
|
24
|
-
const keylen = parseInt(alg.slice(13, 16), 10);
|
|
25
|
-
const subtleAlg = {
|
|
26
|
-
hash: `SHA-${alg.slice(8, 11)}`,
|
|
27
|
-
iterations: p2c,
|
|
28
|
-
name: 'PBKDF2',
|
|
29
|
-
salt,
|
|
30
|
-
};
|
|
31
|
-
const cryptoKey = await getCryptoKey(key, alg);
|
|
32
|
-
return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen));
|
|
33
|
-
}
|
|
34
|
-
export async function wrap(alg, key, cek, p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16))) {
|
|
35
|
-
const derived = await deriveKey(p2s, alg, p2c, key);
|
|
36
|
-
const encryptedKey = await aeskw.wrap(alg.slice(-6), derived, cek);
|
|
37
|
-
return { encryptedKey, p2c, p2s: b64u(p2s) };
|
|
38
|
-
}
|
|
39
|
-
export async function unwrap(alg, key, encryptedKey, p2c, p2s) {
|
|
40
|
-
const derived = await deriveKey(p2s, alg, p2c, key);
|
|
41
|
-
return aeskw.unwrap(alg.slice(-6), derived, encryptedKey);
|
|
42
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { checkEncCryptoKey } from './crypto_key.js';
|
|
2
|
-
import { checkKeyLength } from './signing.js';
|
|
3
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
4
|
-
const subtleAlgorithm = (alg) => {
|
|
5
|
-
switch (alg) {
|
|
6
|
-
case 'RSA-OAEP':
|
|
7
|
-
case 'RSA-OAEP-256':
|
|
8
|
-
case 'RSA-OAEP-384':
|
|
9
|
-
case 'RSA-OAEP-512':
|
|
10
|
-
return 'RSA-OAEP';
|
|
11
|
-
default:
|
|
12
|
-
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export async function encrypt(alg, key, cek) {
|
|
16
|
-
checkEncCryptoKey(key, alg, 'encrypt');
|
|
17
|
-
checkKeyLength(alg, key);
|
|
18
|
-
return new Uint8Array(await crypto.subtle.encrypt(subtleAlgorithm(alg), key, cek));
|
|
19
|
-
}
|
|
20
|
-
export async function decrypt(alg, key, encryptedKey) {
|
|
21
|
-
checkEncCryptoKey(key, alg, 'decrypt');
|
|
22
|
-
checkKeyLength(alg, key);
|
|
23
|
-
return new Uint8Array(await crypto.subtle.decrypt(subtleAlgorithm(alg), key, encryptedKey));
|
|
24
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function validateAlgorithms(option, algorithms) {
|
|
2
|
-
if (algorithms !== undefined &&
|
|
3
|
-
(!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string'))) {
|
|
4
|
-
throw new TypeError(`"${option}" option must be an array of strings`);
|
|
5
|
-
}
|
|
6
|
-
if (!algorithms) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
return new Set(algorithms);
|
|
10
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { JOSENotSupported, JWEInvalid, JWSInvalid } from '../util/errors.js';
|
|
2
|
-
export function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
3
|
-
if (joseHeader.crit !== undefined && protectedHeader?.crit === undefined) {
|
|
4
|
-
throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
5
|
-
}
|
|
6
|
-
if (!protectedHeader || protectedHeader.crit === undefined) {
|
|
7
|
-
return new Set();
|
|
8
|
-
}
|
|
9
|
-
if (!Array.isArray(protectedHeader.crit) ||
|
|
10
|
-
protectedHeader.crit.length === 0 ||
|
|
11
|
-
protectedHeader.crit.some((input) => typeof input !== 'string' || input.length === 0)) {
|
|
12
|
-
throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
|
|
13
|
-
}
|
|
14
|
-
let recognized;
|
|
15
|
-
if (recognizedOption !== undefined) {
|
|
16
|
-
recognized = new Map([...Object.entries(recognizedOption), ...recognizedDefault.entries()]);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
recognized = recognizedDefault;
|
|
20
|
-
}
|
|
21
|
-
for (const parameter of protectedHeader.crit) {
|
|
22
|
-
if (!recognized.has(parameter)) {
|
|
23
|
-
throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
|
|
24
|
-
}
|
|
25
|
-
if (joseHeader[parameter] === undefined) {
|
|
26
|
-
throw new Err(`Extension Header Parameter "${parameter}" is missing`);
|
|
27
|
-
}
|
|
28
|
-
if (recognized.get(parameter) && protectedHeader[parameter] === undefined) {
|
|
29
|
-
throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return new Set(protectedHeader.crit);
|
|
33
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { expectType } from 'tsd'
|
|
2
|
-
import { createWarning, createDeprecation } from '..'
|
|
3
|
-
|
|
4
|
-
const WarnInstance = createWarning({
|
|
5
|
-
name: 'TypeScriptWarning',
|
|
6
|
-
code: 'CODE',
|
|
7
|
-
message: 'message'
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
expectType<string>(WarnInstance.code)
|
|
11
|
-
expectType<string>(WarnInstance.message)
|
|
12
|
-
expectType<string>(WarnInstance.name)
|
|
13
|
-
expectType<boolean>(WarnInstance.emitted)
|
|
14
|
-
expectType<boolean>(WarnInstance.unlimited)
|
|
15
|
-
|
|
16
|
-
expectType<void>(WarnInstance())
|
|
17
|
-
expectType<void>(WarnInstance('foo'))
|
|
18
|
-
expectType<void>(WarnInstance('foo', 'bar'))
|
|
19
|
-
|
|
20
|
-
const buildWarnUnlimited = createWarning({
|
|
21
|
-
name: 'TypeScriptWarning',
|
|
22
|
-
code: 'CODE',
|
|
23
|
-
message: 'message',
|
|
24
|
-
unlimited: true
|
|
25
|
-
})
|
|
26
|
-
expectType<boolean>(buildWarnUnlimited.unlimited)
|
|
27
|
-
|
|
28
|
-
const DeprecationInstance = createDeprecation({
|
|
29
|
-
code: 'CODE',
|
|
30
|
-
message: 'message'
|
|
31
|
-
})
|
|
32
|
-
expectType<string>(DeprecationInstance.code)
|
|
33
|
-
|
|
34
|
-
DeprecationInstance()
|
|
35
|
-
DeprecationInstance('foo')
|
|
36
|
-
DeprecationInstance('foo', 'bar')
|