@rxap/nest-auth0 11.0.0-dev.2 → 11.0.0-dev.4
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/CHANGELOG.md +12 -0
- package/package.json +3 -3
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/lib/auth0-bypass.d.ts +2 -0
- package/src/lib/auth0-bypass.js +7 -0
- package/src/lib/auth0.guard.js +8 -0
- package/src/lib/auth0.module.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [11.0.0-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/nest-auth0@11.0.0-dev.3...@rxap/nest-auth0@11.0.0-dev.4) (2025-08-27)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **auth0:** add bypass functionality to Auth0 guard ([6187a89](https://gitlab.com/rxap/packages/commit/6187a89800991dfdca7c6a625f61b07fe4275508))
|
|
11
|
+
|
|
12
|
+
# [11.0.0-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/nest-auth0@11.0.0-dev.2...@rxap/nest-auth0@11.0.0-dev.3) (2025-07-23)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **auth0:** reduce jwksRequestsPerMinute to 1 ([cc53342](https://gitlab.com/rxap/packages/commit/cc533428763bc66ca770568694a1534a8598fbb1))
|
|
17
|
+
|
|
6
18
|
# [11.0.0-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/nest-auth0@11.0.0-dev.1...@rxap/nest-auth0@11.0.0-dev.2) (2025-05-19)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "11.0.0-dev.
|
|
2
|
+
"version": "11.0.0-dev.4",
|
|
3
3
|
"name": "@rxap/nest-auth0",
|
|
4
4
|
"description": "This package provides an Auth0 module for NestJS applications, simplifying integration with Auth0 for authentication and authorization. It includes a configurable module, JWT strategy, and service for interacting with the Auth0 Authentication API. The module also offers validation schemas for environment variables related to Auth0 configuration.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@nestjs/config": "^4.0.2",
|
|
13
13
|
"@nestjs/core": "^11.1.1",
|
|
14
14
|
"@nestjs/jwt": "^11.0.0",
|
|
15
|
-
"@rxap/nest-utilities": "^11.0.0-dev.
|
|
15
|
+
"@rxap/nest-utilities": "^11.0.0-dev.5",
|
|
16
16
|
"auth0": "^4.18.0",
|
|
17
17
|
"joi": "^17.9.2",
|
|
18
18
|
"jsonwebtoken": "*",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"schematics": "./generators.json",
|
|
49
49
|
"type": "commonjs",
|
|
50
50
|
"types": "./src/index.d.ts",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "cbae1545fd039123b9ba59679d04960483eb8ead"
|
|
52
52
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
// region
|
|
5
5
|
tslib_1.__exportStar(require("./lib/auth0-authentication.service"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/auth0-bypass"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./lib/auth0-management.service"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./lib/auth0-module-options.factory"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./lib/auth0-options"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Auth0Bypass = exports.AUTH0_BYPASS_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.AUTH0_BYPASS_KEY = 'auth0-bypass';
|
|
6
|
+
const Auth0Bypass = () => (0, common_1.SetMetadata)(exports.AUTH0_BYPASS_KEY, true);
|
|
7
|
+
exports.Auth0Bypass = Auth0Bypass;
|
package/src/lib/auth0.guard.js
CHANGED
|
@@ -7,6 +7,7 @@ const core_1 = require("@nestjs/core");
|
|
|
7
7
|
const jwt_1 = require("@nestjs/jwt");
|
|
8
8
|
const nest_utilities_1 = require("@rxap/nest-utilities");
|
|
9
9
|
const passport_jwt_1 = require("passport-jwt");
|
|
10
|
+
const auth0_bypass_1 = require("./auth0-bypass");
|
|
10
11
|
const tokens_1 = require("./tokens");
|
|
11
12
|
let Auth0Guard = class Auth0Guard {
|
|
12
13
|
async canActivate(context) {
|
|
@@ -17,6 +18,13 @@ let Auth0Guard = class Auth0Guard {
|
|
|
17
18
|
if (isPublic) {
|
|
18
19
|
return true;
|
|
19
20
|
}
|
|
21
|
+
const auth0Bypass = this.reflector.getAllAndOverride(auth0_bypass_1.AUTH0_BYPASS_KEY, [
|
|
22
|
+
context.getHandler(),
|
|
23
|
+
context.getClass(),
|
|
24
|
+
]);
|
|
25
|
+
if (auth0Bypass) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
20
28
|
const request = context.switchToHttp().getRequest();
|
|
21
29
|
if (this.options.disabled) {
|
|
22
30
|
this.logger.warn('Auth0 is disabled', 'Auth0Guard');
|
package/src/lib/auth0.module.js
CHANGED
|
@@ -168,7 +168,7 @@ exports.Auth0Module = Auth0Module = tslib_1.__decorate([
|
|
|
168
168
|
(0, jwks_rsa_1.passportJwtSecret)({
|
|
169
169
|
cache: true,
|
|
170
170
|
rateLimit: true,
|
|
171
|
-
jwksRequestsPerMinute:
|
|
171
|
+
jwksRequestsPerMinute: 1,
|
|
172
172
|
jwksUri: `${config.get('AUTH0_ISSUER_URL')}.well-known/jwks.json`,
|
|
173
173
|
})(null, tokenOrPayload, (err, secret) => {
|
|
174
174
|
if (err) {
|