{"version":3,"file":"index.cjs","sources":["../src/constants.ts","../src/module.ts","../src/built-in/http.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum ErrorCode {\n    // HTTP Codes\n    HTTP_HEADER_AUTH_TYPE_UNSUPPORTED = 'unsupported_auth_header_type',\n\n    // Entity Codes\n    ENTITY_CREDENTIALS_INVALID = 'invalid_credentials',\n    ENTITY_INACTIVE = 'entity_inactive',\n    ENTITY_NOT_FOUND = 'entity_not_found',\n\n    // JWK Codes\n    JWK_INVALID = 'jwk_invalid',\n    JWK_NOT_FOUND = 'jwk_not_found',\n\n    // JWT Codes\n    JWT_INVALID = 'invalid_token',\n    JWT_INACTIVE = 'inactive_token',\n    JWT_EXPIRED = 'expired_token',\n\n    // Oauth2 Codes\n    OAUTH_REDIRECT_URI_MISMATCH = 'redirect_uri_mismatch',\n    OAUTH_CLIENT_INVALID = 'invalid_client',\n    OAUTH_GRANT_INVALID = 'invalid_grant',\n    OAUTH_GRANT_TYPE_UNSUPPORTED = 'unsupported_token_grant_type',\n    OAUTH_SCOPE_INVALID = 'invalid_scope',\n    OAUTH_SCOPE_INSUFFICIENT = 'insufficient_scope',\n\n    // Permission Codes\n    PERMISSION_NOT_FOUND = 'permission_not_found',\n    PERMISSION_DENIED = 'permission_denied',\n    PERMISSION_EVALUATION_FAILED = 'permission_evaluation_failed',\n\n    // Policy Codes\n    POLICY_EVALUATOR_NOT_FOUND = 'policy_evaluator_not_found',\n    POLICY_EVALUATOR_NOT_PROCESSABLE = 'policy_evaluator_not_processable',\n    POLICY_EVALUATOR_CONTEXT_INVALID = 'policy_evaluator_context_invalid',\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { BadRequestError } from '@ebec/http';\n\nexport class AuthupError extends BadRequestError {\n\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { AuthorizationHeaderType } from 'hapic';\nimport { ErrorCode } from '../constants';\nimport { AuthupError } from '../module';\n\nexport class HTTPError extends AuthupError {\n    static unsupportedHeaderType(type: `${AuthorizationHeaderType}`) {\n        return new HTTPError({\n            code: ErrorCode.HTTP_HEADER_AUTH_TYPE_UNSUPPORTED,\n            message: `The authorization header type ${type} is not supported.`,\n        });\n    }\n}\n"],"names":["ErrorCode","AuthupError","BadRequestError","HTTPError","unsupportedHeaderType","type","code","HTTP_HEADER_AUTH_TYPE_UNSUPPORTED","message"],"mappings":";;;;AAAA;;;;;IAOO,IAAKA,SAAAA,iBAAAA,SAAAA,SAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,SAAAA;AAmCX,CAAA,CAAA,EAAA;;ACjCM,MAAMC,WAAAA,SAAoBC,oBAAAA,CAAAA;AAEjC;;ACAO,MAAMC,SAAAA,SAAkBF,WAAAA,CAAAA;IAC3B,OAAOG,qBAAAA,CAAsBC,IAAkC,EAAE;AAC7D,QAAA,OAAO,IAAIF,SAAAA,CAAU;AACjBG,YAAAA,IAAAA,EAAMN,UAAUO,iCAAiC;AACjDC,YAAAA,OAAAA,EAAS,CAAC,8BAA8B,EAAEH,IAAAA,CAAK,kBAAkB;AACrE,SAAA,CAAA;AACJ,IAAA;AACJ;;;;;;"}