@nocobase/plugin-idp-oauth 2.1.0-alpha.10
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/LICENSE.txt +107 -0
- package/README.md +14 -0
- package/build.config.ts +46 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/ErrorPage.d.ts +11 -0
- package/dist/client/InteractionPage.d.ts +11 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.js +10 -0
- package/dist/client/locale.d.ts +10 -0
- package/dist/client/models/index.d.ts +11 -0
- package/dist/client/plugin.d.ts +13 -0
- package/dist/externalVersion.js +18 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +1 -0
- package/dist/locale/zh-CN.json +1 -0
- package/dist/node_modules/eta/LICENSE +7 -0
- package/dist/node_modules/eta/README.md +185 -0
- package/dist/node_modules/eta/dist/core.d.ts +179 -0
- package/dist/node_modules/eta/dist/core.d.ts.map +1 -0
- package/dist/node_modules/eta/dist/core.js +42 -0
- package/dist/node_modules/eta/dist/core.js.map +1 -0
- package/dist/node_modules/eta/dist/index.cjs +542 -0
- package/dist/node_modules/eta/dist/index.cjs.map +1 -0
- package/dist/node_modules/eta/dist/index.d.cts +187 -0
- package/dist/node_modules/eta/dist/index.d.cts.map +1 -0
- package/dist/node_modules/eta/dist/index.d.mts +187 -0
- package/dist/node_modules/eta/dist/index.d.mts.map +1 -0
- package/dist/node_modules/eta/dist/index.mjs +512 -0
- package/dist/node_modules/eta/dist/index.mjs.map +1 -0
- package/dist/node_modules/eta/package.json +75 -0
- package/dist/node_modules/jose/LICENSE.md +21 -0
- package/dist/node_modules/jose/README.md +153 -0
- package/dist/node_modules/jose/dist/types/index.d.ts +55 -0
- package/dist/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +31 -0
- package/dist/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +65 -0
- package/dist/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +31 -0
- package/dist/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +83 -0
- package/dist/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +38 -0
- package/dist/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
- package/dist/node_modules/jose/dist/types/jwk/embedded.d.ts +17 -0
- package/dist/node_modules/jose/dist/types/jwk/thumbprint.d.ts +32 -0
- package/dist/node_modules/jose/dist/types/jwks/local.d.ts +29 -0
- package/dist/node_modules/jose/dist/types/jwks/remote.d.ts +237 -0
- package/dist/node_modules/jose/dist/types/jws/compact/sign.d.ts +36 -0
- package/dist/node_modules/jose/dist/types/jws/compact/verify.d.ts +33 -0
- package/dist/node_modules/jose/dist/types/jws/flattened/sign.d.ts +42 -0
- package/dist/node_modules/jose/dist/types/jws/flattened/verify.d.ts +33 -0
- package/dist/node_modules/jose/dist/types/jws/general/sign.d.ts +53 -0
- package/dist/node_modules/jose/dist/types/jws/general/verify.d.ts +41 -0
- package/dist/node_modules/jose/dist/types/jwt/decrypt.d.ts +35 -0
- package/dist/node_modules/jose/dist/types/jwt/encrypt.d.ts +91 -0
- package/dist/node_modules/jose/dist/types/jwt/sign.d.ts +43 -0
- package/dist/node_modules/jose/dist/types/jwt/unsecured.d.ts +43 -0
- package/dist/node_modules/jose/dist/types/jwt/verify.d.ts +37 -0
- package/dist/node_modules/jose/dist/types/key/export.d.ts +33 -0
- package/dist/node_modules/jose/dist/types/key/generate_key_pair.d.ts +47 -0
- package/dist/node_modules/jose/dist/types/key/generate_secret.d.ts +35 -0
- package/dist/node_modules/jose/dist/types/key/import.d.ts +83 -0
- package/dist/node_modules/jose/dist/types/types.d.ts +852 -0
- package/dist/node_modules/jose/dist/types/util/base64url.d.ts +9 -0
- package/dist/node_modules/jose/dist/types/util/decode_jwt.d.ts +18 -0
- package/dist/node_modules/jose/dist/types/util/decode_protected_header.d.ts +17 -0
- package/dist/node_modules/jose/dist/types/util/errors.d.ts +213 -0
- package/dist/node_modules/jose/dist/webapi/index.js +32 -0
- package/dist/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +27 -0
- package/dist/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
- package/dist/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +155 -0
- package/dist/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +165 -0
- package/dist/node_modules/jose/dist/webapi/jwe/general/decrypt.js +31 -0
- package/dist/node_modules/jose/dist/webapi/jwe/general/encrypt.js +182 -0
- package/dist/node_modules/jose/dist/webapi/jwk/embedded.js +17 -0
- package/dist/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
- package/dist/node_modules/jose/dist/webapi/jwks/local.js +119 -0
- package/dist/node_modules/jose/dist/webapi/jwks/remote.js +179 -0
- package/dist/node_modules/jose/dist/webapi/jws/compact/sign.js +18 -0
- package/dist/node_modules/jose/dist/webapi/jws/compact/verify.js +21 -0
- package/dist/node_modules/jose/dist/webapi/jws/flattened/sign.js +89 -0
- package/dist/node_modules/jose/dist/webapi/jws/flattened/verify.js +110 -0
- package/dist/node_modules/jose/dist/webapi/jws/general/sign.js +70 -0
- package/dist/node_modules/jose/dist/webapi/jws/general/verify.js +24 -0
- package/dist/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
- package/dist/node_modules/jose/dist/webapi/jwt/encrypt.js +101 -0
- package/dist/node_modules/jose/dist/webapi/jwt/sign.js +52 -0
- package/dist/node_modules/jose/dist/webapi/jwt/unsecured.js +63 -0
- package/dist/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/dist/node_modules/jose/dist/webapi/key/export.js +11 -0
- package/dist/node_modules/jose/dist/webapi/key/generate_key_pair.js +97 -0
- package/dist/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
- package/dist/node_modules/jose/dist/webapi/key/import.js +57 -0
- package/dist/node_modules/jose/dist/webapi/lib/aesgcmkw.js +15 -0
- package/dist/node_modules/jose/dist/webapi/lib/aeskw.js +25 -0
- package/dist/node_modules/jose/dist/webapi/lib/asn1.js +243 -0
- package/dist/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/dist/node_modules/jose/dist/webapi/lib/buffer_utils.js +43 -0
- package/dist/node_modules/jose/dist/webapi/lib/check_key_type.js +122 -0
- package/dist/node_modules/jose/dist/webapi/lib/content_encryption.js +217 -0
- package/dist/node_modules/jose/dist/webapi/lib/crypto_key.js +136 -0
- package/dist/node_modules/jose/dist/webapi/lib/deflate.js +44 -0
- package/dist/node_modules/jose/dist/webapi/lib/ecdhes.js +52 -0
- package/dist/node_modules/jose/dist/webapi/lib/helpers.js +19 -0
- package/dist/node_modules/jose/dist/webapi/lib/invalid_key_input.js +27 -0
- package/dist/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/dist/node_modules/jose/dist/webapi/lib/jwk_to_key.js +107 -0
- package/dist/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +238 -0
- package/dist/node_modules/jose/dist/webapi/lib/key_management.js +186 -0
- package/dist/node_modules/jose/dist/webapi/lib/key_to_jwk.js +31 -0
- package/dist/node_modules/jose/dist/webapi/lib/normalize_key.js +166 -0
- package/dist/node_modules/jose/dist/webapi/lib/pbes2kw.js +39 -0
- package/dist/node_modules/jose/dist/webapi/lib/rsaes.js +24 -0
- package/dist/node_modules/jose/dist/webapi/lib/signing.js +68 -0
- package/dist/node_modules/jose/dist/webapi/lib/type_checks.js +40 -0
- package/dist/node_modules/jose/dist/webapi/lib/validate_algorithms.js +10 -0
- package/dist/node_modules/jose/dist/webapi/lib/validate_crit.js +33 -0
- package/dist/node_modules/jose/dist/webapi/util/base64url.js +30 -0
- package/dist/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/dist/node_modules/jose/dist/webapi/util/decode_protected_header.js +34 -0
- package/dist/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/dist/node_modules/jose/package.json +200 -0
- package/dist/node_modules/light-my-request/.gitattributes +2 -0
- package/dist/node_modules/light-my-request/.github/dependabot.yml +13 -0
- package/dist/node_modules/light-my-request/.github/stale.yml +21 -0
- package/dist/node_modules/light-my-request/.github/workflows/benchmark.yml +30 -0
- package/dist/node_modules/light-my-request/.github/workflows/ci.yml +23 -0
- package/dist/node_modules/light-my-request/LICENSE +32 -0
- package/dist/node_modules/light-my-request/benchmark/benchmark.js +164 -0
- package/dist/node_modules/light-my-request/build/build-validation.js +100 -0
- package/dist/node_modules/light-my-request/eslint.config.js +9 -0
- package/dist/node_modules/light-my-request/index.js +2 -0
- package/dist/node_modules/light-my-request/lib/config-validator.js +919 -0
- package/dist/node_modules/light-my-request/lib/form-data.js +79 -0
- package/dist/node_modules/light-my-request/lib/parse-url.js +47 -0
- package/dist/node_modules/light-my-request/lib/request.js +290 -0
- package/dist/node_modules/light-my-request/lib/response.js +240 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/.gitattributes +2 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/.github/dependabot.yml +13 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/.github/workflows/ci.yml +24 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/.taprc +2 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/benchmarks/warn.js +25 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/eslint.config.js +6 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/examples/example.js +11 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/index.js +124 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/package.json +73 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-interpolated-string.test.js +29 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-once-only.test.js +28 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-reset.test.js +36 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-set.test.js +30 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-unlimited.test.js +37 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/index.test.js +99 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/issue-88.test.js +33 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/jest.test.js +22 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/test/no-warnings.test.js +80 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/types/index.d.ts +37 -0
- package/dist/node_modules/light-my-request/node_modules/process-warning/types/index.test-d.ts +36 -0
- package/dist/node_modules/light-my-request/package.json +1 -0
- package/dist/node_modules/light-my-request/test/async-await.test.js +55 -0
- package/dist/node_modules/light-my-request/test/index.test.js +2316 -0
- package/dist/node_modules/light-my-request/test/request.test.js +16 -0
- package/dist/node_modules/light-my-request/test/response.test.js +19 -0
- package/dist/node_modules/light-my-request/test/stream.test.js +359 -0
- package/dist/node_modules/light-my-request/types/index.d.ts +128 -0
- package/dist/node_modules/light-my-request/types/index.test-d.ts +149 -0
- package/dist/node_modules/oidc-provider/LICENSE.md +21 -0
- package/dist/node_modules/oidc-provider/README.md +174 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/assign_claims.js +28 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/assign_defaults.js +17 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/authenticated_client_id.js +6 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/backchannel_request_remap_errors.js +17 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/backchannel_request_response.js +41 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_ciba_context.js +12 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_claims.js +68 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_client.js +21 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_client_grant_type.js +21 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_dpop_jkt.js +35 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_extra_params.js +18 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_id_token_hint.js +23 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_max_age.js +25 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_openid_scope.js +47 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_pkce.js +41 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_prompt.js +25 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_redirect_uri.js +41 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_requested_expiry.js +16 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_response_mode.js +54 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_response_type.js +26 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/check_scope.js +53 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/ciba_load_account.js +58 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/ciba_required.js +13 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/device_authorization_response.js +31 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow.js +31 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow_errors.js +37 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow_response.js +55 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/index.js +200 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/interaction_emit.js +9 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/interactions.js +149 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/load_account.js +15 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/load_grant.js +29 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/load_pushed_authorization_request.js +36 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/oauth_required.js +11 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/oidc_required.js +27 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/one_redirect_uri_clients.js +20 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/process_request_object.js +214 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/pushed_authorization_request_remap_errors.js +17 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/pushed_authorization_request_response.js +65 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_registration.js +12 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_request_and_uri.js +12 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_unsupported.js +33 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/respond.js +46 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/resume.js +111 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/strip_outside_jar_params.js +19 -0
- package/dist/node_modules/oidc-provider/lib/actions/authorization/unsupported_rar.js +9 -0
- package/dist/node_modules/oidc-provider/lib/actions/challenge.js +22 -0
- package/dist/node_modules/oidc-provider/lib/actions/code_verification.js +122 -0
- package/dist/node_modules/oidc-provider/lib/actions/discovery.js +151 -0
- package/dist/node_modules/oidc-provider/lib/actions/end_session.js +222 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/authorization_code.js +144 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/ciba.js +127 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/client_credentials.js +79 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/device_code.js +125 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/index.js +7 -0
- package/dist/node_modules/oidc-provider/lib/actions/grants/refresh_token.js +229 -0
- package/dist/node_modules/oidc-provider/lib/actions/index.js +25 -0
- package/dist/node_modules/oidc-provider/lib/actions/interaction.js +150 -0
- package/dist/node_modules/oidc-provider/lib/actions/introspection.js +164 -0
- package/dist/node_modules/oidc-provider/lib/actions/jwks.js +7 -0
- package/dist/node_modules/oidc-provider/lib/actions/registration.js +274 -0
- package/dist/node_modules/oidc-provider/lib/actions/revocation.js +81 -0
- package/dist/node_modules/oidc-provider/lib/actions/token.js +74 -0
- package/dist/node_modules/oidc-provider/lib/actions/userinfo.js +183 -0
- package/dist/node_modules/oidc-provider/lib/adapters/memory_adapter.js +95 -0
- package/dist/node_modules/oidc-provider/lib/consts/client_attributes.js +211 -0
- package/dist/node_modules/oidc-provider/lib/consts/dev_keystore.js +18 -0
- package/dist/node_modules/oidc-provider/lib/consts/index.js +13 -0
- package/dist/node_modules/oidc-provider/lib/consts/jwa.js +47 -0
- package/dist/node_modules/oidc-provider/lib/consts/non_rejectable_claims.js +1 -0
- package/dist/node_modules/oidc-provider/lib/consts/param_list.js +23 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/camel_case.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/defaults.js +28 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/difference.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/is_plain_object.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/map_keys.js +9 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/merge.js +25 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/omit_by.js +11 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/pick.js +10 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/pick_by.js +10 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/remove.js +9 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/set.js +18 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/snake_case.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/_/upper_first.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/account_claims.js +6 -0
- package/dist/node_modules/oidc-provider/lib/helpers/add_client.js +14 -0
- package/dist/node_modules/oidc-provider/lib/helpers/als.js +3 -0
- package/dist/node_modules/oidc-provider/lib/helpers/append_www_authenticate.js +9 -0
- package/dist/node_modules/oidc-provider/lib/helpers/attention.js +23 -0
- package/dist/node_modules/oidc-provider/lib/helpers/base64url.js +11 -0
- package/dist/node_modules/oidc-provider/lib/helpers/certificate_thumbprint.js +15 -0
- package/dist/node_modules/oidc-provider/lib/helpers/challenge.js +111 -0
- package/dist/node_modules/oidc-provider/lib/helpers/check_attest_binding.js +10 -0
- package/dist/node_modules/oidc-provider/lib/helpers/claims.js +79 -0
- package/dist/node_modules/oidc-provider/lib/helpers/client_id_metadata_document.js +198 -0
- package/dist/node_modules/oidc-provider/lib/helpers/client_schema.js +700 -0
- package/dist/node_modules/oidc-provider/lib/helpers/combined_scope.js +17 -0
- package/dist/node_modules/oidc-provider/lib/helpers/configuration.js +544 -0
- package/dist/node_modules/oidc-provider/lib/helpers/constant_equals.js +20 -0
- package/dist/node_modules/oidc-provider/lib/helpers/defaults.js +3510 -0
- package/dist/node_modules/oidc-provider/lib/helpers/epoch_time.js +1 -0
- package/dist/node_modules/oidc-provider/lib/helpers/err_out.js +17 -0
- package/dist/node_modules/oidc-provider/lib/helpers/errors.js +161 -0
- package/dist/node_modules/oidc-provider/lib/helpers/features.js +51 -0
- package/dist/node_modules/oidc-provider/lib/helpers/fetch_body_check.js +25 -0
- package/dist/node_modules/oidc-provider/lib/helpers/fetch_request.js +221 -0
- package/dist/node_modules/oidc-provider/lib/helpers/filter_claims.js +16 -0
- package/dist/node_modules/oidc-provider/lib/helpers/formatters.js +24 -0
- package/dist/node_modules/oidc-provider/lib/helpers/grant_common.js +214 -0
- package/dist/node_modules/oidc-provider/lib/helpers/html_safe.js +19 -0
- package/dist/node_modules/oidc-provider/lib/helpers/initialize_adapter.js +24 -0
- package/dist/node_modules/oidc-provider/lib/helpers/initialize_app.js +243 -0
- package/dist/node_modules/oidc-provider/lib/helpers/initialize_clients.js +24 -0
- package/dist/node_modules/oidc-provider/lib/helpers/initialize_keystore.js +310 -0
- package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/check.js +21 -0
- package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/index.js +43 -0
- package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompt.js +95 -0
- package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompts/consent.js +105 -0
- package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompts/login.js +162 -0
- package/dist/node_modules/oidc-provider/lib/helpers/jwt.js +211 -0
- package/dist/node_modules/oidc-provider/lib/helpers/keystore.js +301 -0
- package/dist/node_modules/oidc-provider/lib/helpers/nanoid.js +5 -0
- package/dist/node_modules/oidc-provider/lib/helpers/oidc_context.js +284 -0
- package/dist/node_modules/oidc-provider/lib/helpers/params.js +27 -0
- package/dist/node_modules/oidc-provider/lib/helpers/pkce.js +30 -0
- package/dist/node_modules/oidc-provider/lib/helpers/pkce_format.js +17 -0
- package/dist/node_modules/oidc-provider/lib/helpers/process_response_types.js +202 -0
- package/dist/node_modules/oidc-provider/lib/helpers/re_render_errors.js +39 -0
- package/dist/node_modules/oidc-provider/lib/helpers/redirect_uri.js +16 -0
- package/dist/node_modules/oidc-provider/lib/helpers/resolve_resource.js +33 -0
- package/dist/node_modules/oidc-provider/lib/helpers/resolve_response_mode.js +7 -0
- package/dist/node_modules/oidc-provider/lib/helpers/resource_server.js +20 -0
- package/dist/node_modules/oidc-provider/lib/helpers/revoke.js +27 -0
- package/dist/node_modules/oidc-provider/lib/helpers/script_src_sha.js +21 -0
- package/dist/node_modules/oidc-provider/lib/helpers/sector_identifier.js +19 -0
- package/dist/node_modules/oidc-provider/lib/helpers/sector_validate.js +55 -0
- package/dist/node_modules/oidc-provider/lib/helpers/set_rt_bindings.js +21 -0
- package/dist/node_modules/oidc-provider/lib/helpers/token_find.js +51 -0
- package/dist/node_modules/oidc-provider/lib/helpers/type_validators.js +8 -0
- package/dist/node_modules/oidc-provider/lib/helpers/user_code_form.js +19 -0
- package/dist/node_modules/oidc-provider/lib/helpers/user_codes.js +38 -0
- package/dist/node_modules/oidc-provider/lib/helpers/valid_url.js +8 -0
- package/dist/node_modules/oidc-provider/lib/helpers/validate_dpop.js +129 -0
- package/dist/node_modules/oidc-provider/lib/helpers/validate_presence.js +17 -0
- package/dist/node_modules/oidc-provider/lib/helpers/weak_cache.js +11 -0
- package/dist/node_modules/oidc-provider/lib/index.js +21 -0
- package/dist/node_modules/oidc-provider/lib/models/access_token.js +31 -0
- package/dist/node_modules/oidc-provider/lib/models/authorization_code.js +27 -0
- package/dist/node_modules/oidc-provider/lib/models/backchannel_authentication_request.js +26 -0
- package/dist/node_modules/oidc-provider/lib/models/base_model.js +141 -0
- package/dist/node_modules/oidc-provider/lib/models/base_token.js +86 -0
- package/dist/node_modules/oidc-provider/lib/models/client.js +593 -0
- package/dist/node_modules/oidc-provider/lib/models/client_credentials.js +19 -0
- package/dist/node_modules/oidc-provider/lib/models/device_code.js +44 -0
- package/dist/node_modules/oidc-provider/lib/models/formats/dynamic.js +21 -0
- package/dist/node_modules/oidc-provider/lib/models/formats/index.js +14 -0
- package/dist/node_modules/oidc-provider/lib/models/formats/jwt.js +198 -0
- package/dist/node_modules/oidc-provider/lib/models/formats/opaque.js +58 -0
- package/dist/node_modules/oidc-provider/lib/models/grant.js +243 -0
- package/dist/node_modules/oidc-provider/lib/models/id_token.js +271 -0
- package/dist/node_modules/oidc-provider/lib/models/index.js +37 -0
- package/dist/node_modules/oidc-provider/lib/models/initial_access_token.js +12 -0
- package/dist/node_modules/oidc-provider/lib/models/interaction.js +73 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/apply.js +4 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/consumable.js +17 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/has_format.js +46 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/has_grant_id.js +12 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/has_grant_type.js +8 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/has_policies.js +38 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/is_attestation_constrained.js +15 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/is_sender_constrained.js +50 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/is_session_bound.js +38 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/set_audience.js +21 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/stores_auth.js +16 -0
- package/dist/node_modules/oidc-provider/lib/models/mixins/stores_pkce.js +9 -0
- package/dist/node_modules/oidc-provider/lib/models/pushed_authorization_request.js +21 -0
- package/dist/node_modules/oidc-provider/lib/models/refresh_token.js +47 -0
- package/dist/node_modules/oidc-provider/lib/models/registration_access_token.js +8 -0
- package/dist/node_modules/oidc-provider/lib/models/replay_detection.js +31 -0
- package/dist/node_modules/oidc-provider/lib/models/session.js +192 -0
- package/dist/node_modules/oidc-provider/lib/provider.js +453 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/form_post.js +36 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/fragment.js +7 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/index.js +15 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/jwt.js +43 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/query.js +7 -0
- package/dist/node_modules/oidc-provider/lib/response_modes/web_message.js +55 -0
- package/dist/node_modules/oidc-provider/lib/shared/assemble_params.js +7 -0
- package/dist/node_modules/oidc-provider/lib/shared/attest_client_auth.js +111 -0
- package/dist/node_modules/oidc-provider/lib/shared/authorization_error_handler.js +104 -0
- package/dist/node_modules/oidc-provider/lib/shared/check_rar.js +75 -0
- package/dist/node_modules/oidc-provider/lib/shared/check_resource.js +77 -0
- package/dist/node_modules/oidc-provider/lib/shared/client_auth.js +263 -0
- package/dist/node_modules/oidc-provider/lib/shared/conditional_body.js +9 -0
- package/dist/node_modules/oidc-provider/lib/shared/cors.js +49 -0
- package/dist/node_modules/oidc-provider/lib/shared/error_handler.js +59 -0
- package/dist/node_modules/oidc-provider/lib/shared/jwt_client_auth.js +79 -0
- package/dist/node_modules/oidc-provider/lib/shared/no_cache.js +4 -0
- package/dist/node_modules/oidc-provider/lib/shared/reject_dupes.js +45 -0
- package/dist/node_modules/oidc-provider/lib/shared/reject_structured_tokens.js +18 -0
- package/dist/node_modules/oidc-provider/lib/shared/selective_body.js +60 -0
- package/dist/node_modules/oidc-provider/lib/shared/session.js +68 -0
- package/dist/node_modules/oidc-provider/lib/shared/set_www_authenticate_header.js +52 -0
- package/dist/node_modules/oidc-provider/lib/views/index.js +22 -0
- package/dist/node_modules/oidc-provider/lib/views/interaction.js +171 -0
- package/dist/node_modules/oidc-provider/lib/views/layout.js +237 -0
- package/dist/node_modules/oidc-provider/lib/views/login.js +43 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/LICENSE +21 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/README.md +1370 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.d.mts +1003 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.d.ts +1003 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.js +1616 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.mjs +1573 -0
- package/dist/node_modules/oidc-provider/node_modules/@koa/router/package.json +122 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/LICENSE +20 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/README.md +481 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/package.json +64 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/oidc-provider/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/oidc-provider/node_modules/http-errors/HISTORY.md +186 -0
- package/dist/node_modules/oidc-provider/node_modules/http-errors/LICENSE +23 -0
- package/dist/node_modules/oidc-provider/node_modules/http-errors/README.md +169 -0
- package/dist/node_modules/oidc-provider/node_modules/http-errors/index.js +290 -0
- package/dist/node_modules/oidc-provider/node_modules/http-errors/package.json +54 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/LICENSE-MIT.txt +20 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/README.md +422 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/bin/jsesc +148 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/jsesc.js +337 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/man/jsesc.1 +94 -0
- package/dist/node_modules/oidc-provider/node_modules/jsesc/package.json +56 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/LICENSE +20 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/README.md +38 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/bin/nanoid.js +55 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/index.browser.js +29 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/index.d.ts +106 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/index.js +47 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/nanoid.js +1 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/non-secure/index.d.ts +48 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/non-secure/index.js +21 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/package.json +46 -0
- package/dist/node_modules/oidc-provider/node_modules/nanoid/url-alphabet/index.js +2 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/LICENSE +21 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/Readme.md +224 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.d.ts +144 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.js +409 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.js.map +1 -0
- package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/package.json +64 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/HISTORY.md +87 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/LICENSE +23 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/README.md +139 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/codes.json +65 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/index.js +146 -0
- package/dist/node_modules/oidc-provider/node_modules/statuses/package.json +49 -0
- package/dist/node_modules/oidc-provider/package.json +95 -0
- package/dist/node_modules/quick-lru/index.d.ts +178 -0
- package/dist/node_modules/quick-lru/index.js +329 -0
- package/dist/node_modules/quick-lru/license +9 -0
- package/dist/node_modules/quick-lru/package.json +54 -0
- package/dist/node_modules/quick-lru/readme.md +236 -0
- package/dist/node_modules/statuses/HISTORY.md +65 -0
- package/dist/node_modules/statuses/LICENSE +23 -0
- package/dist/node_modules/statuses/README.md +127 -0
- package/dist/node_modules/statuses/codes.json +66 -0
- package/dist/node_modules/statuses/index.js +113 -0
- package/dist/node_modules/statuses/package.json +48 -0
- package/dist/server/cache-adapter.d.ts +33 -0
- package/dist/server/cache-adapter.js +159 -0
- package/dist/server/index.d.ts +10 -0
- package/dist/server/index.js +48 -0
- package/dist/server/interaction.d.ts +26 -0
- package/dist/server/interaction.js +172 -0
- package/dist/server/paths.d.ts +19 -0
- package/dist/server/paths.js +64 -0
- package/dist/server/plugin.d.ts +16 -0
- package/dist/server/plugin.js +108 -0
- package/dist/server/provider-dispatch.d.ts +32 -0
- package/dist/server/provider-dispatch.js +252 -0
- package/dist/server/service.d.ts +63 -0
- package/dist/server/service.js +540 -0
- package/dist/server/utils.d.ts +12 -0
- package/dist/server/utils.js +58 -0
- package/package.json +24 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Statuses
|
|
2
|
+
|
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
+
[![Build Status][travis-image]][travis-url]
|
|
7
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
+
|
|
9
|
+
HTTP status utility for node.
|
|
10
|
+
|
|
11
|
+
This module provides a list of status codes and messages sourced from
|
|
12
|
+
a few different projects:
|
|
13
|
+
|
|
14
|
+
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
|
15
|
+
* The [Node.js project](https://nodejs.org/)
|
|
16
|
+
* The [NGINX project](https://www.nginx.com/)
|
|
17
|
+
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
22
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
23
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
$ npm install statuses
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
<!-- eslint-disable no-unused-vars -->
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
var status = require('statuses')
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### var code = status(Integer || String)
|
|
38
|
+
|
|
39
|
+
If `Integer` or `String` is a valid HTTP code or status message, then the
|
|
40
|
+
appropriate `code` will be returned. Otherwise, an error will be thrown.
|
|
41
|
+
|
|
42
|
+
<!-- eslint-disable no-undef -->
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
status(403) // => 403
|
|
46
|
+
status('403') // => 403
|
|
47
|
+
status('forbidden') // => 403
|
|
48
|
+
status('Forbidden') // => 403
|
|
49
|
+
status(306) // throws, as it's not supported by node.js
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### status.STATUS_CODES
|
|
53
|
+
|
|
54
|
+
Returns an object which maps status codes to status messages, in
|
|
55
|
+
the same format as the
|
|
56
|
+
[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
|
57
|
+
|
|
58
|
+
### status.codes
|
|
59
|
+
|
|
60
|
+
Returns an array of all the status codes as `Integer`s.
|
|
61
|
+
|
|
62
|
+
### var msg = status[code]
|
|
63
|
+
|
|
64
|
+
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
|
65
|
+
|
|
66
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
status[404] // => 'Not Found'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### var code = status[msg]
|
|
73
|
+
|
|
74
|
+
Map of `status message` to `code`. `msg` can either be title-cased or
|
|
75
|
+
lower-cased. `undefined` for invalid `status message`s.
|
|
76
|
+
|
|
77
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
status['not found'] // => 404
|
|
81
|
+
status['Not Found'] // => 404
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### status.redirect[code]
|
|
85
|
+
|
|
86
|
+
Returns `true` if a status code is a valid redirect status.
|
|
87
|
+
|
|
88
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
status.redirect[200] // => undefined
|
|
92
|
+
status.redirect[301] // => true
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### status.empty[code]
|
|
96
|
+
|
|
97
|
+
Returns `true` if a status code expects an empty body.
|
|
98
|
+
|
|
99
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
status.empty[200] // => undefined
|
|
103
|
+
status.empty[204] // => true
|
|
104
|
+
status.empty[304] // => true
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### status.retry[code]
|
|
108
|
+
|
|
109
|
+
Returns `true` if you should retry the rest.
|
|
110
|
+
|
|
111
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
status.retry[501] // => undefined
|
|
115
|
+
status.retry[503] // => true
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
[npm-image]: https://img.shields.io/npm/v/statuses.svg
|
|
119
|
+
[npm-url]: https://npmjs.org/package/statuses
|
|
120
|
+
[node-version-image]: https://img.shields.io/node/v/statuses.svg
|
|
121
|
+
[node-version-url]: https://nodejs.org/en/download
|
|
122
|
+
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
|
|
123
|
+
[travis-url]: https://travis-ci.org/jshttp/statuses
|
|
124
|
+
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
|
|
125
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
|
126
|
+
[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
|
|
127
|
+
[downloads-url]: https://npmjs.org/package/statuses
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"100": "Continue",
|
|
3
|
+
"101": "Switching Protocols",
|
|
4
|
+
"102": "Processing",
|
|
5
|
+
"103": "Early Hints",
|
|
6
|
+
"200": "OK",
|
|
7
|
+
"201": "Created",
|
|
8
|
+
"202": "Accepted",
|
|
9
|
+
"203": "Non-Authoritative Information",
|
|
10
|
+
"204": "No Content",
|
|
11
|
+
"205": "Reset Content",
|
|
12
|
+
"206": "Partial Content",
|
|
13
|
+
"207": "Multi-Status",
|
|
14
|
+
"208": "Already Reported",
|
|
15
|
+
"226": "IM Used",
|
|
16
|
+
"300": "Multiple Choices",
|
|
17
|
+
"301": "Moved Permanently",
|
|
18
|
+
"302": "Found",
|
|
19
|
+
"303": "See Other",
|
|
20
|
+
"304": "Not Modified",
|
|
21
|
+
"305": "Use Proxy",
|
|
22
|
+
"306": "(Unused)",
|
|
23
|
+
"307": "Temporary Redirect",
|
|
24
|
+
"308": "Permanent Redirect",
|
|
25
|
+
"400": "Bad Request",
|
|
26
|
+
"401": "Unauthorized",
|
|
27
|
+
"402": "Payment Required",
|
|
28
|
+
"403": "Forbidden",
|
|
29
|
+
"404": "Not Found",
|
|
30
|
+
"405": "Method Not Allowed",
|
|
31
|
+
"406": "Not Acceptable",
|
|
32
|
+
"407": "Proxy Authentication Required",
|
|
33
|
+
"408": "Request Timeout",
|
|
34
|
+
"409": "Conflict",
|
|
35
|
+
"410": "Gone",
|
|
36
|
+
"411": "Length Required",
|
|
37
|
+
"412": "Precondition Failed",
|
|
38
|
+
"413": "Payload Too Large",
|
|
39
|
+
"414": "URI Too Long",
|
|
40
|
+
"415": "Unsupported Media Type",
|
|
41
|
+
"416": "Range Not Satisfiable",
|
|
42
|
+
"417": "Expectation Failed",
|
|
43
|
+
"418": "I'm a teapot",
|
|
44
|
+
"421": "Misdirected Request",
|
|
45
|
+
"422": "Unprocessable Entity",
|
|
46
|
+
"423": "Locked",
|
|
47
|
+
"424": "Failed Dependency",
|
|
48
|
+
"425": "Unordered Collection",
|
|
49
|
+
"426": "Upgrade Required",
|
|
50
|
+
"428": "Precondition Required",
|
|
51
|
+
"429": "Too Many Requests",
|
|
52
|
+
"431": "Request Header Fields Too Large",
|
|
53
|
+
"451": "Unavailable For Legal Reasons",
|
|
54
|
+
"500": "Internal Server Error",
|
|
55
|
+
"501": "Not Implemented",
|
|
56
|
+
"502": "Bad Gateway",
|
|
57
|
+
"503": "Service Unavailable",
|
|
58
|
+
"504": "Gateway Timeout",
|
|
59
|
+
"505": "HTTP Version Not Supported",
|
|
60
|
+
"506": "Variant Also Negotiates",
|
|
61
|
+
"507": "Insufficient Storage",
|
|
62
|
+
"508": "Loop Detected",
|
|
63
|
+
"509": "Bandwidth Limit Exceeded",
|
|
64
|
+
"510": "Not Extended",
|
|
65
|
+
"511": "Network Authentication Required"
|
|
66
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* statuses
|
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Module dependencies.
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var codes = require('./codes.json')
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Module exports.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
module.exports = status
|
|
23
|
+
|
|
24
|
+
// status code to message map
|
|
25
|
+
status.STATUS_CODES = codes
|
|
26
|
+
|
|
27
|
+
// array of status codes
|
|
28
|
+
status.codes = populateStatusesMap(status, codes)
|
|
29
|
+
|
|
30
|
+
// status codes for redirects
|
|
31
|
+
status.redirect = {
|
|
32
|
+
300: true,
|
|
33
|
+
301: true,
|
|
34
|
+
302: true,
|
|
35
|
+
303: true,
|
|
36
|
+
305: true,
|
|
37
|
+
307: true,
|
|
38
|
+
308: true
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// status codes for empty bodies
|
|
42
|
+
status.empty = {
|
|
43
|
+
204: true,
|
|
44
|
+
205: true,
|
|
45
|
+
304: true
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// status codes for when you should retry the request
|
|
49
|
+
status.retry = {
|
|
50
|
+
502: true,
|
|
51
|
+
503: true,
|
|
52
|
+
504: true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Populate the statuses map for given codes.
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
function populateStatusesMap (statuses, codes) {
|
|
61
|
+
var arr = []
|
|
62
|
+
|
|
63
|
+
Object.keys(codes).forEach(function forEachCode (code) {
|
|
64
|
+
var message = codes[code]
|
|
65
|
+
var status = Number(code)
|
|
66
|
+
|
|
67
|
+
// Populate properties
|
|
68
|
+
statuses[status] = message
|
|
69
|
+
statuses[message] = status
|
|
70
|
+
statuses[message.toLowerCase()] = status
|
|
71
|
+
|
|
72
|
+
// Add to array
|
|
73
|
+
arr.push(status)
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
return arr
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get the status code.
|
|
81
|
+
*
|
|
82
|
+
* Given a number, this will throw if it is not a known status
|
|
83
|
+
* code, otherwise the code will be returned. Given a string,
|
|
84
|
+
* the string will be parsed for a number and return the code
|
|
85
|
+
* if valid, otherwise will lookup the code assuming this is
|
|
86
|
+
* the status message.
|
|
87
|
+
*
|
|
88
|
+
* @param {string|number} code
|
|
89
|
+
* @returns {number}
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
function status (code) {
|
|
94
|
+
if (typeof code === 'number') {
|
|
95
|
+
if (!status[code]) throw new Error('invalid status code: ' + code)
|
|
96
|
+
return code
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (typeof code !== 'string') {
|
|
100
|
+
throw new TypeError('code must be a number or string')
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// '403'
|
|
104
|
+
var n = parseInt(code, 10)
|
|
105
|
+
if (!isNaN(n)) {
|
|
106
|
+
if (!status[n]) throw new Error('invalid status code: ' + n)
|
|
107
|
+
return n
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
n = status[code.toLowerCase()]
|
|
111
|
+
if (!n) throw new Error('invalid status message: "' + code + '"')
|
|
112
|
+
return n
|
|
113
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "statuses",
|
|
3
|
+
"description": "HTTP status utility",
|
|
4
|
+
"version": "1.5.0",
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
|
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
|
+
],
|
|
9
|
+
"repository": "jshttp/statuses",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"http",
|
|
13
|
+
"status",
|
|
14
|
+
"code"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"HISTORY.md",
|
|
18
|
+
"index.js",
|
|
19
|
+
"codes.json",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"csv-parse": "1.2.4",
|
|
24
|
+
"eslint": "4.19.1",
|
|
25
|
+
"eslint-config-standard": "11.0.0",
|
|
26
|
+
"eslint-plugin-import": "2.9.0",
|
|
27
|
+
"eslint-plugin-markdown": "1.0.0-beta.6",
|
|
28
|
+
"eslint-plugin-node": "6.0.1",
|
|
29
|
+
"eslint-plugin-promise": "3.7.0",
|
|
30
|
+
"eslint-plugin-standard": "3.0.1",
|
|
31
|
+
"istanbul": "0.4.5",
|
|
32
|
+
"mocha": "1.21.5",
|
|
33
|
+
"raw-body": "2.3.2",
|
|
34
|
+
"stream-to-array": "2.3.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">= 0.6"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "node scripts/build.js",
|
|
41
|
+
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
|
42
|
+
"lint": "eslint --plugin markdown --ext js,md .",
|
|
43
|
+
"test": "mocha --reporter spec --check-leaks --bail test/",
|
|
44
|
+
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
|
45
|
+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
|
46
|
+
"update": "npm run fetch && npm run build"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { Cache } from '@nocobase/cache';
|
|
10
|
+
type StoredPayload = Record<string, any> & {
|
|
11
|
+
__expiresAt?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function createCacheAdapter(cache: Cache, namespace: string): {
|
|
14
|
+
new (model: string): {
|
|
15
|
+
model: string;
|
|
16
|
+
key(id: string): string;
|
|
17
|
+
read(id: string): Promise<StoredPayload>;
|
|
18
|
+
destroy(id: string): Promise<void>;
|
|
19
|
+
consume(id: string): Promise<void>;
|
|
20
|
+
find(id: string): Promise<{
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
}>;
|
|
23
|
+
findByUid(uid: string): Promise<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>;
|
|
26
|
+
findByUserCode(userCode: string): Promise<{
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
}>;
|
|
29
|
+
upsert(id: string, payload: Record<string, any>, expiresIn: number): Promise<void>;
|
|
30
|
+
revokeByGrantId(grantId: string): Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var cache_adapter_exports = {};
|
|
28
|
+
__export(cache_adapter_exports, {
|
|
29
|
+
createCacheAdapter: () => createCacheAdapter
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(cache_adapter_exports);
|
|
32
|
+
const grantable = /* @__PURE__ */ new Set([
|
|
33
|
+
"AccessToken",
|
|
34
|
+
"AuthorizationCode",
|
|
35
|
+
"RefreshToken",
|
|
36
|
+
"DeviceCode",
|
|
37
|
+
"BackchannelAuthenticationRequest"
|
|
38
|
+
]);
|
|
39
|
+
function epochTime(date = Date.now()) {
|
|
40
|
+
return Math.floor(date / 1e3);
|
|
41
|
+
}
|
|
42
|
+
function createCacheAdapter(cache, namespace) {
|
|
43
|
+
const keyFor = (model, id) => `${namespace}:${model}:${id}`;
|
|
44
|
+
const grantKeyFor = (grantId) => `${namespace}:grant:${grantId}`;
|
|
45
|
+
const sessionUidKeyFor = (uid) => `${namespace}:sessionUid:${uid}`;
|
|
46
|
+
const userCodeKeyFor = (userCode) => `${namespace}:userCode:${userCode}`;
|
|
47
|
+
const normalize = (payload) => {
|
|
48
|
+
if (!payload) {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
if (payload.__expiresAt && payload.__expiresAt <= Date.now()) {
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
const { __expiresAt, ...data } = payload;
|
|
55
|
+
return data;
|
|
56
|
+
};
|
|
57
|
+
const getRemainingTtl = (payload) => {
|
|
58
|
+
if (!(payload == null ? void 0 : payload.__expiresAt)) {
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
const ttl = payload.__expiresAt - Date.now();
|
|
62
|
+
return ttl > 0 ? ttl : void 0;
|
|
63
|
+
};
|
|
64
|
+
return class CacheAdapter {
|
|
65
|
+
model;
|
|
66
|
+
constructor(model) {
|
|
67
|
+
this.model = model;
|
|
68
|
+
}
|
|
69
|
+
key(id) {
|
|
70
|
+
return keyFor(this.model, id);
|
|
71
|
+
}
|
|
72
|
+
async read(id) {
|
|
73
|
+
const payload = await cache.get(this.key(id));
|
|
74
|
+
if (!payload) {
|
|
75
|
+
return void 0;
|
|
76
|
+
}
|
|
77
|
+
if (payload.__expiresAt && payload.__expiresAt <= Date.now()) {
|
|
78
|
+
await this.destroy(id);
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
return payload;
|
|
82
|
+
}
|
|
83
|
+
async destroy(id) {
|
|
84
|
+
const payload = await cache.get(this.key(id));
|
|
85
|
+
await cache.del(this.key(id));
|
|
86
|
+
if ((payload == null ? void 0 : payload.uid) && this.model === "Session") {
|
|
87
|
+
await cache.del(sessionUidKeyFor(payload.uid));
|
|
88
|
+
}
|
|
89
|
+
if (payload == null ? void 0 : payload.userCode) {
|
|
90
|
+
await cache.del(userCodeKeyFor(payload.userCode));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async consume(id) {
|
|
94
|
+
const payload = await this.read(id);
|
|
95
|
+
if (!payload) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
payload.consumed = epochTime();
|
|
99
|
+
await cache.set(this.key(id), payload, getRemainingTtl(payload));
|
|
100
|
+
}
|
|
101
|
+
async find(id) {
|
|
102
|
+
return normalize(await this.read(id));
|
|
103
|
+
}
|
|
104
|
+
async findByUid(uid) {
|
|
105
|
+
const id = await cache.get(sessionUidKeyFor(uid));
|
|
106
|
+
if (!id) {
|
|
107
|
+
return void 0;
|
|
108
|
+
}
|
|
109
|
+
return this.find(id);
|
|
110
|
+
}
|
|
111
|
+
async findByUserCode(userCode) {
|
|
112
|
+
const id = await cache.get(userCodeKeyFor(userCode));
|
|
113
|
+
if (!id) {
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
return this.find(id);
|
|
117
|
+
}
|
|
118
|
+
async upsert(id, payload, expiresIn) {
|
|
119
|
+
const ttl = expiresIn * 1e3;
|
|
120
|
+
const stored = {
|
|
121
|
+
...payload,
|
|
122
|
+
__expiresAt: Date.now() + ttl
|
|
123
|
+
};
|
|
124
|
+
if (this.model === "Session" && payload.uid) {
|
|
125
|
+
await cache.set(sessionUidKeyFor(payload.uid), id, ttl);
|
|
126
|
+
}
|
|
127
|
+
if (grantable.has(this.model) && payload.grantId) {
|
|
128
|
+
const grantKey = grantKeyFor(payload.grantId);
|
|
129
|
+
const grant = (await cache.get(grantKey) || []).filter(Boolean);
|
|
130
|
+
if (!grant.includes(this.key(id))) {
|
|
131
|
+
grant.push(this.key(id));
|
|
132
|
+
}
|
|
133
|
+
await cache.set(grantKey, grant, ttl);
|
|
134
|
+
}
|
|
135
|
+
if (payload.userCode) {
|
|
136
|
+
await cache.set(userCodeKeyFor(payload.userCode), id, ttl);
|
|
137
|
+
}
|
|
138
|
+
await cache.set(this.key(id), stored, ttl);
|
|
139
|
+
}
|
|
140
|
+
async revokeByGrantId(grantId) {
|
|
141
|
+
const grantKey = grantKeyFor(grantId);
|
|
142
|
+
const grant = await cache.get(grantKey);
|
|
143
|
+
if (!(grant == null ? void 0 : grant.length)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
await Promise.all(
|
|
147
|
+
grant.map((tokenKey) => {
|
|
148
|
+
const id = tokenKey.slice(this.key("").length);
|
|
149
|
+
return this.destroy(id);
|
|
150
|
+
})
|
|
151
|
+
);
|
|
152
|
+
await cache.del(grantKey);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
+
0 && (module.exports = {
|
|
158
|
+
createCacheAdapter
|
|
159
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './plugin';
|
|
10
|
+
export * from './service';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var server_exports = {};
|
|
39
|
+
__export(server_exports, {
|
|
40
|
+
default: () => import_plugin.default
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(server_exports);
|
|
43
|
+
var import_plugin = __toESM(require("./plugin"));
|
|
44
|
+
__reExport(server_exports, require("./service"), module.exports);
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
...require("./service")
|
|
48
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { IdpOauthService } from './service';
|
|
10
|
+
type Provider = import('oidc-provider').Provider;
|
|
11
|
+
type InteractionUser = {
|
|
12
|
+
id: string | number;
|
|
13
|
+
};
|
|
14
|
+
type InteractionContext = {
|
|
15
|
+
req: any;
|
|
16
|
+
res: any;
|
|
17
|
+
throw: (...args: any[]) => never;
|
|
18
|
+
request: {
|
|
19
|
+
body?: Record<string, any>;
|
|
20
|
+
};
|
|
21
|
+
body?: unknown;
|
|
22
|
+
withoutDataWrapping?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function handleInteractionGet(ctx: InteractionContext, provider: Provider, user: InteractionUser | undefined, service: IdpOauthService): Promise<void>;
|
|
25
|
+
export declare function handleInteractionPost(ctx: InteractionContext, provider: Provider, user: InteractionUser | undefined, service: IdpOauthService): Promise<void>;
|
|
26
|
+
export {};
|