@loopstack/auth 0.10.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@loopstack/auth",
3
3
  "displayName": "Loopstack Auth Module",
4
4
  "description": "The auth module of the loopstack automation framework",
5
- "version": "0.10.2",
5
+ "version": "0.11.0",
6
6
  "author": {
7
7
  "name": "Jakob Klippel",
8
8
  "url": "https://www.linkedin.com/in/jakob-klippel/"
@@ -11,8 +11,8 @@
11
11
  "main": "dist/index.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "dependencies": {
14
- "@loopstack/core": "^0.10.2",
15
- "@loopstack/shared": "^0.10.1",
14
+ "@loopstack/core": "^0.11.0",
15
+ "@loopstack/shared": "^0.11.0",
16
16
  "@nestjs/common": "^11.0.1",
17
17
  "@nestjs/config": "^4.0.0",
18
18
  "@nestjs/core": "^11.0.1",
@@ -1,11 +0,0 @@
1
- import { CanActivate, ExecutionContext } from '@nestjs/common';
2
- import { ConfigService } from '@nestjs/config';
3
- import { JwtAuthGuard } from './jwt-auth.guard';
4
- import { LocalDevModeGuard } from './local-dev-mode.guard';
5
- export declare class ConditionalAuthGuard implements CanActivate {
6
- private readonly configService;
7
- private readonly jwtAuthGuard;
8
- private readonly localDevModeGuard;
9
- constructor(configService: ConfigService, jwtAuthGuard: JwtAuthGuard, localDevModeGuard: LocalDevModeGuard);
10
- canActivate(context: ExecutionContext): Promise<boolean>;
11
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ConditionalAuthGuard = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const config_1 = require("@nestjs/config");
15
- const jwt_auth_guard_1 = require("./jwt-auth.guard");
16
- const local_dev_mode_guard_1 = require("./local-dev-mode.guard");
17
- let ConditionalAuthGuard = class ConditionalAuthGuard {
18
- configService;
19
- jwtAuthGuard;
20
- localDevModeGuard;
21
- constructor(configService, jwtAuthGuard, localDevModeGuard) {
22
- this.configService = configService;
23
- this.jwtAuthGuard = jwtAuthGuard;
24
- this.localDevModeGuard = localDevModeGuard;
25
- }
26
- async canActivate(context) {
27
- const isLocalDevMode = this.configService.get('app.isLocalMode');
28
- if (isLocalDevMode) {
29
- return this.localDevModeGuard.canActivate(context);
30
- }
31
- return this.jwtAuthGuard.canActivate(context);
32
- }
33
- };
34
- exports.ConditionalAuthGuard = ConditionalAuthGuard;
35
- exports.ConditionalAuthGuard = ConditionalAuthGuard = __decorate([
36
- (0, common_1.Injectable)(),
37
- __metadata("design:paramtypes", [config_1.ConfigService,
38
- jwt_auth_guard_1.JwtAuthGuard,
39
- local_dev_mode_guard_1.LocalDevModeGuard])
40
- ], ConditionalAuthGuard);
41
- //# sourceMappingURL=onditional-auth.guard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onditional-auth.guard.js","sourceRoot":"","sources":["../../src/guards/onditional-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA+C;AAC/C,qDAAgD;AAChD,iEAA2D;AAGpD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEZ;IACA;IACA;IAHnB,YACmB,aAA4B,EAC5B,YAA0B,EAC1B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAC5B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAU,iBAAiB,CAAC,CAAC;QAE1E,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAqB,CAAC;IACpE,CAAC;CACF,CAAA;AAhBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAGuB,sBAAa;QACd,6BAAY;QACP,wCAAiB;GAJ5C,oBAAoB,CAgBhC"}
@@ -1,7 +0,0 @@
1
- import { CanActivate, ExecutionContext } from '@nestjs/common';
2
- import { ConfigService } from '@nestjs/config';
3
- export declare class WorkerAuthGuard implements CanActivate {
4
- private readonly configService;
5
- constructor(configService: ConfigService);
6
- canActivate(context: ExecutionContext): boolean;
7
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.WorkerAuthGuard = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const config_1 = require("@nestjs/config");
15
- let WorkerAuthGuard = class WorkerAuthGuard {
16
- configService;
17
- constructor(configService) {
18
- this.configService = configService;
19
- }
20
- canActivate(context) {
21
- const { user } = context.switchToHttp().getRequest();
22
- const clientId = this.configService.get('auth.clientId');
23
- return clientId === user.workerId;
24
- }
25
- };
26
- exports.WorkerAuthGuard = WorkerAuthGuard;
27
- exports.WorkerAuthGuard = WorkerAuthGuard = __decorate([
28
- (0, common_1.Injectable)(),
29
- __metadata("design:paramtypes", [config_1.ConfigService])
30
- ], WorkerAuthGuard);
31
- //# sourceMappingURL=worker-auth.guard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-auth.guard.js","sourceRoot":"","sources":["../../src/guards/worker-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA+C;AAaxC,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D,WAAW,CAAC,OAAyB;QACnC,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACrF,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,eAAe,CAAC,CAAC;QACjE,OAAO,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC;IACpC,CAAC;CACF,CAAA;AARY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAEiC,sBAAa;GAD9C,eAAe,CAQ3B"}