hono 4.13.13 → 5.0.0-rc.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/README.md +2 -2
- package/dist/{types/compose.d.ts → compose.d.ts} +1 -0
- package/dist/compose.js +10 -5
- package/dist/{types/context.d.ts → context.d.ts} +15 -15
- package/dist/context.js +79 -47
- package/dist/helper/factory/define-handler.d.ts +150 -0
- package/dist/helper/factory/define-handler.js +165 -0
- package/dist/{types/helper → helper}/factory/index.d.ts +30 -1
- package/dist/helper/factory/index.js +31 -3
- package/dist/{types/helper → helper}/ssg/middleware.d.ts +0 -6
- package/dist/helper/ssg/middleware.js +1 -16
- package/dist/{types/helper → helper}/ssg/ssg.d.ts +0 -12
- package/dist/helper/ssg/ssg.js +0 -3
- package/dist/{types/hono-base.d.ts → hono-base.d.ts} +3 -60
- package/dist/hono-base.js +6 -97
- package/dist/{types/hono.d.ts → hono.d.ts} +1 -1
- package/dist/{types/middleware → middleware}/basic-auth/index.d.ts +4 -3
- package/dist/middleware/basic-auth/index.js +1 -1
- package/dist/{types/middleware → middleware}/bearer-auth/index.d.ts +4 -27
- package/dist/middleware/bearer-auth/index.js +4 -4
- package/dist/middleware/language/language.js +1 -1
- package/dist/middleware/logger/index.js +6 -8
- package/dist/{types/middleware → middleware}/serve-static/index.d.ts +0 -4
- package/dist/{types/preset → preset}/quick.d.ts +1 -1
- package/dist/{types/preset → preset}/tiny.d.ts +1 -1
- package/dist/{types/request.d.ts → request.d.ts} +3 -48
- package/dist/request.js +0 -49
- package/dist/router/linear-router/router.js +4 -6
- package/dist/router/pattern-router/router.js +2 -2
- package/dist/router/reg-exp-router/node.js +1 -1
- package/dist/router/trie-router/node.js +3 -3
- package/dist/utils/buffer.d.ts +11 -0
- package/dist/utils/buffer.js +1 -8
- package/dist/utils/color.d.ts +16 -0
- package/dist/utils/color.js +7 -23
- package/dist/{types/utils → utils}/http-status.d.ts +1 -9
- package/dist/{types/utils → utils}/url.d.ts +0 -5
- package/dist/utils/url.js +1 -11
- package/dist/{types/validator → validator}/validator.d.ts +5 -0
- package/dist/validator/validator.js +46 -49
- package/package.json +209 -350
- package/dist/adapter/aws-lambda/conninfo.js +0 -43
- package/dist/adapter/aws-lambda/handler.js +0 -342
- package/dist/adapter/aws-lambda/index.js +0 -3
- package/dist/adapter/aws-lambda/types.js +0 -1
- package/dist/adapter/bun/conninfo.js +0 -22
- package/dist/adapter/bun/index.js +0 -6
- package/dist/adapter/bun/serve-static.js +0 -30
- package/dist/adapter/bun/server.js +0 -11
- package/dist/adapter/bun/ssg.js +0 -27
- package/dist/adapter/bun/websocket.js +0 -66
- package/dist/adapter/cloudflare-pages/conninfo.js +0 -24
- package/dist/adapter/cloudflare-pages/handler.js +0 -64
- package/dist/adapter/cloudflare-pages/index.js +0 -3
- package/dist/adapter/cloudflare-workers/conninfo.js +0 -7
- package/dist/adapter/cloudflare-workers/index.js +0 -4
- package/dist/adapter/cloudflare-workers/serve-static-module.js +0 -7
- package/dist/adapter/cloudflare-workers/serve-static.js +0 -28
- package/dist/adapter/cloudflare-workers/utils.js +0 -22
- package/dist/adapter/cloudflare-workers/websocket.js +0 -33
- package/dist/adapter/deno/conninfo.js +0 -17
- package/dist/adapter/deno/deno.d.js +0 -1
- package/dist/adapter/deno/index.js +0 -5
- package/dist/adapter/deno/serve-static.js +0 -35
- package/dist/adapter/deno/ssg.js +0 -29
- package/dist/adapter/deno/websocket.js +0 -32
- package/dist/adapter/lambda-edge/conninfo.js +0 -7
- package/dist/adapter/lambda-edge/handler.js +0 -111
- package/dist/adapter/lambda-edge/index.js +0 -3
- package/dist/adapter/netlify/conninfo.js +0 -24
- package/dist/adapter/netlify/handler.js +0 -11
- package/dist/adapter/netlify/index.js +0 -3
- package/dist/adapter/netlify/mod.js +0 -3
- package/dist/adapter/service-worker/handler.js +0 -16
- package/dist/adapter/service-worker/index.js +0 -25
- package/dist/adapter/service-worker/types.js +0 -1
- package/dist/adapter/vercel/conninfo.js +0 -7
- package/dist/adapter/vercel/handler.js +0 -9
- package/dist/adapter/vercel/index.js +0 -3
- package/dist/cjs/_virtual/_rolldown/runtime.js +0 -33
- package/dist/cjs/adapter/aws-lambda/conninfo.js +0 -44
- package/dist/cjs/adapter/aws-lambda/handler.js +0 -352
- package/dist/cjs/adapter/aws-lambda/index.js +0 -7
- package/dist/cjs/adapter/aws-lambda/types.js +0 -0
- package/dist/cjs/adapter/bun/conninfo.js +0 -23
- package/dist/cjs/adapter/bun/index.js +0 -14
- package/dist/cjs/adapter/bun/serve-static.js +0 -31
- package/dist/cjs/adapter/bun/server.js +0 -12
- package/dist/cjs/adapter/bun/ssg.js +0 -29
- package/dist/cjs/adapter/bun/websocket.js +0 -70
- package/dist/cjs/adapter/cloudflare-pages/conninfo.js +0 -25
- package/dist/cjs/adapter/cloudflare-pages/handler.js +0 -67
- package/dist/cjs/adapter/cloudflare-pages/index.js +0 -7
- package/dist/cjs/adapter/cloudflare-workers/conninfo.js +0 -8
- package/dist/cjs/adapter/cloudflare-workers/index.js +0 -7
- package/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +0 -8
- package/dist/cjs/adapter/cloudflare-workers/serve-static.js +0 -29
- package/dist/cjs/adapter/cloudflare-workers/utils.js +0 -23
- package/dist/cjs/adapter/cloudflare-workers/websocket.js +0 -34
- package/dist/cjs/adapter/deno/conninfo.js +0 -18
- package/dist/cjs/adapter/deno/deno.d.js +0 -0
- package/dist/cjs/adapter/deno/index.js +0 -10
- package/dist/cjs/adapter/deno/serve-static.js +0 -36
- package/dist/cjs/adapter/deno/ssg.js +0 -31
- package/dist/cjs/adapter/deno/websocket.js +0 -33
- package/dist/cjs/adapter/lambda-edge/conninfo.js +0 -8
- package/dist/cjs/adapter/lambda-edge/handler.js +0 -116
- package/dist/cjs/adapter/lambda-edge/index.js +0 -5
- package/dist/cjs/adapter/netlify/conninfo.js +0 -25
- package/dist/cjs/adapter/netlify/handler.js +0 -12
- package/dist/cjs/adapter/netlify/index.js +0 -5
- package/dist/cjs/adapter/netlify/mod.js +0 -5
- package/dist/cjs/adapter/service-worker/handler.js +0 -17
- package/dist/cjs/adapter/service-worker/index.js +0 -27
- package/dist/cjs/adapter/service-worker/types.js +0 -0
- package/dist/cjs/adapter/vercel/conninfo.js +0 -8
- package/dist/cjs/adapter/vercel/handler.js +0 -10
- package/dist/cjs/adapter/vercel/index.js +0 -5
- package/dist/cjs/client/client.js +0 -145
- package/dist/cjs/client/fetch-result-please.js +0 -67
- package/dist/cjs/client/index.js +0 -7
- package/dist/cjs/client/types.js +0 -0
- package/dist/cjs/client/utils.js +0 -70
- package/dist/cjs/compose.js +0 -51
- package/dist/cjs/context.js +0 -383
- package/dist/cjs/helper/accepts/accepts.js +0 -54
- package/dist/cjs/helper/accepts/index.js +0 -3
- package/dist/cjs/helper/adapter/index.js +0 -41
- package/dist/cjs/helper/conninfo/index.js +0 -0
- package/dist/cjs/helper/conninfo/types.js +0 -0
- package/dist/cjs/helper/cookie/index.js +0 -89
- package/dist/cjs/helper/css/common.js +0 -194
- package/dist/cjs/helper/css/index.js +0 -142
- package/dist/cjs/helper/dev/index.js +0 -53
- package/dist/cjs/helper/factory/index.js +0 -33
- package/dist/cjs/helper/html/index.js +0 -34
- package/dist/cjs/helper/proxy/index.js +0 -122
- package/dist/cjs/helper/route/index.js +0 -128
- package/dist/cjs/helper/ssg/index.js +0 -19
- package/dist/cjs/helper/ssg/middleware.js +0 -65
- package/dist/cjs/helper/ssg/plugins.js +0 -68
- package/dist/cjs/helper/ssg/ssg.js +0 -220
- package/dist/cjs/helper/ssg/utils.js +0 -70
- package/dist/cjs/helper/streaming/index.js +0 -8
- package/dist/cjs/helper/streaming/sse.js +0 -59
- package/dist/cjs/helper/streaming/stream.js +0 -26
- package/dist/cjs/helper/streaming/text.js +0 -12
- package/dist/cjs/helper/streaming/utils.js +0 -16
- package/dist/cjs/helper/testing/index.js +0 -18
- package/dist/cjs/helper/websocket/index.js +0 -56
- package/dist/cjs/hono-base.js +0 -351
- package/dist/cjs/hono.js +0 -29
- package/dist/cjs/http-exception.js +0 -56
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/jsx/base.js +0 -266
- package/dist/cjs/jsx/children.js +0 -19
- package/dist/cjs/jsx/components.js +0 -147
- package/dist/cjs/jsx/constants.js +0 -15
- package/dist/cjs/jsx/context.js +0 -170
- package/dist/cjs/jsx/dom/client.js +0 -56
- package/dist/cjs/jsx/dom/components.js +0 -26
- package/dist/cjs/jsx/dom/context.js +0 -43
- package/dist/cjs/jsx/dom/css.js +0 -153
- package/dist/cjs/jsx/dom/hooks/index.js +0 -65
- package/dist/cjs/jsx/dom/index.js +0 -122
- package/dist/cjs/jsx/dom/intrinsic-element/components.js +0 -306
- package/dist/cjs/jsx/dom/jsx-dev-runtime.js +0 -17
- package/dist/cjs/jsx/dom/jsx-runtime.js +0 -5
- package/dist/cjs/jsx/dom/render.js +0 -525
- package/dist/cjs/jsx/dom/server.js +0 -44
- package/dist/cjs/jsx/dom/utils.js +0 -9
- package/dist/cjs/jsx/hooks/index.js +0 -280
- package/dist/cjs/jsx/index.js +0 -89
- package/dist/cjs/jsx/intrinsic-element/common.js +0 -27
- package/dist/cjs/jsx/intrinsic-element/components.js +0 -138
- package/dist/cjs/jsx/intrinsic-elements.js +0 -0
- package/dist/cjs/jsx/jsx-dev-runtime.js +0 -16
- package/dist/cjs/jsx/jsx-runtime.js +0 -37
- package/dist/cjs/jsx/streaming.js +0 -135
- package/dist/cjs/jsx/types.js +0 -0
- package/dist/cjs/jsx/utils.js +0 -116
- package/dist/cjs/middleware/basic-auth/index.js +0 -100
- package/dist/cjs/middleware/bearer-auth/index.js +0 -97
- package/dist/cjs/middleware/body-limit/index.js +0 -69
- package/dist/cjs/middleware/cache/index.js +0 -173
- package/dist/cjs/middleware/combine/index.js +0 -141
- package/dist/cjs/middleware/compress/index.js +0 -82
- package/dist/cjs/middleware/context-storage/index.js +0 -55
- package/dist/cjs/middleware/cors/index.js +0 -109
- package/dist/cjs/middleware/csrf/index.js +0 -106
- package/dist/cjs/middleware/etag/digest.js +0 -62
- package/dist/cjs/middleware/etag/index.js +0 -79
- package/dist/cjs/middleware/ip-restriction/index.js +0 -168
- package/dist/cjs/middleware/jsx-renderer/index.js +0 -104
- package/dist/cjs/middleware/jwk/index.js +0 -3
- package/dist/cjs/middleware/jwk/jwk.js +0 -122
- package/dist/cjs/middleware/jwt/index.js +0 -9
- package/dist/cjs/middleware/jwt/jwt.js +0 -124
- package/dist/cjs/middleware/language/index.js +0 -7
- package/dist/cjs/middleware/language/language.js +0 -208
- package/dist/cjs/middleware/logger/index.js +0 -51
- package/dist/cjs/middleware/method-not-allowed/index.js +0 -84
- package/dist/cjs/middleware/method-override/index.js +0 -105
- package/dist/cjs/middleware/mount/index.js +0 -71
- package/dist/cjs/middleware/powered-by/index.js +0 -25
- package/dist/cjs/middleware/pretty-json/index.js +0 -41
- package/dist/cjs/middleware/request-id/index.js +0 -3
- package/dist/cjs/middleware/request-id/request-id.js +0 -35
- package/dist/cjs/middleware/secure-headers/index.js +0 -4
- package/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -0
- package/dist/cjs/middleware/secure-headers/secure-headers.js +0 -166
- package/dist/cjs/middleware/serve-static/index.js +0 -62
- package/dist/cjs/middleware/serve-static/path.js +0 -17
- package/dist/cjs/middleware/timeout/index.js +0 -42
- package/dist/cjs/middleware/timing/index.js +0 -7
- package/dist/cjs/middleware/timing/timing.js +0 -189
- package/dist/cjs/middleware/trailing-slash/index.js +0 -89
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/preset/quick.js +0 -19
- package/dist/cjs/preset/tiny.js +0 -16
- package/dist/cjs/request/constants.js +0 -5
- package/dist/cjs/request.js +0 -337
- package/dist/cjs/router/linear-router/index.js +0 -3
- package/dist/cjs/router/linear-router/router.js +0 -97
- package/dist/cjs/router/pattern-router/index.js +0 -3
- package/dist/cjs/router/pattern-router/router.js +0 -42
- package/dist/cjs/router/reg-exp-router/index.js +0 -7
- package/dist/cjs/router/reg-exp-router/matcher.js +0 -21
- package/dist/cjs/router/reg-exp-router/node.js +0 -96
- package/dist/cjs/router/reg-exp-router/prepared-router.js +0 -97
- package/dist/cjs/router/reg-exp-router/router.js +0 -102
- package/dist/cjs/router/reg-exp-router/trie.js +0 -74
- package/dist/cjs/router/smart-router/index.js +0 -3
- package/dist/cjs/router/smart-router/router.js +0 -50
- package/dist/cjs/router/trie-router/index.js +0 -3
- package/dist/cjs/router/trie-router/node.js +0 -135
- package/dist/cjs/router/trie-router/router.js +0 -16
- package/dist/cjs/router/utils.js +0 -5
- package/dist/cjs/router.js +0 -40
- package/dist/cjs/types.js +0 -5
- package/dist/cjs/utils/accept.js +0 -194
- package/dist/cjs/utils/basic-auth.js +0 -21
- package/dist/cjs/utils/body.js +0 -97
- package/dist/cjs/utils/buffer.js +0 -55
- package/dist/cjs/utils/color.js +0 -39
- package/dist/cjs/utils/compress.js +0 -12
- package/dist/cjs/utils/concurrent.js +0 -31
- package/dist/cjs/utils/constants.js +0 -8
- package/dist/cjs/utils/cookie.js +0 -129
- package/dist/cjs/utils/crypto.js +0 -38
- package/dist/cjs/utils/encode.js +0 -37
- package/dist/cjs/utils/filepath.js +0 -27
- package/dist/cjs/utils/handler.js +0 -14
- package/dist/cjs/utils/headers.js +0 -0
- package/dist/cjs/utils/html.js +0 -109
- package/dist/cjs/utils/http-status.js +0 -0
- package/dist/cjs/utils/ipaddr.js +0 -247
- package/dist/cjs/utils/jwt/index.js +0 -15
- package/dist/cjs/utils/jwt/jwa.js +0 -25
- package/dist/cjs/utils/jwt/jws.js +0 -135
- package/dist/cjs/utils/jwt/jwt.js +0 -136
- package/dist/cjs/utils/jwt/types.js +0 -124
- package/dist/cjs/utils/jwt/utf8.js +0 -11
- package/dist/cjs/utils/mime.js +0 -80
- package/dist/cjs/utils/stream.js +0 -89
- package/dist/cjs/utils/types.js +0 -0
- package/dist/cjs/utils/url.js +0 -215
- package/dist/cjs/validator/index.js +0 -3
- package/dist/cjs/validator/utils.js +0 -0
- package/dist/cjs/validator/validator.js +0 -65
- package/dist/types/adapter/aws-lambda/conninfo.d.ts +0 -30
- package/dist/types/adapter/aws-lambda/handler.d.ts +0 -230
- package/dist/types/adapter/aws-lambda/index.d.ts +0 -4
- package/dist/types/adapter/aws-lambda/types.d.ts +0 -183
- package/dist/types/adapter/bun/conninfo.d.ts +0 -10
- package/dist/types/adapter/bun/index.d.ts +0 -6
- package/dist/types/adapter/bun/serve-static.d.ts +0 -8
- package/dist/types/adapter/bun/server.d.ts +0 -11
- package/dist/types/adapter/bun/ssg.d.ts +0 -17
- package/dist/types/adapter/bun/websocket.d.ts +0 -54
- package/dist/types/adapter/cloudflare-pages/conninfo.d.ts +0 -24
- package/dist/types/adapter/cloudflare-pages/handler.d.ts +0 -45
- package/dist/types/adapter/cloudflare-pages/index.d.ts +0 -3
- package/dist/types/adapter/cloudflare-workers/conninfo.d.ts +0 -7
- package/dist/types/adapter/cloudflare-workers/index.d.ts +0 -4
- package/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +0 -7
- package/dist/types/adapter/cloudflare-workers/serve-static.d.ts +0 -21
- package/dist/types/adapter/cloudflare-workers/utils.d.ts +0 -13
- package/dist/types/adapter/cloudflare-workers/websocket.d.ts +0 -7
- package/dist/types/adapter/deno/conninfo.d.ts +0 -10
- package/dist/types/adapter/deno/deno.d.ts +0 -1
- package/dist/types/adapter/deno/index.d.ts +0 -5
- package/dist/types/adapter/deno/serve-static.d.ts +0 -8
- package/dist/types/adapter/deno/ssg.d.ts +0 -17
- package/dist/types/adapter/deno/websocket.d.ts +0 -7
- package/dist/types/adapter/lambda-edge/conninfo.d.ts +0 -7
- package/dist/types/adapter/lambda-edge/handler.d.ts +0 -113
- package/dist/types/adapter/lambda-edge/index.d.ts +0 -3
- package/dist/types/adapter/netlify/conninfo.d.ts +0 -24
- package/dist/types/adapter/netlify/handler.d.ts +0 -7
- package/dist/types/adapter/netlify/index.d.ts +0 -3
- package/dist/types/adapter/netlify/mod.d.ts +0 -3
- package/dist/types/adapter/service-worker/handler.d.ts +0 -18
- package/dist/types/adapter/service-worker/index.d.ts +0 -26
- package/dist/types/adapter/service-worker/types.d.ts +0 -17
- package/dist/types/adapter/vercel/conninfo.d.ts +0 -7
- package/dist/types/adapter/vercel/handler.d.ts +0 -7
- package/dist/types/adapter/vercel/index.d.ts +0 -3
- package/dist/types/package.json +0 -3
- package/dist/types/utils/buffer.d.ts +0 -19
- package/dist/types/utils/color.d.ts +0 -23
- package/dist/{types/client → client}/client.d.ts +0 -0
- package/dist/{types/client → client}/fetch-result-please.d.ts +0 -0
- package/dist/{types/client → client}/index.d.ts +0 -0
- package/dist/{types/client → client}/types.d.ts +1 -1
- package/dist/{types/client → client}/utils.d.ts +0 -0
- package/dist/{types/helper → helper}/accepts/accepts.d.ts +0 -0
- package/dist/{types/helper → helper}/accepts/index.d.ts +0 -0
- package/dist/{types/helper → helper}/adapter/index.d.ts +0 -0
- package/dist/{types/helper → helper}/conninfo/index.d.ts +0 -0
- package/dist/{types/helper → helper}/conninfo/types.d.ts +0 -0
- package/dist/{types/helper → helper}/cookie/index.d.ts +0 -0
- package/dist/{types/helper → helper}/css/common.d.ts +0 -0
- package/dist/{types/helper → helper}/css/index.d.ts +0 -0
- package/dist/{types/helper → helper}/dev/index.d.ts +0 -0
- package/dist/{types/helper → helper}/html/index.d.ts +0 -0
- package/dist/{types/helper → helper}/proxy/index.d.ts +0 -0
- package/dist/{types/helper → helper}/route/index.d.ts +0 -0
- package/dist/{types/helper → helper}/ssg/index.d.ts +0 -0
- package/dist/{types/helper → helper}/ssg/plugins.d.ts +0 -0
- package/dist/{types/helper → helper}/ssg/utils.d.ts +0 -0
- package/dist/{types/helper → helper}/streaming/index.d.ts +0 -0
- package/dist/{types/helper → helper}/streaming/sse.d.ts +0 -0
- package/dist/{types/helper → helper}/streaming/stream.d.ts +0 -0
- package/dist/{types/helper → helper}/streaming/text.d.ts +0 -0
- package/dist/{types/helper → helper}/streaming/utils.d.ts +0 -0
- package/dist/{types/helper → helper}/testing/index.d.ts +0 -0
- package/dist/{types/helper → helper}/websocket/index.d.ts +0 -0
- package/dist/{types/http-exception.d.ts → http-exception.d.ts} +0 -0
- package/dist/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/{types/jsx → jsx}/base.d.ts +0 -0
- package/dist/{types/jsx → jsx}/children.d.ts +0 -0
- package/dist/{types/jsx → jsx}/components.d.ts +0 -0
- package/dist/{types/jsx → jsx}/constants.d.ts +0 -0
- package/dist/{types/jsx → jsx}/context.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/client.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/components.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/context.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/css.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/hooks/index.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/index.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/intrinsic-element/components.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/jsx-dev-runtime.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/jsx-runtime.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/render.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/server.d.ts +0 -0
- package/dist/{types/jsx → jsx}/dom/utils.d.ts +0 -0
- package/dist/{types/jsx → jsx}/hooks/index.d.ts +0 -0
- package/dist/{types/jsx → jsx}/index.d.ts +0 -0
- package/dist/{types/jsx → jsx}/intrinsic-element/common.d.ts +0 -0
- package/dist/{types/jsx → jsx}/intrinsic-element/components.d.ts +0 -0
- package/dist/{types/jsx → jsx}/intrinsic-elements.d.ts +0 -0
- package/dist/{types/jsx → jsx}/jsx-dev-runtime.d.ts +0 -0
- package/dist/{types/jsx → jsx}/jsx-runtime.d.ts +0 -0
- package/dist/{types/jsx → jsx}/streaming.d.ts +0 -0
- package/dist/{types/jsx → jsx}/types.d.ts +0 -0
- package/dist/{types/jsx → jsx}/utils.d.ts +0 -0
- package/dist/{types/middleware → middleware}/body-limit/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/cache/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/combine/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/compress/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/context-storage/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/cors/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/csrf/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/etag/digest.d.ts +0 -0
- package/dist/{types/middleware → middleware}/etag/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/ip-restriction/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/jsx-renderer/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/jwk/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/jwk/jwk.d.ts +0 -0
- package/dist/{types/middleware → middleware}/jwt/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/jwt/jwt.d.ts +0 -0
- package/dist/{types/middleware → middleware}/language/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/language/language.d.ts +0 -0
- package/dist/{types/middleware → middleware}/logger/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/method-not-allowed/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/method-override/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/mount/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/powered-by/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/pretty-json/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/request-id/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/request-id/request-id.d.ts +0 -0
- package/dist/{types/middleware → middleware}/secure-headers/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/secure-headers/permissions-policy.d.ts +0 -0
- package/dist/{types/middleware → middleware}/secure-headers/secure-headers.d.ts +0 -0
- package/dist/{types/middleware → middleware}/serve-static/path.d.ts +0 -0
- package/dist/{types/middleware → middleware}/timeout/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/timing/index.d.ts +0 -0
- package/dist/{types/middleware → middleware}/timing/timing.d.ts +0 -0
- package/dist/{types/middleware → middleware}/trailing-slash/index.d.ts +0 -0
- package/dist/{types/request → request}/constants.d.ts +0 -0
- package/dist/{types/router → router}/linear-router/index.d.ts +0 -0
- package/dist/{types/router → router}/linear-router/router.d.ts +0 -0
- package/dist/{types/router → router}/pattern-router/index.d.ts +0 -0
- package/dist/{types/router → router}/pattern-router/router.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/index.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/matcher.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/node.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/prepared-router.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/router.d.ts +0 -0
- package/dist/{types/router → router}/reg-exp-router/trie.d.ts +0 -0
- package/dist/{types/router → router}/smart-router/index.d.ts +0 -0
- package/dist/{types/router → router}/smart-router/router.d.ts +0 -0
- package/dist/{types/router → router}/trie-router/index.d.ts +0 -0
- package/dist/{types/router → router}/trie-router/node.d.ts +0 -0
- package/dist/{types/router → router}/trie-router/router.d.ts +0 -0
- package/dist/{types/router → router}/utils.d.ts +0 -0
- package/dist/{types/router.d.ts → router.d.ts} +0 -0
- package/dist/{types/types.d.ts → types.d.ts} +1 -1
- /package/dist/{types/utils → utils}/accept.d.ts +0 -0
- /package/dist/{types/utils → utils}/basic-auth.d.ts +0 -0
- /package/dist/{types/utils → utils}/body.d.ts +0 -0
- /package/dist/{types/utils → utils}/compress.d.ts +0 -0
- /package/dist/{types/utils → utils}/concurrent.d.ts +0 -0
- /package/dist/{types/utils → utils}/constants.d.ts +0 -0
- /package/dist/{types/utils → utils}/cookie.d.ts +0 -0
- /package/dist/{types/utils → utils}/crypto.d.ts +0 -0
- /package/dist/{types/utils → utils}/encode.d.ts +0 -0
- /package/dist/{types/utils → utils}/filepath.d.ts +0 -0
- /package/dist/{types/utils → utils}/handler.d.ts +0 -0
- /package/dist/{types/utils → utils}/headers.d.ts +0 -0
- /package/dist/{types/utils → utils}/html.d.ts +0 -0
- /package/dist/{types/utils → utils}/ipaddr.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/index.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/jwa.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/jws.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/jwt.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/types.d.ts +0 -0
- /package/dist/{types/utils → utils}/jwt/utf8.d.ts +0 -0
- /package/dist/{types/utils → utils}/mime.d.ts +0 -0
- /package/dist/{types/utils → utils}/stream.d.ts +0 -0
- /package/dist/{types/utils → utils}/types.d.ts +0 -0
- /package/dist/{types/validator → validator}/index.d.ts +0 -0
- /package/dist/{types/validator → validator}/utils.d.ts +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region src/middleware/etag/digest.ts
|
|
3
|
-
const mergeBuffers = (buffer1, buffer2) => {
|
|
4
|
-
if (!buffer1) return buffer2;
|
|
5
|
-
const merged = new Uint8Array(new ArrayBuffer(buffer1.byteLength + buffer2.byteLength));
|
|
6
|
-
merged.set(new Uint8Array(buffer1), 0);
|
|
7
|
-
merged.set(buffer2, buffer1.byteLength);
|
|
8
|
-
return merged;
|
|
9
|
-
};
|
|
10
|
-
const CHUNK_SIZE = 262144;
|
|
11
|
-
const generateDigest = async (stream, generator) => {
|
|
12
|
-
if (!stream) return null;
|
|
13
|
-
let result = void 0;
|
|
14
|
-
let chunk;
|
|
15
|
-
let chunkLength = 0;
|
|
16
|
-
const digest = async (body) => {
|
|
17
|
-
result = await generator(mergeBuffers(result, body));
|
|
18
|
-
};
|
|
19
|
-
const reader = stream.getReader();
|
|
20
|
-
for (;;) {
|
|
21
|
-
const { value, done } = await reader.read();
|
|
22
|
-
if (done) break;
|
|
23
|
-
let offset = 0;
|
|
24
|
-
while (offset < value.byteLength) {
|
|
25
|
-
const remaining = value.byteLength - offset;
|
|
26
|
-
if (chunkLength === 0 && remaining >= CHUNK_SIZE) {
|
|
27
|
-
await digest(value.subarray(offset, offset + CHUNK_SIZE));
|
|
28
|
-
offset += CHUNK_SIZE;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
const requiredLength = chunkLength + remaining;
|
|
32
|
-
if (requiredLength < CHUNK_SIZE) {
|
|
33
|
-
if (!chunk) chunk = value.slice(offset);
|
|
34
|
-
else {
|
|
35
|
-
if (chunk.byteLength < requiredLength) {
|
|
36
|
-
const nextChunk = new Uint8Array(new ArrayBuffer(Math.min(CHUNK_SIZE, Math.max(requiredLength, chunk.byteLength * 2))));
|
|
37
|
-
nextChunk.set(chunk.subarray(0, chunkLength));
|
|
38
|
-
chunk = nextChunk;
|
|
39
|
-
}
|
|
40
|
-
chunk.set(value.subarray(offset), chunkLength);
|
|
41
|
-
}
|
|
42
|
-
chunkLength = requiredLength;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
const length = CHUNK_SIZE - chunkLength;
|
|
46
|
-
if (chunk?.byteLength !== CHUNK_SIZE) {
|
|
47
|
-
const nextChunk = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(CHUNK_SIZE));
|
|
48
|
-
if (chunk) nextChunk.set(chunk.subarray(0, chunkLength));
|
|
49
|
-
chunk = nextChunk;
|
|
50
|
-
}
|
|
51
|
-
chunk.set(value.subarray(offset, offset + length), chunkLength);
|
|
52
|
-
await digest(chunk);
|
|
53
|
-
chunkLength = 0;
|
|
54
|
-
offset += length;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (chunk && chunkLength > 0) await digest(chunk.subarray(0, chunkLength));
|
|
58
|
-
if (!result) return null;
|
|
59
|
-
return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join("");
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
exports.generateDigest = generateDigest;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_middleware_etag_digest = require("./digest.js");
|
|
3
|
-
//#region src/middleware/etag/index.ts
|
|
4
|
-
/**
|
|
5
|
-
* Default headers to pass through on 304 responses. From the spec:
|
|
6
|
-
* > The response must not contain a body and must include the headers that
|
|
7
|
-
* > would have been sent in an equivalent 200 OK response: Cache-Control,
|
|
8
|
-
* > Content-Location, Date, ETag, Expires, and Vary.
|
|
9
|
-
*/
|
|
10
|
-
const RETAINED_304_HEADERS = [
|
|
11
|
-
"cache-control",
|
|
12
|
-
"content-location",
|
|
13
|
-
"date",
|
|
14
|
-
"etag",
|
|
15
|
-
"expires",
|
|
16
|
-
"vary"
|
|
17
|
-
];
|
|
18
|
-
const stripWeak = (tag) => tag.replace(/^W\//, "");
|
|
19
|
-
function etagMatches(etag, ifNoneMatch) {
|
|
20
|
-
return ifNoneMatch != null && ifNoneMatch.split(",").some((t) => stripWeak(t.trim()) === stripWeak(etag));
|
|
21
|
-
}
|
|
22
|
-
function initializeGenerator(generator) {
|
|
23
|
-
if (!generator) {
|
|
24
|
-
if (crypto && crypto.subtle) generator = (body) => crypto.subtle.digest({ name: "SHA-1" }, body);
|
|
25
|
-
}
|
|
26
|
-
return generator;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* ETag Middleware for Hono.
|
|
30
|
-
*
|
|
31
|
-
* @see {@link https://hono.dev/docs/middleware/builtin/etag}
|
|
32
|
-
*
|
|
33
|
-
* @param {ETagOptions} [options] - The options for the ETag middleware.
|
|
34
|
-
* @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value.
|
|
35
|
-
* @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response.
|
|
36
|
-
* @param {function(Uint8Array): ArrayBuffer | Promise<ArrayBuffer>} [options.generateDigest] -
|
|
37
|
-
* A custom digest generation function. By default, it uses 'SHA-1'
|
|
38
|
-
* This function is called with the response body as a `Uint8Array` and should return a hash as an `ArrayBuffer` or a Promise of one.
|
|
39
|
-
* @returns {MiddlewareHandler} The middleware handler function.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const app = new Hono()
|
|
44
|
-
*
|
|
45
|
-
* app.use('/etag/*', etag())
|
|
46
|
-
* app.get('/etag/abc', (c) => {
|
|
47
|
-
* return c.text('Hono is hot')
|
|
48
|
-
* })
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
const etag = (options) => {
|
|
52
|
-
const retainedHeaders = new Set((options?.retainedHeaders ?? RETAINED_304_HEADERS).map((header) => header.toLowerCase()));
|
|
53
|
-
const weak = options?.weak ?? false;
|
|
54
|
-
const generator = initializeGenerator(options?.generateDigest);
|
|
55
|
-
return async function etag(c, next) {
|
|
56
|
-
const ifNoneMatch = c.req.header("If-None-Match") ?? null;
|
|
57
|
-
await next();
|
|
58
|
-
if (!(c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") || !c.res.ok) return;
|
|
59
|
-
const res = c.res;
|
|
60
|
-
let etag = res.headers.get("ETag");
|
|
61
|
-
if (!etag) {
|
|
62
|
-
if (!generator) return;
|
|
63
|
-
const hash = await require_middleware_etag_digest.generateDigest(res.clone().body, generator);
|
|
64
|
-
if (hash === null) return;
|
|
65
|
-
etag = weak ? `W/"${hash}"` : `"${hash}"`;
|
|
66
|
-
}
|
|
67
|
-
if (ifNoneMatch === "*" || etagMatches(etag, ifNoneMatch)) {
|
|
68
|
-
c.res = new Response(null, {
|
|
69
|
-
status: 304,
|
|
70
|
-
statusText: "Not Modified",
|
|
71
|
-
headers: { ETag: etag }
|
|
72
|
-
});
|
|
73
|
-
for (const key of Array.from(c.res.headers.keys())) if (!retainedHeaders.has(key.toLowerCase())) c.res.headers.delete(key);
|
|
74
|
-
} else c.res.headers.set("ETag", etag);
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
//#endregion
|
|
78
|
-
exports.RETAINED_304_HEADERS = RETAINED_304_HEADERS;
|
|
79
|
-
exports.etag = etag;
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_http_exception = require("../../http-exception.js");
|
|
3
|
-
const require_utils_ipaddr = require("../../utils/ipaddr.js");
|
|
4
|
-
//#region src/middleware/ip-restriction/index.ts
|
|
5
|
-
const IS_CIDR_NOTATION_REGEX = /\/[^/]*$/;
|
|
6
|
-
const parseCidrPrefix = (rule, prefix, max) => {
|
|
7
|
-
if (!/^[0-9]{1,3}$/.test(prefix)) throw new TypeError(`Invalid rule: ${rule}`);
|
|
8
|
-
const parsedPrefix = parseInt(prefix);
|
|
9
|
-
if (parsedPrefix > max) throw new TypeError(`Invalid rule: ${rule}`);
|
|
10
|
-
return parsedPrefix;
|
|
11
|
-
};
|
|
12
|
-
const buildMatcher = (rules) => {
|
|
13
|
-
const functionRules = [];
|
|
14
|
-
const staticRules = /* @__PURE__ */ new Set();
|
|
15
|
-
const staticIPv4Rules = /* @__PURE__ */ new Set();
|
|
16
|
-
const staticIPv6Rules = /* @__PURE__ */ new Set();
|
|
17
|
-
const cidrRules = [];
|
|
18
|
-
const registerStaticRule = (rule) => {
|
|
19
|
-
const type = require_utils_ipaddr.distinctRemoteAddr(rule);
|
|
20
|
-
if (type === void 0) throw new TypeError(`Invalid rule: ${rule}`);
|
|
21
|
-
if (type === "IPv4") {
|
|
22
|
-
const ipv4binary = require_utils_ipaddr.convertIPv4ToBinary(rule);
|
|
23
|
-
staticRules.add(rule);
|
|
24
|
-
staticRules.add(`::ffff:${rule}`);
|
|
25
|
-
staticIPv4Rules.add(ipv4binary);
|
|
26
|
-
staticIPv6Rules.add(65535n << 32n | ipv4binary);
|
|
27
|
-
} else {
|
|
28
|
-
const ipv6binary = require_utils_ipaddr.convertIPv6ToBinary(rule);
|
|
29
|
-
const ipv6Addr = require_utils_ipaddr.convertIPv6BinaryToString(ipv6binary);
|
|
30
|
-
staticRules.add(ipv6Addr);
|
|
31
|
-
staticIPv6Rules.add(ipv6binary);
|
|
32
|
-
if (require_utils_ipaddr.isIPv4MappedIPv6(ipv6binary)) {
|
|
33
|
-
staticRules.add(ipv6Addr.substring(7));
|
|
34
|
-
staticIPv4Rules.add(require_utils_ipaddr.convertIPv4MappedIPv6ToIPv4(ipv6binary));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
for (let rule of rules) if (rule === "*") return () => true;
|
|
39
|
-
else if (typeof rule === "function") functionRules.push(rule);
|
|
40
|
-
else {
|
|
41
|
-
if (IS_CIDR_NOTATION_REGEX.test(rule)) {
|
|
42
|
-
const separatedRule = rule.split("/");
|
|
43
|
-
const addrStr = separatedRule[0];
|
|
44
|
-
const type = require_utils_ipaddr.distinctRemoteAddr(addrStr);
|
|
45
|
-
if (type === void 0) throw new TypeError(`Invalid rule: ${rule}`);
|
|
46
|
-
let isIPv4 = type === "IPv4";
|
|
47
|
-
let prefix = parseCidrPrefix(rule, separatedRule[1], isIPv4 ? 32 : 128);
|
|
48
|
-
if (isIPv4 ? prefix === 32 : prefix === 128) rule = addrStr;
|
|
49
|
-
else {
|
|
50
|
-
let addr = (isIPv4 ? require_utils_ipaddr.convertIPv4ToBinary : require_utils_ipaddr.convertIPv6ToBinary)(addrStr);
|
|
51
|
-
if (type === "IPv6" && require_utils_ipaddr.isIPv4MappedIPv6(addr) && prefix >= 96) {
|
|
52
|
-
isIPv4 = true;
|
|
53
|
-
addr = require_utils_ipaddr.convertIPv4MappedIPv6ToIPv4(addr);
|
|
54
|
-
prefix -= 96;
|
|
55
|
-
}
|
|
56
|
-
const mask = (1n << BigInt(prefix)) - 1n << BigInt((isIPv4 ? 32 : 128) - prefix);
|
|
57
|
-
cidrRules.push([
|
|
58
|
-
isIPv4,
|
|
59
|
-
addr & mask,
|
|
60
|
-
mask
|
|
61
|
-
]);
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
registerStaticRule(rule);
|
|
66
|
-
}
|
|
67
|
-
return (remote) => {
|
|
68
|
-
if (staticRules.has(remote.addr)) return true;
|
|
69
|
-
const remoteAddr = remote.binaryAddr ||= (remote.isIPv4 ? require_utils_ipaddr.convertIPv4ToBinary : require_utils_ipaddr.convertIPv6ToBinary)(remote.addr);
|
|
70
|
-
const remoteIPv4Addr = remote.isIPv4 || require_utils_ipaddr.isIPv4MappedIPv6(remoteAddr) ? remote.isIPv4 ? remoteAddr : require_utils_ipaddr.convertIPv4MappedIPv6ToIPv4(remoteAddr) : void 0;
|
|
71
|
-
if ((remote.isIPv4 ? staticIPv4Rules : staticIPv6Rules).has(remoteAddr)) return true;
|
|
72
|
-
for (const [isIPv4, addr, mask] of cidrRules) {
|
|
73
|
-
if (isIPv4) {
|
|
74
|
-
if (remoteIPv4Addr === void 0) continue;
|
|
75
|
-
if ((remoteIPv4Addr & mask) === addr) return true;
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
if (remote.isIPv4) continue;
|
|
79
|
-
if ((remoteAddr & mask) === addr) return true;
|
|
80
|
-
}
|
|
81
|
-
for (const rule of functionRules) if (rule({
|
|
82
|
-
addr: remote.addr,
|
|
83
|
-
type: remote.type
|
|
84
|
-
})) return true;
|
|
85
|
-
return false;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* IP Restriction Middleware for Hono.
|
|
90
|
-
*
|
|
91
|
-
* @see {@link https://hono.dev/docs/middleware/builtin/ip-restriction}
|
|
92
|
-
*
|
|
93
|
-
* @param {GetConnInfo | ((c: Context) => string)} getIP - A function to retrieve the client IP address. Use `getConnInfo` from the appropriate runtime adapter.
|
|
94
|
-
* @param {IPRestrictionRules} rules - An object with optional `denyList` and `allowList` arrays of IP rules. Each rule can be a static IP, a CIDR range, or a custom function.
|
|
95
|
-
* @param {(remote: { addr: string; type: AddressType }, c: Context) => Response | Promise<Response>} [onError] - Optional custom handler invoked when a request is blocked. Defaults to returning a 403 Forbidden response.
|
|
96
|
-
* @returns {MiddlewareHandler} The middleware handler function.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```ts
|
|
100
|
-
* import { Hono } from 'hono'
|
|
101
|
-
* import { ipRestriction } from 'hono/ip-restriction'
|
|
102
|
-
* import { getConnInfo } from 'hono/cloudflare-workers'
|
|
103
|
-
*
|
|
104
|
-
* const app = new Hono()
|
|
105
|
-
*
|
|
106
|
-
* app.use(
|
|
107
|
-
* '*',
|
|
108
|
-
* ipRestriction(getConnInfo, {
|
|
109
|
-
* // Block a specific IP and an entire subnet
|
|
110
|
-
* denyList: ['192.168.0.5', '10.0.0.0/8'],
|
|
111
|
-
* // Only allow requests from localhost and a private range
|
|
112
|
-
* allowList: ['127.0.0.1', '::1', '192.168.1.0/24'],
|
|
113
|
-
* })
|
|
114
|
-
* )
|
|
115
|
-
*
|
|
116
|
-
* // With a custom error handler
|
|
117
|
-
* app.use(
|
|
118
|
-
* '/admin/*',
|
|
119
|
-
* ipRestriction(
|
|
120
|
-
* getConnInfo,
|
|
121
|
-
* { allowList: ['203.0.113.0/24'] },
|
|
122
|
-
* (remote, c) => c.text(`Access denied for ${remote.addr}`, 403)
|
|
123
|
-
* )
|
|
124
|
-
* )
|
|
125
|
-
*
|
|
126
|
-
* app.get('/', (c) => c.text('Hello!'))
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
const ipRestriction = (getIP, { denyList = [], allowList = [] }, onError) => {
|
|
130
|
-
const allowLength = allowList.length;
|
|
131
|
-
const denyMatcher = buildMatcher(denyList);
|
|
132
|
-
const allowMatcher = buildMatcher(allowList);
|
|
133
|
-
const blockError = (c) => new require_http_exception.HTTPException(403, { res: c.text("Forbidden", { status: 403 }) });
|
|
134
|
-
return async function ipRestriction(c, next) {
|
|
135
|
-
const connInfo = getIP(c);
|
|
136
|
-
const addr = typeof connInfo === "string" ? connInfo : connInfo.remote.address;
|
|
137
|
-
if (!addr) throw blockError(c);
|
|
138
|
-
const type = typeof connInfo !== "string" && connInfo.remote.addressType || require_utils_ipaddr.distinctRemoteAddr(addr);
|
|
139
|
-
const remoteData = {
|
|
140
|
-
addr,
|
|
141
|
-
type,
|
|
142
|
-
isIPv4: type === "IPv4"
|
|
143
|
-
};
|
|
144
|
-
try {
|
|
145
|
-
if (denyMatcher(remoteData)) {
|
|
146
|
-
if (onError) return onError({
|
|
147
|
-
addr,
|
|
148
|
-
type
|
|
149
|
-
}, c);
|
|
150
|
-
throw blockError(c);
|
|
151
|
-
}
|
|
152
|
-
if (allowMatcher(remoteData)) return await next();
|
|
153
|
-
} catch (e) {
|
|
154
|
-
if (e instanceof TypeError && e.code === "ERR_INVALID_IP_ADDRESS") throw blockError(c);
|
|
155
|
-
throw e;
|
|
156
|
-
}
|
|
157
|
-
if (allowLength === 0) return await next();
|
|
158
|
-
else {
|
|
159
|
-
if (onError) return await onError({
|
|
160
|
-
addr,
|
|
161
|
-
type
|
|
162
|
-
}, c);
|
|
163
|
-
throw blockError(c);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
//#endregion
|
|
168
|
-
exports.ipRestriction = ipRestriction;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_html = require("../../utils/html.js");
|
|
3
|
-
const require_helper_html_index = require("../../helper/html/index.js");
|
|
4
|
-
const require_jsx_context = require("../../jsx/context.js");
|
|
5
|
-
const require_jsx_base = require("../../jsx/base.js");
|
|
6
|
-
const require_jsx_streaming = require("../../jsx/streaming.js");
|
|
7
|
-
require("../../jsx/index.js");
|
|
8
|
-
//#region src/middleware/jsx-renderer/index.ts
|
|
9
|
-
const RequestContext = require_jsx_context.createContext(null);
|
|
10
|
-
const createRenderer = (c, Layout, component, options) => (children, props) => {
|
|
11
|
-
options = typeof options === "function" ? options(c) : options;
|
|
12
|
-
const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : "<!DOCTYPE html>";
|
|
13
|
-
const currentLayout = component ? require_jsx_base.jsx((props) => component(props, c), {
|
|
14
|
-
Layout,
|
|
15
|
-
...props
|
|
16
|
-
}, children) : children;
|
|
17
|
-
const body = require_helper_html_index.html`${require_utils_html.raw(docType)}${require_jsx_base.jsx(RequestContext.Provider, { value: c }, currentLayout)}`;
|
|
18
|
-
if (options?.stream) {
|
|
19
|
-
if (options.stream === true) {
|
|
20
|
-
c.header("Transfer-Encoding", "chunked");
|
|
21
|
-
c.header("Content-Type", "text/html; charset=UTF-8");
|
|
22
|
-
c.header("Content-Encoding", "Identity");
|
|
23
|
-
} else for (const [key, value] of Object.entries(options.stream)) c.header(key, value);
|
|
24
|
-
return c.body(require_jsx_streaming.renderToReadableStream(body));
|
|
25
|
-
} else return c.html(body);
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* JSX Renderer Middleware for hono.
|
|
29
|
-
*
|
|
30
|
-
* @see {@link https://hono.dev/docs/middleware/builtin/jsx-renderer}
|
|
31
|
-
*
|
|
32
|
-
* @param {ComponentWithChildren} [component] - The component to render, which can accept children and props.
|
|
33
|
-
* @param {RendererOptions} [options] - The options for the JSX renderer middleware.
|
|
34
|
-
* @param {boolean | string} [options.docType=true] - The DOCTYPE to be added at the beginning of the HTML. If set to false, no DOCTYPE will be added.
|
|
35
|
-
* @param {boolean | Record<string, string>} [options.stream=false] - If set to true, enables streaming response with default headers. If a record is provided, custom headers will be used.
|
|
36
|
-
* @returns {MiddlewareHandler} The middleware handler function.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const app = new Hono()
|
|
41
|
-
*
|
|
42
|
-
* app.get(
|
|
43
|
-
* '/page/*',
|
|
44
|
-
* jsxRenderer(({ children }) => {
|
|
45
|
-
* return (
|
|
46
|
-
* <html>
|
|
47
|
-
* <body>
|
|
48
|
-
* <header>Menu</header>
|
|
49
|
-
* <div>{children}</div>
|
|
50
|
-
* </body>
|
|
51
|
-
* </html>
|
|
52
|
-
* )
|
|
53
|
-
* })
|
|
54
|
-
* )
|
|
55
|
-
*
|
|
56
|
-
* app.get('/page/about', (c) => {
|
|
57
|
-
* return c.render(<h1>About me!</h1>)
|
|
58
|
-
* })
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
const jsxRenderer = (component, options) => function jsxRenderer(c, next) {
|
|
62
|
-
const Layout = c.getLayout() ?? require_jsx_base.Fragment;
|
|
63
|
-
if (component) c.setLayout((props) => {
|
|
64
|
-
return component({
|
|
65
|
-
...props,
|
|
66
|
-
Layout
|
|
67
|
-
}, c);
|
|
68
|
-
});
|
|
69
|
-
c.setRenderer(createRenderer(c, Layout, component, options));
|
|
70
|
-
return next();
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* useRequestContext for Hono.
|
|
74
|
-
*
|
|
75
|
-
* @template E - The environment type.
|
|
76
|
-
* @template P - The parameter type.
|
|
77
|
-
* @template I - The input type.
|
|
78
|
-
* @returns {Context<E, P, I>} An instance of Context.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const RequestUrlBadge: FC = () => {
|
|
83
|
-
* const c = useRequestContext()
|
|
84
|
-
* return <b>{c.req.url}</b>
|
|
85
|
-
* }
|
|
86
|
-
*
|
|
87
|
-
* app.get('/page/info', (c) => {
|
|
88
|
-
* return c.render(
|
|
89
|
-
* <div>
|
|
90
|
-
* You are accessing: <RequestUrlBadge />
|
|
91
|
-
* </div>
|
|
92
|
-
* )
|
|
93
|
-
* })
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
const useRequestContext = () => {
|
|
97
|
-
const c = require_jsx_context.useContext(RequestContext);
|
|
98
|
-
if (!c) throw new Error("RequestContext is not provided.");
|
|
99
|
-
return c;
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
exports.RequestContext = RequestContext;
|
|
103
|
-
exports.jsxRenderer = jsxRenderer;
|
|
104
|
-
exports.useRequestContext = useRequestContext;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_http_exception = require("../../http-exception.js");
|
|
3
|
-
const require_helper_cookie_index = require("../../helper/cookie/index.js");
|
|
4
|
-
const require_utils_jwt_index = require("../../utils/jwt/index.js");
|
|
5
|
-
//#region src/middleware/jwk/jwk.ts
|
|
6
|
-
/**
|
|
7
|
-
* JWK Auth Middleware for Hono.
|
|
8
|
-
*
|
|
9
|
-
* @see {@link https://hono.dev/docs/middleware/builtin/jwk}
|
|
10
|
-
*
|
|
11
|
-
* @param {object} options - The options for the JWK middleware.
|
|
12
|
-
* @param {HonoJsonWebKey[] | ((ctx: Context) => Promise<HonoJsonWebKey[]> | HonoJsonWebKey[])} [options.keys] - The public keys used for JWK verification, or a function that returns them.
|
|
13
|
-
* @param {string | ((ctx: Context) => Promise<string> | string)} [options.jwks_uri] - If set to a URI string or a function that returns a URI string, attempt to fetch JWKs from it. The response must be a JSON object containing a `keys` array, which will be merged with the `keys` option.
|
|
14
|
-
* @param {boolean} [options.allow_anon] - If set to `true`, the middleware allows requests without a token to proceed without authentication.
|
|
15
|
-
* @param {string} [options.cookie] - If set, the middleware attempts to retrieve the token from a cookie with these options (optionally signed) only if no token is found in the header.
|
|
16
|
-
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
|
|
17
|
-
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
|
|
18
|
-
* @param {AsymmetricAlgorithm[]} options.alg - An array of allowed asymmetric algorithms for JWT verification. Only tokens signed with these algorithms will be accepted.
|
|
19
|
-
* @param {RequestInit} [init] - Optional init options for the `fetch` request when retrieving JWKS from a URI.
|
|
20
|
-
* @param {VerifyOptions} [options.verification] - Additional options for JWK payload verification.
|
|
21
|
-
* @returns {MiddlewareHandler} The middleware handler function.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const app = new Hono()
|
|
26
|
-
*
|
|
27
|
-
* app.use("/auth/*", jwk({
|
|
28
|
-
* jwks_uri: (c) => `https://${c.env.authServer}/.well-known/jwks.json`,
|
|
29
|
-
* headerName: 'x-custom-auth-header', // Optional, default is 'Authorization'
|
|
30
|
-
* }))
|
|
31
|
-
*
|
|
32
|
-
* app.get('/auth/page', (c) => {
|
|
33
|
-
* return c.text('You are authorized')
|
|
34
|
-
* })
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
const jwk = (options, init) => {
|
|
38
|
-
const verifyOpts = options.verification || {};
|
|
39
|
-
if (!options || !(options.keys || options.jwks_uri)) throw new Error("JWK auth middleware requires options for either \"keys\" or \"jwks_uri\" or both");
|
|
40
|
-
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it.");
|
|
41
|
-
return async function jwk(ctx, next) {
|
|
42
|
-
const headerName = options.headerName || "Authorization";
|
|
43
|
-
const credentials = ctx.req.raw.headers.get(headerName);
|
|
44
|
-
let token;
|
|
45
|
-
if (credentials) {
|
|
46
|
-
const parts = credentials.split(/\s+/);
|
|
47
|
-
if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") {
|
|
48
|
-
const errDescription = "invalid credentials structure";
|
|
49
|
-
throw new require_http_exception.HTTPException(401, {
|
|
50
|
-
message: errDescription,
|
|
51
|
-
res: unauthorizedResponse({
|
|
52
|
-
ctx,
|
|
53
|
-
error: "invalid_request",
|
|
54
|
-
errDescription,
|
|
55
|
-
realm: options.realm
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
} else token = parts[1];
|
|
59
|
-
} else if (options.cookie) {
|
|
60
|
-
if (typeof options.cookie == "string") token = require_helper_cookie_index.getCookie(ctx, options.cookie);
|
|
61
|
-
else if (options.cookie.secret) {
|
|
62
|
-
if (options.cookie.prefixOptions) token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key, options.cookie.prefixOptions);
|
|
63
|
-
else token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key);
|
|
64
|
-
} else if (options.cookie.prefixOptions) token = require_helper_cookie_index.getCookie(ctx, options.cookie.key, options.cookie.prefixOptions);
|
|
65
|
-
else token = require_helper_cookie_index.getCookie(ctx, options.cookie.key);
|
|
66
|
-
}
|
|
67
|
-
if (!token) {
|
|
68
|
-
if (options.allow_anon) return next();
|
|
69
|
-
const errDescription = "no authorization included in request";
|
|
70
|
-
throw new require_http_exception.HTTPException(401, {
|
|
71
|
-
message: errDescription,
|
|
72
|
-
res: unauthorizedResponse({
|
|
73
|
-
ctx,
|
|
74
|
-
error: "invalid_request",
|
|
75
|
-
errDescription,
|
|
76
|
-
realm: options.realm
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
let payload;
|
|
81
|
-
let cause;
|
|
82
|
-
try {
|
|
83
|
-
const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys;
|
|
84
|
-
const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri;
|
|
85
|
-
payload = await require_utils_jwt_index.Jwt.verifyWithJwks(token, {
|
|
86
|
-
keys,
|
|
87
|
-
jwks_uri,
|
|
88
|
-
verification: verifyOpts,
|
|
89
|
-
allowedAlgorithms: options.alg
|
|
90
|
-
}, init);
|
|
91
|
-
} catch (e) {
|
|
92
|
-
cause = e;
|
|
93
|
-
}
|
|
94
|
-
if (!payload) {
|
|
95
|
-
if (cause instanceof Error && cause.constructor === Error) throw cause;
|
|
96
|
-
throw new require_http_exception.HTTPException(401, {
|
|
97
|
-
message: "Unauthorized",
|
|
98
|
-
res: unauthorizedResponse({
|
|
99
|
-
ctx,
|
|
100
|
-
error: "invalid_token",
|
|
101
|
-
statusText: "Unauthorized",
|
|
102
|
-
errDescription: "token verification failure",
|
|
103
|
-
realm: options.realm
|
|
104
|
-
}),
|
|
105
|
-
cause
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
ctx.set("jwtPayload", payload);
|
|
109
|
-
await next();
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
function unauthorizedResponse(opts) {
|
|
113
|
-
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
|
|
114
|
-
const errDescription = opts.errDescription.replace(/"/g, "\\\"");
|
|
115
|
-
return new Response("Unauthorized", {
|
|
116
|
-
status: 401,
|
|
117
|
-
statusText: opts.statusText,
|
|
118
|
-
headers: { "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` }
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
exports.jwk = jwk;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_jwt_jwa = require("../../utils/jwt/jwa.js");
|
|
3
|
-
const require_middleware_jwt_jwt = require("./jwt.js");
|
|
4
|
-
exports.AlgorithmTypes = require_utils_jwt_jwa.AlgorithmTypes;
|
|
5
|
-
exports.decode = require_middleware_jwt_jwt.decode;
|
|
6
|
-
exports.jwt = require_middleware_jwt_jwt.jwt;
|
|
7
|
-
exports.sign = require_middleware_jwt_jwt.sign;
|
|
8
|
-
exports.verify = require_middleware_jwt_jwt.verify;
|
|
9
|
-
exports.verifyWithJwks = require_middleware_jwt_jwt.verifyWithJwks;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_http_exception = require("../../http-exception.js");
|
|
3
|
-
const require_helper_cookie_index = require("../../helper/cookie/index.js");
|
|
4
|
-
const require_utils_jwt_index = require("../../utils/jwt/index.js");
|
|
5
|
-
//#region src/middleware/jwt/jwt.ts
|
|
6
|
-
/**
|
|
7
|
-
* JWT Auth Middleware for Hono.
|
|
8
|
-
*
|
|
9
|
-
* @see {@link https://hono.dev/docs/middleware/builtin/jwt}
|
|
10
|
-
*
|
|
11
|
-
* @param {object} options - The options for the JWT middleware.
|
|
12
|
-
* @param {SignatureKey} options.secret - A value of your secret key.
|
|
13
|
-
* @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token.
|
|
14
|
-
* @param {SignatureAlgorithm} options.alg - An algorithm type that is used for verifying (required). Available types are `HS256` | `HS384` | `HS512` | `RS256` | `RS384` | `RS512` | `PS256` | `PS384` | `PS512` | `ES256` | `ES384` | `ES512` | `EdDSA`.
|
|
15
|
-
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
|
|
16
|
-
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
|
|
17
|
-
* @param {VerifyOptions} [options.verification] - Additional options for JWT payload verification.
|
|
18
|
-
* @returns {MiddlewareHandler} The middleware handler function.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const app = new Hono()
|
|
23
|
-
*
|
|
24
|
-
* app.use(
|
|
25
|
-
* '/auth/*',
|
|
26
|
-
* jwt({
|
|
27
|
-
* secret: 'it-is-very-secret',
|
|
28
|
-
* alg: 'HS256',
|
|
29
|
-
* headerName: 'x-custom-auth-header', // Optional, default is 'Authorization'
|
|
30
|
-
* })
|
|
31
|
-
* )
|
|
32
|
-
*
|
|
33
|
-
* app.get('/auth/page', (c) => {
|
|
34
|
-
* return c.text('You are authorized')
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
const jwt = (options) => {
|
|
39
|
-
const verifyOpts = options.verification || {};
|
|
40
|
-
if (!options || !options.secret) throw new Error("JWT auth middleware requires options for \"secret\"");
|
|
41
|
-
if (!options.alg) throw new Error("JWT auth middleware requires options for \"alg\"");
|
|
42
|
-
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");
|
|
43
|
-
return async function jwt(ctx, next) {
|
|
44
|
-
const headerName = options.headerName || "Authorization";
|
|
45
|
-
const credentials = ctx.req.raw.headers.get(headerName);
|
|
46
|
-
let token;
|
|
47
|
-
if (credentials) {
|
|
48
|
-
const parts = credentials.split(/\s+/);
|
|
49
|
-
if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") {
|
|
50
|
-
const errDescription = "invalid credentials structure";
|
|
51
|
-
throw new require_http_exception.HTTPException(401, {
|
|
52
|
-
message: errDescription,
|
|
53
|
-
res: unauthorizedResponse({
|
|
54
|
-
ctx,
|
|
55
|
-
error: "invalid_request",
|
|
56
|
-
errDescription,
|
|
57
|
-
realm: options.realm
|
|
58
|
-
})
|
|
59
|
-
});
|
|
60
|
-
} else token = parts[1];
|
|
61
|
-
} else if (options.cookie) {
|
|
62
|
-
if (typeof options.cookie == "string") token = require_helper_cookie_index.getCookie(ctx, options.cookie);
|
|
63
|
-
else if (options.cookie.secret) {
|
|
64
|
-
if (options.cookie.prefixOptions) token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key, options.cookie.prefixOptions);
|
|
65
|
-
else token = await require_helper_cookie_index.getSignedCookie(ctx, options.cookie.secret, options.cookie.key);
|
|
66
|
-
} else if (options.cookie.prefixOptions) token = require_helper_cookie_index.getCookie(ctx, options.cookie.key, options.cookie.prefixOptions);
|
|
67
|
-
else token = require_helper_cookie_index.getCookie(ctx, options.cookie.key);
|
|
68
|
-
}
|
|
69
|
-
if (!token) {
|
|
70
|
-
const errDescription = "no authorization included in request";
|
|
71
|
-
throw new require_http_exception.HTTPException(401, {
|
|
72
|
-
message: errDescription,
|
|
73
|
-
res: unauthorizedResponse({
|
|
74
|
-
ctx,
|
|
75
|
-
error: "invalid_request",
|
|
76
|
-
errDescription,
|
|
77
|
-
realm: options.realm
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
let payload;
|
|
82
|
-
let cause;
|
|
83
|
-
try {
|
|
84
|
-
payload = await require_utils_jwt_index.Jwt.verify(token, options.secret, {
|
|
85
|
-
alg: options.alg,
|
|
86
|
-
...verifyOpts
|
|
87
|
-
});
|
|
88
|
-
} catch (e) {
|
|
89
|
-
cause = e;
|
|
90
|
-
}
|
|
91
|
-
if (!payload) throw new require_http_exception.HTTPException(401, {
|
|
92
|
-
message: "Unauthorized",
|
|
93
|
-
res: unauthorizedResponse({
|
|
94
|
-
ctx,
|
|
95
|
-
error: "invalid_token",
|
|
96
|
-
statusText: "Unauthorized",
|
|
97
|
-
errDescription: "token verification failure",
|
|
98
|
-
realm: options.realm
|
|
99
|
-
}),
|
|
100
|
-
cause
|
|
101
|
-
});
|
|
102
|
-
ctx.set("jwtPayload", payload);
|
|
103
|
-
await next();
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
function unauthorizedResponse(opts) {
|
|
107
|
-
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
|
|
108
|
-
const errDescription = opts.errDescription.replace(/"/g, "\\\"");
|
|
109
|
-
return new Response("Unauthorized", {
|
|
110
|
-
status: 401,
|
|
111
|
-
statusText: opts.statusText,
|
|
112
|
-
headers: { "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` }
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
const verifyWithJwks = require_utils_jwt_index.Jwt.verifyWithJwks;
|
|
116
|
-
const verify = require_utils_jwt_index.Jwt.verify;
|
|
117
|
-
const decode = require_utils_jwt_index.Jwt.decode;
|
|
118
|
-
const sign = require_utils_jwt_index.Jwt.sign;
|
|
119
|
-
//#endregion
|
|
120
|
-
exports.decode = decode;
|
|
121
|
-
exports.jwt = jwt;
|
|
122
|
-
exports.sign = sign;
|
|
123
|
-
exports.verify = verify;
|
|
124
|
-
exports.verifyWithJwks = verifyWithJwks;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_middleware_language_language = require("./language.js");
|
|
3
|
-
exports.detectFromCookie = require_middleware_language_language.detectFromCookie;
|
|
4
|
-
exports.detectFromHeader = require_middleware_language_language.detectFromHeader;
|
|
5
|
-
exports.detectFromPath = require_middleware_language_language.detectFromPath;
|
|
6
|
-
exports.detectFromQuery = require_middleware_language_language.detectFromQuery;
|
|
7
|
-
exports.languageDetector = require_middleware_language_language.languageDetector;
|