mcp-auth-server 0.0.0-stage → 0.1.1
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 +207 -2
- package/bin/keygen.mjs +26 -0
- package/lib/adapters/express/express.middleware.d.ts +4 -0
- package/lib/adapters/express/express.middleware.js +23 -0
- package/lib/adapters/express/express.middleware.js.map +1 -0
- package/lib/adapters/fastify/fastify.plugin.d.ts +4 -0
- package/lib/adapters/fastify/fastify.plugin.js +32 -0
- package/lib/adapters/fastify/fastify.plugin.js.map +1 -0
- package/lib/adapters/fetch/create.fetch.handler.d.ts +3 -0
- package/lib/adapters/fetch/create.fetch.handler.js +13 -0
- package/lib/adapters/fetch/create.fetch.handler.js.map +1 -0
- package/lib/adapters/fetch/to.http.request.d.ts +3 -0
- package/lib/adapters/fetch/to.http.request.js +22 -0
- package/lib/adapters/fetch/to.http.request.js.map +1 -0
- package/lib/adapters/fetch/to.response.d.ts +3 -0
- package/lib/adapters/fetch/to.response.js +10 -0
- package/lib/adapters/fetch/to.response.js.map +1 -0
- package/lib/adapters/koa/koa.middleware.d.ts +4 -0
- package/lib/adapters/koa/koa.middleware.js +19 -0
- package/lib/adapters/koa/koa.middleware.js.map +1 -0
- package/lib/adapters/node/create.node.handler.d.ts +4 -0
- package/lib/adapters/node/create.node.handler.js +16 -0
- package/lib/adapters/node/create.node.handler.js.map +1 -0
- package/lib/adapters/node/node.ssrf.guard.d.ts +2 -0
- package/lib/adapters/node/node.ssrf.guard.js +16 -0
- package/lib/adapters/node/node.ssrf.guard.js.map +1 -0
- package/lib/adapters/node/parse.node.body.d.ts +3 -0
- package/lib/adapters/node/parse.node.body.js +16 -0
- package/lib/adapters/node/parse.node.body.js.map +1 -0
- package/lib/adapters/node/read.node.body.d.ts +3 -0
- package/lib/adapters/node/read.node.body.js +10 -0
- package/lib/adapters/node/read.node.body.js.map +1 -0
- package/lib/adapters/node/to.node.http.request.d.ts +4 -0
- package/lib/adapters/node/to.node.http.request.js +20 -0
- package/lib/adapters/node/to.node.http.request.js.map +1 -0
- package/lib/adapters/node/write.node.response.d.ts +4 -0
- package/lib/adapters/node/write.node.response.js +10 -0
- package/lib/adapters/node/write.node.response.js.map +1 -0
- package/lib/cache/lru.metadata.cache.d.ts +10 -0
- package/lib/cache/lru.metadata.cache.js +31 -0
- package/lib/cache/lru.metadata.cache.js.map +1 -0
- package/lib/functions/body/parse.body.d.ts +2 -0
- package/lib/functions/body/parse.body.js +20 -0
- package/lib/functions/body/parse.body.js.map +1 -0
- package/lib/functions/body/parse.query.d.ts +2 -0
- package/lib/functions/body/parse.query.js +16 -0
- package/lib/functions/body/parse.query.js.map +1 -0
- package/lib/functions/cimd/assert.public.host.d.ts +2 -0
- package/lib/functions/cimd/assert.public.host.js +15 -0
- package/lib/functions/cimd/assert.public.host.js.map +1 -0
- package/lib/functions/cimd/cache.seconds.d.ts +2 -0
- package/lib/functions/cimd/cache.seconds.js +16 -0
- package/lib/functions/cimd/cache.seconds.js.map +1 -0
- package/lib/functions/cimd/create.metadata.resolver.d.ts +5 -0
- package/lib/functions/cimd/create.metadata.resolver.js +53 -0
- package/lib/functions/cimd/create.metadata.resolver.js.map +1 -0
- package/lib/functions/cimd/host.matches.d.ts +2 -0
- package/lib/functions/cimd/host.matches.js +5 -0
- package/lib/functions/cimd/host.matches.js.map +1 -0
- package/lib/functions/cimd/is.metadata.client.id.d.ts +2 -0
- package/lib/functions/cimd/is.metadata.client.id.js +14 -0
- package/lib/functions/cimd/is.metadata.client.id.js.map +1 -0
- package/lib/functions/cimd/is.private.ipv4.d.ts +2 -0
- package/lib/functions/cimd/is.private.ipv4.js +18 -0
- package/lib/functions/cimd/is.private.ipv4.js.map +1 -0
- package/lib/functions/cimd/is.private.ipv6.d.ts +2 -0
- package/lib/functions/cimd/is.private.ipv6.js +17 -0
- package/lib/functions/cimd/is.private.ipv6.js.map +1 -0
- package/lib/functions/cimd/read.limited.d.ts +2 -0
- package/lib/functions/cimd/read.limited.js +32 -0
- package/lib/functions/cimd/read.limited.js.map +1 -0
- package/lib/functions/cimd/validate.metadata.document.d.ts +3 -0
- package/lib/functions/cimd/validate.metadata.document.js +25 -0
- package/lib/functions/cimd/validate.metadata.document.js.map +1 -0
- package/lib/functions/consent/consent.styles.d.ts +2 -0
- package/lib/functions/consent/consent.styles.js +20 -0
- package/lib/functions/consent/consent.styles.js.map +1 -0
- package/lib/functions/consent/escape.html.d.ts +2 -0
- package/lib/functions/consent/escape.html.js +5 -0
- package/lib/functions/consent/escape.html.js.map +1 -0
- package/lib/functions/consent/render.default.consent.d.ts +3 -0
- package/lib/functions/consent/render.default.consent.js +50 -0
- package/lib/functions/consent/render.default.consent.js.map +1 -0
- package/lib/functions/crypto/random.id.d.ts +2 -0
- package/lib/functions/crypto/random.id.js +5 -0
- package/lib/functions/crypto/random.id.js.map +1 -0
- package/lib/functions/crypto/random.token.d.ts +2 -0
- package/lib/functions/crypto/random.token.js +9 -0
- package/lib/functions/crypto/random.token.js.map +1 -0
- package/lib/functions/crypto/sha256.base64.url.d.ts +2 -0
- package/lib/functions/crypto/sha256.base64.url.js +10 -0
- package/lib/functions/crypto/sha256.base64.url.js.map +1 -0
- package/lib/functions/crypto/sha256.digest.d.ts +2 -0
- package/lib/functions/crypto/sha256.digest.js +5 -0
- package/lib/functions/crypto/sha256.digest.js.map +1 -0
- package/lib/functions/crypto/sha256.hex.d.ts +2 -0
- package/lib/functions/crypto/sha256.hex.js +9 -0
- package/lib/functions/crypto/sha256.hex.js.map +1 -0
- package/lib/functions/crypto/to.base64.url.d.ts +2 -0
- package/lib/functions/crypto/to.base64.url.js +10 -0
- package/lib/functions/crypto/to.base64.url.js.map +1 -0
- package/lib/functions/http/form.params.d.ts +2 -0
- package/lib/functions/http/form.params.js +5 -0
- package/lib/functions/http/form.params.js.map +1 -0
- package/lib/functions/http/header.value.d.ts +3 -0
- package/lib/functions/http/header.value.js +8 -0
- package/lib/functions/http/header.value.js.map +1 -0
- package/lib/functions/http/json.response.d.ts +3 -0
- package/lib/functions/http/json.response.js +9 -0
- package/lib/functions/http/json.response.js.map +1 -0
- package/lib/functions/http/oauth.error.response.d.ts +3 -0
- package/lib/functions/http/oauth.error.response.js +9 -0
- package/lib/functions/http/oauth.error.response.js.map +1 -0
- package/lib/functions/http/plain.error.response.d.ts +3 -0
- package/lib/functions/http/plain.error.response.js +5 -0
- package/lib/functions/http/plain.error.response.js.map +1 -0
- package/lib/functions/http/query.param.d.ts +3 -0
- package/lib/functions/http/query.param.js +8 -0
- package/lib/functions/http/query.param.js.map +1 -0
- package/lib/functions/http/redirect.response.d.ts +3 -0
- package/lib/functions/http/redirect.response.js +5 -0
- package/lib/functions/http/redirect.response.js.map +1 -0
- package/lib/functions/http/text.value.d.ts +2 -0
- package/lib/functions/http/text.value.js +5 -0
- package/lib/functions/http/text.value.js.map +1 -0
- package/lib/functions/http/trim.trailing.slashes.d.ts +2 -0
- package/lib/functions/http/trim.trailing.slashes.js +10 -0
- package/lib/functions/http/trim.trailing.slashes.js.map +1 -0
- package/lib/functions/jwt/sign.access.token.d.ts +4 -0
- package/lib/functions/jwt/sign.access.token.js +21 -0
- package/lib/functions/jwt/sign.access.token.js.map +1 -0
- package/lib/functions/jwt/verify.access.token.d.ts +4 -0
- package/lib/functions/jwt/verify.access.token.js +16 -0
- package/lib/functions/jwt/verify.access.token.js.map +1 -0
- package/lib/functions/keys/der.length.d.ts +2 -0
- package/lib/functions/keys/der.length.js +12 -0
- package/lib/functions/keys/der.length.js.map +1 -0
- package/lib/functions/keys/is.rsa.key.d.ts +2 -0
- package/lib/functions/keys/is.rsa.key.js +8 -0
- package/lib/functions/keys/is.rsa.key.js.map +1 -0
- package/lib/functions/keys/normalize.pem.d.ts +2 -0
- package/lib/functions/keys/normalize.pem.js +16 -0
- package/lib/functions/keys/normalize.pem.js.map +1 -0
- package/lib/functions/keys/pkcs1.to.pkcs8.d.ts +2 -0
- package/lib/functions/keys/pkcs1.to.pkcs8.js +14 -0
- package/lib/functions/keys/pkcs1.to.pkcs8.js.map +1 -0
- package/lib/functions/keys/resolve.key.pair.d.ts +3 -0
- package/lib/functions/keys/resolve.key.pair.js +27 -0
- package/lib/functions/keys/resolve.key.pair.js.map +1 -0
- package/lib/functions/keys/signing.key.from.env.d.ts +2 -0
- package/lib/functions/keys/signing.key.from.env.js +14 -0
- package/lib/functions/keys/signing.key.from.env.js.map +1 -0
- package/lib/functions/keys/wrap.pem.d.ts +2 -0
- package/lib/functions/keys/wrap.pem.js +11 -0
- package/lib/functions/keys/wrap.pem.js.map +1 -0
- package/lib/functions/redirect/build.error.redirect.d.ts +2 -0
- package/lib/functions/redirect/build.error.redirect.js +9 -0
- package/lib/functions/redirect/build.error.redirect.js.map +1 -0
- package/lib/functions/redirect/build.redirect.d.ts +2 -0
- package/lib/functions/redirect/build.redirect.js +12 -0
- package/lib/functions/redirect/build.redirect.js.map +1 -0
- package/lib/functions/redirect/describe.redirect.target.d.ts +2 -0
- package/lib/functions/redirect/describe.redirect.target.js +8 -0
- package/lib/functions/redirect/describe.redirect.target.js.map +1 -0
- package/lib/functions/redirect/is.allowed.redirect.uri.d.ts +3 -0
- package/lib/functions/redirect/is.allowed.redirect.uri.js +19 -0
- package/lib/functions/redirect/is.allowed.redirect.uri.js.map +1 -0
- package/lib/functions/redirect/is.loopback.redirect.d.ts +2 -0
- package/lib/functions/redirect/is.loopback.redirect.js +13 -0
- package/lib/functions/redirect/is.loopback.redirect.js.map +1 -0
- package/lib/functions/redirect/is.safe.metadata.redirect.uri.d.ts +2 -0
- package/lib/functions/redirect/is.safe.metadata.redirect.uri.js +20 -0
- package/lib/functions/redirect/is.safe.metadata.redirect.uri.js.map +1 -0
- package/lib/functions/redirect/parse.url.d.ts +2 -0
- package/lib/functions/redirect/parse.url.js +14 -0
- package/lib/functions/redirect/parse.url.js.map +1 -0
- package/lib/functions/server/attach.and.continue.d.ts +6 -0
- package/lib/functions/server/attach.and.continue.js +15 -0
- package/lib/functions/server/attach.and.continue.js.map +1 -0
- package/lib/functions/server/authenticate.request.d.ts +5 -0
- package/lib/functions/server/authenticate.request.js +24 -0
- package/lib/functions/server/authenticate.request.js.map +1 -0
- package/lib/functions/server/awaiting.consent.d.ts +5 -0
- package/lib/functions/server/awaiting.consent.js +18 -0
- package/lib/functions/server/awaiting.consent.js.map +1 -0
- package/lib/functions/server/build.routes.d.ts +4 -0
- package/lib/functions/server/build.routes.js +40 -0
- package/lib/functions/server/build.routes.js.map +1 -0
- package/lib/functions/server/build.upstream.context.d.ts +6 -0
- package/lib/functions/server/build.upstream.context.js +11 -0
- package/lib/functions/server/build.upstream.context.js.map +1 -0
- package/lib/functions/server/challenge.response.d.ts +4 -0
- package/lib/functions/server/challenge.response.js +14 -0
- package/lib/functions/server/challenge.response.js.map +1 -0
- package/lib/functions/server/continue.with.user.d.ts +5 -0
- package/lib/functions/server/continue.with.user.js +18 -0
- package/lib/functions/server/continue.with.user.js.map +1 -0
- package/lib/functions/server/create.client.resolver.d.ts +6 -0
- package/lib/functions/server/create.client.resolver.js +26 -0
- package/lib/functions/server/create.client.resolver.js.map +1 -0
- package/lib/functions/server/create.mcp.auth.context.d.ts +4 -0
- package/lib/functions/server/create.mcp.auth.context.js +38 -0
- package/lib/functions/server/create.mcp.auth.context.js.map +1 -0
- package/lib/functions/server/create.mcp.auth.d.ts +4 -0
- package/lib/functions/server/create.mcp.auth.js +25 -0
- package/lib/functions/server/create.mcp.auth.js.map +1 -0
- package/lib/functions/server/deny.authorization.d.ts +5 -0
- package/lib/functions/server/deny.authorization.js +13 -0
- package/lib/functions/server/deny.authorization.js.map +1 -0
- package/lib/functions/server/exchange.authorization.code.d.ts +4 -0
- package/lib/functions/server/exchange.authorization.code.js +32 -0
- package/lib/functions/server/exchange.authorization.code.js.map +1 -0
- package/lib/functions/server/find.route.d.ts +4 -0
- package/lib/functions/server/find.route.js +5 -0
- package/lib/functions/server/find.route.js.map +1 -0
- package/lib/functions/server/handle.request.d.ts +6 -0
- package/lib/functions/server/handle.request.js +21 -0
- package/lib/functions/server/handle.request.js.map +1 -0
- package/lib/functions/server/has.credentials.d.ts +3 -0
- package/lib/functions/server/has.credentials.js +9 -0
- package/lib/functions/server/has.credentials.js.map +1 -0
- package/lib/functions/server/issue.authorization.code.d.ts +5 -0
- package/lib/functions/server/issue.authorization.code.js +24 -0
- package/lib/functions/server/issue.authorization.code.js.map +1 -0
- package/lib/functions/server/issue.tokens.d.ts +4 -0
- package/lib/functions/server/issue.tokens.js +30 -0
- package/lib/functions/server/issue.tokens.js.map +1 -0
- package/lib/functions/server/load.pending.d.ts +5 -0
- package/lib/functions/server/load.pending.js +13 -0
- package/lib/functions/server/load.pending.js.map +1 -0
- package/lib/functions/server/rotate.refresh.token.d.ts +4 -0
- package/lib/functions/server/rotate.refresh.token.js +33 -0
- package/lib/functions/server/rotate.refresh.token.js.map +1 -0
- package/lib/functions/server/token.failure.d.ts +3 -0
- package/lib/functions/server/token.failure.js +9 -0
- package/lib/functions/server/token.failure.js.map +1 -0
- package/lib/functions/sql/from.better.sqlite3.d.ts +10 -0
- package/lib/functions/sql/from.better.sqlite3.js +11 -0
- package/lib/functions/sql/from.better.sqlite3.js.map +1 -0
- package/lib/functions/sql/from.bun.sqlite.d.ts +7 -0
- package/lib/functions/sql/from.bun.sqlite.js +5 -0
- package/lib/functions/sql/from.bun.sqlite.js.map +1 -0
- package/lib/functions/sql/from.d1.d.ts +11 -0
- package/lib/functions/sql/from.d1.js +8 -0
- package/lib/functions/sql/from.d1.js.map +1 -0
- package/lib/functions/sql/from.node.sqlite.d.ts +7 -0
- package/lib/functions/sql/from.node.sqlite.js +5 -0
- package/lib/functions/sql/from.node.sqlite.js.map +1 -0
- package/lib/functions/sql/from.pg.d.ts +7 -0
- package/lib/functions/sql/from.pg.js +5 -0
- package/lib/functions/sql/from.pg.js.map +1 -0
- package/lib/functions/sql/from.postgres.js.d.ts +5 -0
- package/lib/functions/sql/from.postgres.js.js +5 -0
- package/lib/functions/sql/from.postgres.js.js.map +1 -0
- package/lib/functions/sql/optional.date.d.ts +2 -0
- package/lib/functions/sql/optional.date.js +5 -0
- package/lib/functions/sql/optional.date.js.map +1 -0
- package/lib/functions/sql/optional.number.d.ts +2 -0
- package/lib/functions/sql/optional.number.js +5 -0
- package/lib/functions/sql/optional.number.js.map +1 -0
- package/lib/functions/sql/optional.text.d.ts +2 -0
- package/lib/functions/sql/optional.text.js +5 -0
- package/lib/functions/sql/optional.text.js.map +1 -0
- package/lib/functions/sql/row.to.client.d.ts +4 -0
- package/lib/functions/sql/row.to.client.js +18 -0
- package/lib/functions/sql/row.to.client.js.map +1 -0
- package/lib/functions/sql/row.to.code.d.ts +4 -0
- package/lib/functions/sql/row.to.code.js +21 -0
- package/lib/functions/sql/row.to.code.js.map +1 -0
- package/lib/functions/sql/row.to.pending.d.ts +4 -0
- package/lib/functions/sql/row.to.pending.js +21 -0
- package/lib/functions/sql/row.to.pending.js.map +1 -0
- package/lib/functions/sql/row.to.refresh.token.d.ts +4 -0
- package/lib/functions/sql/row.to.refresh.token.js +22 -0
- package/lib/functions/sql/row.to.refresh.token.js.map +1 -0
- package/lib/functions/sql/sql.schema.d.ts +3 -0
- package/lib/functions/sql/sql.schema.js +62 -0
- package/lib/functions/sql/sql.schema.js.map +1 -0
- package/lib/functions/sql/to.dialect.sql.d.ts +3 -0
- package/lib/functions/sql/to.dialect.sql.js +13 -0
- package/lib/functions/sql/to.dialect.sql.js.map +1 -0
- package/lib/functions/upstream/app.session.upstream.d.ts +4 -0
- package/lib/functions/upstream/app.session.upstream.js +18 -0
- package/lib/functions/upstream/app.session.upstream.js.map +1 -0
- package/lib/functions/upstream/entra.upstream.d.ts +11 -0
- package/lib/functions/upstream/entra.upstream.js +16 -0
- package/lib/functions/upstream/entra.upstream.js.map +1 -0
- package/lib/functions/upstream/oidc.upstream.d.ts +4 -0
- package/lib/functions/upstream/oidc.upstream.js +82 -0
- package/lib/functions/upstream/oidc.upstream.js.map +1 -0
- package/lib/functions/upstream/verify.id.token.d.ts +3 -0
- package/lib/functions/upstream/verify.id.token.js +16 -0
- package/lib/functions/upstream/verify.id.token.js.map +1 -0
- package/lib/handlers/authorization.server.metadata.handler.d.ts +4 -0
- package/lib/handlers/authorization.server.metadata.handler.js +24 -0
- package/lib/handlers/authorization.server.metadata.handler.js.map +1 -0
- package/lib/handlers/authorize.handler.d.ts +5 -0
- package/lib/handlers/authorize.handler.js +58 -0
- package/lib/handlers/authorize.handler.js.map +1 -0
- package/lib/handlers/callback.handler.d.ts +5 -0
- package/lib/handlers/callback.handler.js +32 -0
- package/lib/handlers/callback.handler.js.map +1 -0
- package/lib/handlers/consent.decision.handler.d.ts +5 -0
- package/lib/handlers/consent.decision.handler.js +30 -0
- package/lib/handlers/consent.decision.handler.js.map +1 -0
- package/lib/handlers/consent.page.handler.d.ts +5 -0
- package/lib/handlers/consent.page.handler.js +43 -0
- package/lib/handlers/consent.page.handler.js.map +1 -0
- package/lib/handlers/protected.resource.metadata.handler.d.ts +4 -0
- package/lib/handlers/protected.resource.metadata.handler.js +9 -0
- package/lib/handlers/protected.resource.metadata.handler.js.map +1 -0
- package/lib/handlers/register.handler.d.ts +5 -0
- package/lib/handlers/register.handler.js +44 -0
- package/lib/handlers/register.handler.js.map +1 -0
- package/lib/handlers/resume.handler.d.ts +5 -0
- package/lib/handlers/resume.handler.js +25 -0
- package/lib/handlers/resume.handler.js.map +1 -0
- package/lib/handlers/revoke.handler.d.ts +5 -0
- package/lib/handlers/revoke.handler.js +27 -0
- package/lib/handlers/revoke.handler.js.map +1 -0
- package/lib/handlers/token.handler.d.ts +5 -0
- package/lib/handlers/token.handler.js +22 -0
- package/lib/handlers/token.handler.js.map +1 -0
- package/lib/mcp.auth.entra.d.ts +4 -0
- package/lib/mcp.auth.entra.js +11 -0
- package/lib/mcp.auth.entra.js.map +1 -0
- package/lib/mcp.auth.express.d.ts +4 -0
- package/lib/mcp.auth.express.js +11 -0
- package/lib/mcp.auth.express.js.map +1 -0
- package/lib/mcp.auth.fastify.d.ts +4 -0
- package/lib/mcp.auth.fastify.js +11 -0
- package/lib/mcp.auth.fastify.js.map +1 -0
- package/lib/mcp.auth.fetch.d.ts +6 -0
- package/lib/mcp.auth.fetch.js +15 -0
- package/lib/mcp.auth.fetch.js.map +1 -0
- package/lib/mcp.auth.koa.d.ts +4 -0
- package/lib/mcp.auth.koa.js +11 -0
- package/lib/mcp.auth.koa.js.map +1 -0
- package/lib/mcp.auth.memory.d.ts +4 -0
- package/lib/mcp.auth.memory.js +11 -0
- package/lib/mcp.auth.memory.js.map +1 -0
- package/lib/mcp.auth.mongodb.d.ts +6 -0
- package/lib/mcp.auth.mongodb.js +11 -0
- package/lib/mcp.auth.mongodb.js.map +1 -0
- package/lib/mcp.auth.node.d.ts +9 -0
- package/lib/mcp.auth.node.js +21 -0
- package/lib/mcp.auth.node.js.map +1 -0
- package/lib/mcp.auth.postgres.d.ts +11 -0
- package/lib/mcp.auth.postgres.js +20 -0
- package/lib/mcp.auth.postgres.js.map +1 -0
- package/lib/mcp.auth.server.d.ts +42 -0
- package/lib/mcp.auth.server.js +35 -0
- package/lib/mcp.auth.server.js.map +1 -0
- package/lib/mcp.auth.sqlite.d.ts +13 -0
- package/lib/mcp.auth.sqlite.js +24 -0
- package/lib/mcp.auth.sqlite.js.map +1 -0
- package/lib/storage/memory.storage.d.ts +30 -0
- package/lib/storage/memory.storage.js +91 -0
- package/lib/storage/memory.storage.js.map +1 -0
- package/lib/storage/mongodb.storage.d.ts +41 -0
- package/lib/storage/mongodb.storage.js +172 -0
- package/lib/storage/mongodb.storage.js.map +1 -0
- package/lib/storage/sql.storage.d.ts +35 -0
- package/lib/storage/sql.storage.js +128 -0
- package/lib/storage/sql.storage.js.map +1 -0
- package/lib/types/access.token.input.type.d.ts +9 -0
- package/lib/types/access.token.input.type.js +3 -0
- package/lib/types/access.token.input.type.js.map +1 -0
- package/lib/types/app.session.upstream.options.type.d.ts +7 -0
- package/lib/types/app.session.upstream.options.type.js +3 -0
- package/lib/types/app.session.upstream.options.type.js.map +1 -0
- package/lib/types/authenticate.result.type.d.ts +10 -0
- package/lib/types/authenticate.result.type.js +3 -0
- package/lib/types/authenticate.result.type.js.map +1 -0
- package/lib/types/authenticated.user.type.d.ts +5 -0
- package/lib/types/authenticated.user.type.js +3 -0
- package/lib/types/authenticated.user.type.js.map +1 -0
- package/lib/types/authorization.code.record.type.d.ts +11 -0
- package/lib/types/authorization.code.record.type.js +3 -0
- package/lib/types/authorization.code.record.type.js.map +1 -0
- package/lib/types/cimd.options.type.d.ts +16 -0
- package/lib/types/cimd.options.type.js +3 -0
- package/lib/types/cimd.options.type.js.map +1 -0
- package/lib/types/client.metadata.type.d.ts +7 -0
- package/lib/types/client.metadata.type.js +3 -0
- package/lib/types/client.metadata.type.js.map +1 -0
- package/lib/types/client.record.type.d.ts +11 -0
- package/lib/types/client.record.type.js +3 -0
- package/lib/types/client.record.type.js.map +1 -0
- package/lib/types/consent.model.type.d.ts +15 -0
- package/lib/types/consent.model.type.js +3 -0
- package/lib/types/consent.model.type.js.map +1 -0
- package/lib/types/consent.record.type.d.ts +5 -0
- package/lib/types/consent.record.type.js +3 -0
- package/lib/types/consent.record.type.js.map +1 -0
- package/lib/types/http.request.type.d.ts +9 -0
- package/lib/types/http.request.type.js +3 -0
- package/lib/types/http.request.type.js.map +1 -0
- package/lib/types/http.response.type.d.ts +6 -0
- package/lib/types/http.response.type.js +3 -0
- package/lib/types/http.response.type.js.map +1 -0
- package/lib/types/i.metadata.cache.d.ts +6 -0
- package/lib/types/i.metadata.cache.js +3 -0
- package/lib/types/i.metadata.cache.js.map +1 -0
- package/lib/types/i.storage.d.ts +25 -0
- package/lib/types/i.storage.js +3 -0
- package/lib/types/i.storage.js.map +1 -0
- package/lib/types/i.upstream.d.ts +11 -0
- package/lib/types/i.upstream.js +3 -0
- package/lib/types/i.upstream.js.map +1 -0
- package/lib/types/key.pair.type.d.ts +5 -0
- package/lib/types/key.pair.type.js +3 -0
- package/lib/types/key.pair.type.js.map +1 -0
- package/lib/types/logger.type.d.ts +6 -0
- package/lib/types/logger.type.js +3 -0
- package/lib/types/logger.type.js.map +1 -0
- package/lib/types/mcp.auth.context.type.d.ts +29 -0
- package/lib/types/mcp.auth.context.type.js +3 -0
- package/lib/types/mcp.auth.context.type.js.map +1 -0
- package/lib/types/mcp.auth.options.type.d.ts +39 -0
- package/lib/types/mcp.auth.options.type.js +3 -0
- package/lib/types/mcp.auth.options.type.js.map +1 -0
- package/lib/types/mcp.auth.type.d.ts +14 -0
- package/lib/types/mcp.auth.type.js +3 -0
- package/lib/types/mcp.auth.type.js.map +1 -0
- package/lib/types/metadata.resolution.type.d.ts +9 -0
- package/lib/types/metadata.resolution.type.js +3 -0
- package/lib/types/metadata.resolution.type.js.map +1 -0
- package/lib/types/mongo.storage.options.type.d.ts +13 -0
- package/lib/types/mongo.storage.options.type.js +3 -0
- package/lib/types/mongo.storage.options.type.js.map +1 -0
- package/lib/types/oidc.upstream.options.type.d.ts +9 -0
- package/lib/types/oidc.upstream.options.type.js +3 -0
- package/lib/types/oidc.upstream.options.type.js.map +1 -0
- package/lib/types/pending.authorization.type.d.ts +14 -0
- package/lib/types/pending.authorization.type.js +3 -0
- package/lib/types/pending.authorization.type.js.map +1 -0
- package/lib/types/pending.filter.type.d.ts +5 -0
- package/lib/types/pending.filter.type.js +3 -0
- package/lib/types/pending.filter.type.js.map +1 -0
- package/lib/types/redirect.policy.type.d.ts +5 -0
- package/lib/types/redirect.policy.type.js +3 -0
- package/lib/types/redirect.policy.type.js.map +1 -0
- package/lib/types/refresh.token.record.type.d.ts +11 -0
- package/lib/types/refresh.token.record.type.js +3 -0
- package/lib/types/refresh.token.record.type.js.map +1 -0
- package/lib/types/resolved.client.type.d.ts +7 -0
- package/lib/types/resolved.client.type.js +3 -0
- package/lib/types/resolved.client.type.js.map +1 -0
- package/lib/types/route.name.type.d.ts +2 -0
- package/lib/types/route.name.type.js +3 -0
- package/lib/types/route.name.type.js.map +1 -0
- package/lib/types/route.type.d.ts +10 -0
- package/lib/types/route.type.js +3 -0
- package/lib/types/route.type.js.map +1 -0
- package/lib/types/sql.dialect.type.d.ts +2 -0
- package/lib/types/sql.dialect.type.js +3 -0
- package/lib/types/sql.dialect.type.js.map +1 -0
- package/lib/types/sql.executor.type.d.ts +4 -0
- package/lib/types/sql.executor.type.js +3 -0
- package/lib/types/sql.executor.type.js.map +1 -0
- package/lib/types/sql.storage.options.type.d.ts +4 -0
- package/lib/types/sql.storage.options.type.js +3 -0
- package/lib/types/sql.storage.options.type.js.map +1 -0
- package/lib/types/upstream.begin.type.d.ts +9 -0
- package/lib/types/upstream.begin.type.js +3 -0
- package/lib/types/upstream.begin.type.js.map +1 -0
- package/lib/types/upstream.context.type.d.ts +10 -0
- package/lib/types/upstream.context.type.js +3 -0
- package/lib/types/upstream.context.type.js.map +1 -0
- package/lib/types/verify.result.type.d.ts +6 -0
- package/lib/types/verify.result.type.js +3 -0
- package/lib/types/verify.result.type.js.map +1 -0
- package/package.json +107 -5
- package/sql/postgres.sql +61 -0
- package/sql/sqlite.sql +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.params.js","sourceRoot":"","sources":["../../../src/functions/http/form.params.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,UAAU,GAAG,CAAC,IAAa,EAA2B,EAAE,CAAC,CAAC,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,CAAE,IAAgC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3I,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const headerValue = (headers, name) => {
|
|
4
|
+
const value = headers[name] ?? headers[name.toLowerCase()];
|
|
5
|
+
return Array.isArray(value) ? value[0] : value;
|
|
6
|
+
};
|
|
7
|
+
exports.default = headerValue;
|
|
8
|
+
//# sourceMappingURL=header.value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.value.js","sourceRoot":"","sources":["../../../src/functions/http/header.value.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,MAAM,WAAW,GAAG,CAAC,OAAmC,EAAE,IAAY,EAAsB,EAAE;IAC7F,MAAM,KAAK,GAAkC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1F,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChD,CAAC,CAAC;AACF,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsonResponse = (status, body, headers = {}) => ({
|
|
4
|
+
status,
|
|
5
|
+
headers: { 'content-type': 'application/json', ...headers },
|
|
6
|
+
body
|
|
7
|
+
});
|
|
8
|
+
exports.default = jsonResponse;
|
|
9
|
+
//# sourceMappingURL=json.response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.response.js","sourceRoot":"","sources":["../../../src/functions/http/json.response.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,IAAa,EAAE,UAAkC,EAAE,EAAoB,EAAE,CAAC,CAAC;IAChH,MAAM;IACN,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAE,GAAG,OAAO,EAAC;IACzD,IAAI;CACJ,CAAC,CAAC;AACH,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const json_response_1 = __importDefault(require("./json.response"));
|
|
7
|
+
const oauthErrorResponse = (status, error, description, headers = {}) => (0, json_response_1.default)(status, { error, error_description: description }, headers);
|
|
8
|
+
exports.default = oauthErrorResponse;
|
|
9
|
+
//# sourceMappingURL=oauth.error.response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.error.response.js","sourceRoot":"","sources":["../../../src/functions/http/oauth.error.response.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAGb,oEAA2C;AAE3C,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,WAAmB,EAAE,UAAkC,EAAE,EAAoB,EAAE,CACzI,IAAA,uBAAY,EAAC,MAAM,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAC,EAAE,OAAO,CAAC,CAAC;AACxE,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const plainErrorResponse = (status, message) => ({ status, headers: { 'content-type': 'text/plain', 'cache-control': 'no-store' }, body: message });
|
|
4
|
+
exports.default = plainErrorResponse;
|
|
5
|
+
//# sourceMappingURL=plain.error.response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain.error.response.js","sourceRoot":"","sources":["../../../src/functions/http/plain.error.response.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,OAAe,EAAoB,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,OAAO,EAAE,EAAC,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAC,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;AAClL,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const queryParam = (request, name) => {
|
|
4
|
+
const value = request.query[name];
|
|
5
|
+
return 'string' === typeof value ? value : undefined;
|
|
6
|
+
};
|
|
7
|
+
exports.default = queryParam;
|
|
8
|
+
//# sourceMappingURL=query.param.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.param.js","sourceRoot":"","sources":["../../../src/functions/http/query.param.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,IAAY,EAAsB,EAAE;IACjF,MAAM,KAAK,GAAkC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjE,OAAO,QAAQ,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC,CAAC;AACF,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const redirectResponse = (location) => ({ status: 302, headers: { location, 'cache-control': 'no-store' } });
|
|
4
|
+
exports.default = redirectResponse;
|
|
5
|
+
//# sourceMappingURL=redirect.response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redirect.response.js","sourceRoot":"","sources":["../../../src/functions/http/redirect.response.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAoB,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAC,EAAC,CAAC,CAAC;AACnI,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.value.js","sourceRoot":"","sources":["../../../src/functions/http/text.value.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,SAAS,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,CAAC,QAAQ,KAAK,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACnH,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const trimTrailingSlashes = (value) => {
|
|
4
|
+
let end = value.length;
|
|
5
|
+
while (end > 0 && '/' === value[end - 1])
|
|
6
|
+
end -= 1;
|
|
7
|
+
return value.slice(0, end);
|
|
8
|
+
};
|
|
9
|
+
exports.default = trimTrailingSlashes;
|
|
10
|
+
//# sourceMappingURL=trim.trailing.slashes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.trailing.slashes.js","sourceRoot":"","sources":["../../../src/functions/http/trim.trailing.slashes.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,IAAI,GAAG,GAAW,KAAK,CAAC,MAAM,CAAC;IAC/B,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAAE,GAAG,IAAI,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC;AACF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jose_1 = require("jose");
|
|
7
|
+
const random_id_1 = __importDefault(require("../crypto/random.id"));
|
|
8
|
+
const signAccessToken = async (keys, input) => {
|
|
9
|
+
const issuedAt = Math.floor(input.now.getTime() / 1000);
|
|
10
|
+
return new jose_1.SignJWT({ client_id: input.clientId })
|
|
11
|
+
.setProtectedHeader({ alg: 'RS256' })
|
|
12
|
+
.setIssuer(input.issuer)
|
|
13
|
+
.setAudience(input.resource)
|
|
14
|
+
.setSubject(input.userId)
|
|
15
|
+
.setJti((0, random_id_1.default)())
|
|
16
|
+
.setIssuedAt(issuedAt)
|
|
17
|
+
.setExpirationTime(issuedAt + input.ttlSeconds)
|
|
18
|
+
.sign(keys.privateKey);
|
|
19
|
+
};
|
|
20
|
+
exports.default = signAccessToken;
|
|
21
|
+
//# sourceMappingURL=sign.access.token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.access.token.js","sourceRoot":"","sources":["../../../src/functions/jwt/sign.access.token.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,+BAA6B;AAI7B,oEAA2C;AAE3C,MAAM,eAAe,GAAG,KAAK,EAAE,IAAiB,EAAE,KAA2B,EAAmB,EAAE;IACjG,MAAM,QAAQ,GAAW,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAChE,OAAO,IAAI,cAAO,CAAC,EAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAC,CAAC;SAC7C,kBAAkB,CAAC,EAAC,GAAG,EAAE,OAAO,EAAC,CAAC;SAClC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;SACvB,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC;SAC3B,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;SACxB,MAAM,CAAC,IAAA,mBAAQ,GAAE,CAAC;SAClB,WAAW,CAAC,QAAQ,CAAC;SACrB,iBAAiB,CAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC;SAC9C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACzB,CAAC,CAAC;AACF,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type KeyPairType from '../../types/key.pair.type';
|
|
2
|
+
import type VerifyResultType from '../../types/verify.result.type';
|
|
3
|
+
declare const verifyAccessToken: (keys: KeyPairType, token: string, issuer: string, resource: string, now: Date) => Promise<VerifyResultType>;
|
|
4
|
+
export default verifyAccessToken;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jose_1 = require("jose");
|
|
4
|
+
const verifyAccessToken = async (keys, token, issuer, resource, now) => {
|
|
5
|
+
try {
|
|
6
|
+
const { payload } = await (0, jose_1.jwtVerify)(token, keys.publicKey, { algorithms: ['RS256'], issuer, audience: resource, currentDate: now });
|
|
7
|
+
return { claims: payload };
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error instanceof jose_1.errors.JWTExpired)
|
|
11
|
+
return { reason: 'expired' };
|
|
12
|
+
return { reason: 'invalid_token' };
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.default = verifyAccessToken;
|
|
16
|
+
//# sourceMappingURL=verify.access.token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.access.token.js","sourceRoot":"","sources":["../../../src/functions/jwt/verify.access.token.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAuC;AAKvC,MAAM,iBAAiB,GAAG,KAAK,EAAE,IAAiB,EAAE,KAAa,EAAE,MAAc,EAAE,QAAgB,EAAE,GAAS,EAA6B,EAAE;IAC5I,IAAI,CAAC;QACJ,MAAM,EAAC,OAAO,EAAC,GAAG,MAAM,IAAA,gBAAS,EAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,EAAC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAC,CAAC,CAAC;QAChI,OAAO,EAAC,MAAM,EAAE,OAAkC,EAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,aAAM,CAAC,UAAU;YAAE,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,CAAC;QACnE,OAAO,EAAC,MAAM,EAAE,eAAe,EAAC,CAAC;IAClC,CAAC;AACF,CAAC,CAAC;AACF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const derLength = (length) => {
|
|
4
|
+
if (length < 128)
|
|
5
|
+
return [length];
|
|
6
|
+
const bytes = [];
|
|
7
|
+
for (let rest = length; rest > 0; rest = Math.floor(rest / 256))
|
|
8
|
+
bytes.unshift(rest % 256);
|
|
9
|
+
return [128 + bytes.length, ...bytes];
|
|
10
|
+
};
|
|
11
|
+
exports.default = derLength;
|
|
12
|
+
//# sourceMappingURL=der.length.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"der.length.js","sourceRoot":"","sources":["../../../src/functions/keys/der.length.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,SAAS,GAAG,CAAC,MAAc,EAAY,EAAE;IAC9C,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;QAAE,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAC3F,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AACF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const isRsaKey = (key) => {
|
|
4
|
+
const candidate = key;
|
|
5
|
+
return 'rsa' === candidate.asymmetricKeyType || 'RSASSA-PKCS1-v1_5' === candidate.algorithm?.name;
|
|
6
|
+
};
|
|
7
|
+
exports.default = isRsaKey;
|
|
8
|
+
//# sourceMappingURL=is.rsa.key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.rsa.key.js","sourceRoot":"","sources":["../../../src/functions/keys/is.rsa.key.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,QAAQ,GAAG,CAAC,GAAY,EAAW,EAAE;IAC1C,MAAM,SAAS,GAAG,GAAgE,CAAC;IACnF,OAAO,KAAK,KAAK,SAAS,CAAC,iBAAiB,IAAI,mBAAmB,KAAK,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC;AACnG,CAAC,CAAC;AACF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const pkcs1_to_pkcs8_1 = __importDefault(require("./pkcs1.to.pkcs8"));
|
|
7
|
+
const wrap_pem_1 = __importDefault(require("./wrap.pem"));
|
|
8
|
+
const normalizePem = (value) => {
|
|
9
|
+
const pem = value.replace(/\\n/g, '\n').trim();
|
|
10
|
+
if (!pem.includes('BEGIN RSA PRIVATE KEY'))
|
|
11
|
+
return pem;
|
|
12
|
+
const base64 = pem.replace(/-----[A-Z ]+-----/g, '').replace(/\s+/g, '');
|
|
13
|
+
return (0, wrap_pem_1.default)((0, pkcs1_to_pkcs8_1.default)(Uint8Array.from(atob(base64), (char) => char.charCodeAt(0))));
|
|
14
|
+
};
|
|
15
|
+
exports.default = normalizePem;
|
|
16
|
+
//# sourceMappingURL=normalize.pem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.pem.js","sourceRoot":"","sources":["../../../src/functions/keys/normalize.pem.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,sEAA4C;AAC5C,0DAAiC;AAEjC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,MAAM,GAAG,GAAW,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAAE,OAAO,GAAG,CAAC;IACvD,MAAM,MAAM,GAAW,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjF,OAAO,IAAA,kBAAO,EAAC,IAAA,wBAAY,EAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3G,CAAC,CAAC;AACF,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const der_length_1 = __importDefault(require("./der.length"));
|
|
7
|
+
const rsaEncryptionAlgorithm = [0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00];
|
|
8
|
+
const pkcs1ToPkcs8 = (pkcs1) => {
|
|
9
|
+
const octetString = [0x04, ...(0, der_length_1.default)(pkcs1.length), ...pkcs1];
|
|
10
|
+
const body = [0x02, 0x01, 0x00, ...rsaEncryptionAlgorithm, ...octetString];
|
|
11
|
+
return Uint8Array.from([0x30, ...(0, der_length_1.default)(body.length), ...body]);
|
|
12
|
+
};
|
|
13
|
+
exports.default = pkcs1ToPkcs8;
|
|
14
|
+
//# sourceMappingURL=pkcs1.to.pkcs8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pkcs1.to.pkcs8.js","sourceRoot":"","sources":["../../../src/functions/keys/pkcs1.to.pkcs8.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,8DAAqC;AAErC,MAAM,sBAAsB,GAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEpI,MAAM,YAAY,GAAG,CAAC,KAAiB,EAAc,EAAE;IACtD,MAAM,WAAW,GAAa,CAAC,IAAI,EAAE,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,sBAAsB,EAAE,GAAG,WAAW,CAAC,CAAC;IACrF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,IAAA,oBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AACF,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jose_1 = require("jose");
|
|
7
|
+
const is_rsa_key_1 = __importDefault(require("./is.rsa.key"));
|
|
8
|
+
const normalize_pem_1 = __importDefault(require("./normalize.pem"));
|
|
9
|
+
const resolveKeyPair = async (signingKey, verificationKey) => {
|
|
10
|
+
let privateKey;
|
|
11
|
+
try {
|
|
12
|
+
privateKey = 'string' === typeof signingKey ? (await (0, jose_1.importPKCS8)((0, normalize_pem_1.default)(signingKey), 'RS256', { extractable: true })) : signingKey;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
throw new Error('signingKey is not a valid RSA private key in PEM (PKCS8 or PKCS1) form');
|
|
16
|
+
}
|
|
17
|
+
if (!(0, is_rsa_key_1.default)(privateKey))
|
|
18
|
+
throw new Error('signingKey must be an RSA key usable with RS256');
|
|
19
|
+
if (verificationKey)
|
|
20
|
+
return { privateKey, publicKey: verificationKey };
|
|
21
|
+
if (false === privateKey.extractable)
|
|
22
|
+
throw new Error('signingKey is not extractable: pass verificationKey with the matching public key');
|
|
23
|
+
const { kty, n, e } = await (0, jose_1.exportJWK)(privateKey);
|
|
24
|
+
return { privateKey, publicKey: (await (0, jose_1.importJWK)({ kty, n, e }, 'RS256')) };
|
|
25
|
+
};
|
|
26
|
+
exports.default = resolveKeyPair;
|
|
27
|
+
//# sourceMappingURL=resolve.key.pair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.key.pair.js","sourceRoot":"","sources":["../../../src/functions/keys/resolve.key.pair.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,+BAAuD;AAGvD,8DAAoC;AACpC,oEAA2C;AAE3C,MAAM,cAAc,GAAG,KAAK,EAAE,UAA8B,EAAE,eAA2B,EAAwB,EAAE;IAClH,IAAI,UAAqB,CAAC;IAC1B,IAAI,CAAC;QACJ,UAAU,GAAG,QAAQ,KAAK,OAAO,UAAU,CAAC,CAAC,CAAE,CAAC,MAAM,IAAA,kBAAW,EAAC,IAAA,uBAAY,EAAC,UAAU,CAAC,EAAE,OAAO,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAe,CAAC,CAAC,CAAC,UAAU,CAAC;IACvJ,CAAC;IAAC,MAAM,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,CAAC,IAAA,oBAAQ,EAAC,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9F,IAAI,eAAe;QAAE,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,eAAe,EAAC,CAAC;IACrE,IAAI,KAAK,KAAK,UAAU,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;IAE1I,MAAM,EAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAC,GAAG,MAAM,IAAA,gBAAS,EAAC,UAAU,CAAC,CAAC;IAChD,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,CAAC,MAAM,IAAA,gBAAS,EAAC,EAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAC,EAAE,OAAO,CAAC,CAAc,EAAC,CAAC;AACtF,CAAC,CAAC;AACF,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const normalize_pem_1 = __importDefault(require("./normalize.pem"));
|
|
7
|
+
const signingKeyFromEnv = (env, name) => {
|
|
8
|
+
const value = env[name];
|
|
9
|
+
if (!value)
|
|
10
|
+
throw new Error(`${name} is not set`);
|
|
11
|
+
return (0, normalize_pem_1.default)(value);
|
|
12
|
+
};
|
|
13
|
+
exports.default = signingKeyFromEnv;
|
|
14
|
+
//# sourceMappingURL=signing.key.from.env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signing.key.from.env.js","sourceRoot":"","sources":["../../../src/functions/keys/signing.key.from.env.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,oEAA2C;AAE3C,MAAM,iBAAiB,GAAG,CAAC,GAAuC,EAAE,IAAY,EAAU,EAAE;IAC3F,MAAM,KAAK,GAAuB,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC;IAClD,OAAO,IAAA,uBAAY,EAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC;AACF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const wrapPem = (der) => {
|
|
4
|
+
let binary = '';
|
|
5
|
+
for (const byte of der)
|
|
6
|
+
binary += String.fromCharCode(byte);
|
|
7
|
+
const lines = btoa(binary).match(/.{1,64}/g) ?? [];
|
|
8
|
+
return `-----BEGIN PRIVATE KEY-----\n${lines.join('\n')}\n-----END PRIVATE KEY-----`;
|
|
9
|
+
};
|
|
10
|
+
exports.default = wrapPem;
|
|
11
|
+
//# sourceMappingURL=wrap.pem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.pem.js","sourceRoot":"","sources":["../../../src/functions/keys/wrap.pem.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,OAAO,GAAG,CAAC,GAAe,EAAU,EAAE;IAC3C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAa,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAC7D,OAAO,gCAAgC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC;AACtF,CAAC,CAAC;AACF,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const build_redirect_1 = __importDefault(require("./build.redirect"));
|
|
7
|
+
const buildErrorRedirect = (redirectUri, issuer, error, description, state) => (0, build_redirect_1.default)(redirectUri, issuer, { error, error_description: description, state });
|
|
8
|
+
exports.default = buildErrorRedirect;
|
|
9
|
+
//# sourceMappingURL=build.error.redirect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.error.redirect.js","sourceRoot":"","sources":["../../../src/functions/redirect/build.error.redirect.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,sEAA6C;AAE7C,MAAM,kBAAkB,GAAG,CAAC,WAAmB,EAAE,MAAc,EAAE,KAAa,EAAE,WAAmB,EAAE,KAAc,EAAU,EAAE,CAC9H,IAAA,wBAAa,EAAC,WAAW,EAAE,MAAM,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC,CAAC;AACpF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const buildRedirect = (redirectUri, issuer, params) => {
|
|
4
|
+
const target = new URL(redirectUri);
|
|
5
|
+
for (const [key, value] of Object.entries(params))
|
|
6
|
+
if (value)
|
|
7
|
+
target.searchParams.set(key, value);
|
|
8
|
+
target.searchParams.set('iss', issuer);
|
|
9
|
+
return target.toString();
|
|
10
|
+
};
|
|
11
|
+
exports.default = buildRedirect;
|
|
12
|
+
//# sourceMappingURL=build.redirect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.redirect.js","sourceRoot":"","sources":["../../../src/functions/redirect/build.redirect.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,MAAc,EAAE,MAA0C,EAAU,EAAE;IACjH,MAAM,MAAM,GAAQ,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,IAAI,KAAK;YAAE,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC,CAAC;AACF,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const describeRedirectTarget = (redirectUri) => {
|
|
4
|
+
const url = new URL(redirectUri);
|
|
5
|
+
return url.protocol.startsWith('http') ? url.host : `${url.protocol}//${url.host}`;
|
|
6
|
+
};
|
|
7
|
+
exports.default = describeRedirectTarget;
|
|
8
|
+
//# sourceMappingURL=describe.redirect.target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.redirect.target.js","sourceRoot":"","sources":["../../../src/functions/redirect/describe.redirect.target.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAU,EAAE;IAC9D,MAAM,GAAG,GAAQ,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACtC,OAAO,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;AACpF,CAAC,CAAC;AACF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const parse_url_1 = __importDefault(require("./parse.url"));
|
|
7
|
+
const loopbackHosts = ['localhost', '127.0.0.1'];
|
|
8
|
+
const isAllowedRedirectUri = (redirectUri, policy) => {
|
|
9
|
+
const url = (0, parse_url_1.default)(redirectUri);
|
|
10
|
+
if (!url || url.hash || 'string' !== typeof redirectUri || redirectUri.includes('#'))
|
|
11
|
+
return false;
|
|
12
|
+
if ('http:' === url.protocol)
|
|
13
|
+
return loopbackHosts.includes(url.hostname);
|
|
14
|
+
if ('https:' === url.protocol)
|
|
15
|
+
return policy.httpsHosts.includes(url.hostname);
|
|
16
|
+
return policy.customSchemes.some((scheme) => redirectUri.startsWith(scheme));
|
|
17
|
+
};
|
|
18
|
+
exports.default = isAllowedRedirectUri;
|
|
19
|
+
//# sourceMappingURL=is.allowed.redirect.uri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.allowed.redirect.uri.js","sourceRoot":"","sources":["../../../src/functions/redirect/is.allowed.redirect.uri.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAGb,4DAAmC;AAEnC,MAAM,aAAa,GAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE3D,MAAM,oBAAoB,GAAG,CAAC,WAAoB,EAAE,MAA0B,EAAW,EAAE;IAC1F,MAAM,GAAG,GAAe,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,IAAI,QAAQ,KAAK,OAAO,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACnG,IAAI,OAAO,KAAK,GAAG,CAAC,QAAQ;QAAE,OAAO,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1E,IAAI,QAAQ,KAAK,GAAG,CAAC,QAAQ;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAc,EAAW,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC;AACF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const parse_url_1 = __importDefault(require("./parse.url"));
|
|
7
|
+
const loopbackHosts = ['localhost', '127.0.0.1'];
|
|
8
|
+
const isLoopbackRedirect = (redirectUri) => {
|
|
9
|
+
const url = (0, parse_url_1.default)(redirectUri);
|
|
10
|
+
return !!url && 'http:' === url.protocol && loopbackHosts.includes(url.hostname);
|
|
11
|
+
};
|
|
12
|
+
exports.default = isLoopbackRedirect;
|
|
13
|
+
//# sourceMappingURL=is.loopback.redirect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.loopback.redirect.js","sourceRoot":"","sources":["../../../src/functions/redirect/is.loopback.redirect.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,4DAAmC;AAEnC,MAAM,aAAa,GAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE3D,MAAM,kBAAkB,GAAG,CAAC,WAAmB,EAAW,EAAE;IAC3D,MAAM,GAAG,GAAe,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;IAC9C,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,KAAK,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAClF,CAAC,CAAC;AACF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const parse_url_1 = __importDefault(require("./parse.url"));
|
|
7
|
+
const loopbackHosts = ['localhost', '127.0.0.1'];
|
|
8
|
+
const dangerousSchemes = ['javascript:', 'data:', 'file:', 'vbscript:', 'blob:', 'about:'];
|
|
9
|
+
const isSafeMetadataRedirectUri = (redirectUri) => {
|
|
10
|
+
const url = (0, parse_url_1.default)(redirectUri);
|
|
11
|
+
if (!url || 'string' !== typeof redirectUri || redirectUri.includes('#'))
|
|
12
|
+
return false;
|
|
13
|
+
if ('http:' === url.protocol)
|
|
14
|
+
return loopbackHosts.includes(url.hostname);
|
|
15
|
+
if ('https:' === url.protocol)
|
|
16
|
+
return true;
|
|
17
|
+
return !dangerousSchemes.includes(url.protocol);
|
|
18
|
+
};
|
|
19
|
+
exports.default = isSafeMetadataRedirectUri;
|
|
20
|
+
//# sourceMappingURL=is.safe.metadata.redirect.uri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.safe.metadata.redirect.uri.js","sourceRoot":"","sources":["../../../src/functions/redirect/is.safe.metadata.redirect.uri.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,4DAAmC;AAEnC,MAAM,aAAa,GAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC3D,MAAM,gBAAgB,GAAa,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAErG,MAAM,yBAAyB,GAAG,CAAC,WAAoB,EAAW,EAAE;IACnE,MAAM,GAAG,GAAe,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC,GAAG,IAAI,QAAQ,KAAK,OAAO,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACvF,IAAI,OAAO,KAAK,GAAG,CAAC,QAAQ;QAAE,OAAO,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1E,IAAI,QAAQ,KAAK,GAAG,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC,CAAC;AACF,kBAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parseUrl = (value) => {
|
|
4
|
+
if ('string' !== typeof value)
|
|
5
|
+
return null;
|
|
6
|
+
try {
|
|
7
|
+
return new URL(value);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.default = parseUrl;
|
|
14
|
+
//# sourceMappingURL=parse.url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.url.js","sourceRoot":"","sources":["../../../src/functions/redirect/parse.url.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAc,EAAE;IAC/C,IAAI,QAAQ,KAAK,OAAO,KAAK;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,CAAC;QACJ,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC,CAAC;AACF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type AuthenticatedUserType from '../../types/authenticated.user.type';
|
|
2
|
+
import type HttpResponseType from '../../types/http.response.type';
|
|
3
|
+
import type McpAuthContextType from '../../types/mcp.auth.context.type';
|
|
4
|
+
import type PendingAuthorizationType from '../../types/pending.authorization.type';
|
|
5
|
+
declare const attachAndContinue: (context: McpAuthContextType<any>, pending: PendingAuthorizationType, user: AuthenticatedUserType) => Promise<HttpResponseType>;
|
|
6
|
+
export default attachAndContinue;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const oauth_error_response_1 = __importDefault(require("../http/oauth.error.response"));
|
|
7
|
+
const continue_with_user_1 = __importDefault(require("./continue.with.user"));
|
|
8
|
+
const attachAndContinue = async (context, pending, user) => {
|
|
9
|
+
const attached = await context.options.storage.attachUserToPendingAuthorization(pending.stateId, user.id, context.now(), user.displayName);
|
|
10
|
+
if (!attached)
|
|
11
|
+
return (0, oauth_error_response_1.default)(400, 'invalid_request', 'unknown or already used state');
|
|
12
|
+
return (0, continue_with_user_1.default)(context, attached);
|
|
13
|
+
};
|
|
14
|
+
exports.default = attachAndContinue;
|
|
15
|
+
//# sourceMappingURL=attach.and.continue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.and.continue.js","sourceRoot":"","sources":["../../../src/functions/server/attach.and.continue.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAMb,wFAA8D;AAC9D,8EAAoD;AAEpD,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAgC,EAAE,OAAiC,EAAE,IAA2B,EAA6B,EAAE;IAC/J,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3I,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAA,8BAAkB,EAAC,GAAG,EAAE,iBAAiB,EAAE,+BAA+B,CAAC,CAAC;IAClG,OAAO,IAAA,4BAAgB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC,CAAC;AACF,kBAAe,iBAAiB,CAAC"}
|