@bearei/server-common 0.0.9 → 0.0.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.
Files changed (64) hide show
  1. package/dist/{authentication/access → access}/access.guard.d.ts +3 -3
  2. package/dist/{authentication/access → access}/access.guard.js +9 -9
  3. package/dist/access/access.guard.js.map +1 -0
  4. package/dist/{authentication/access-interceptor/access-interceptor.js → access/access.interceptor.js} +1 -1
  5. package/dist/access/access.interceptor.js.map +1 -0
  6. package/dist/access/access.interface.js.map +1 -0
  7. package/dist/{authentication/access → access}/index.d.ts +1 -0
  8. package/dist/{authentication/access → access}/index.js +1 -0
  9. package/dist/access/index.js.map +1 -0
  10. package/dist/app.decorator.d.ts +4 -3
  11. package/dist/app.decorator.js +4 -4
  12. package/dist/app.decorator.js.map +1 -1
  13. package/dist/authentication/authentication.interface.d.ts +2 -0
  14. package/dist/authentication/{auth/auth.interface.js → authentication.interface.js} +1 -1
  15. package/dist/authentication/authentication.interface.js.map +1 -0
  16. package/dist/authentication/authentication.module.d.ts +2 -0
  17. package/dist/authentication/{auth/auth.module.js → authentication.module.js} +10 -10
  18. package/dist/authentication/authentication.module.js.map +1 -0
  19. package/dist/authentication/authentication.service.d.ts +9 -0
  20. package/dist/authentication/{auth/auth.service.js → authentication.service.js} +11 -11
  21. package/dist/authentication/authentication.service.js.map +1 -0
  22. package/dist/authentication/index.d.ts +3 -4
  23. package/dist/authentication/index.js +3 -4
  24. package/dist/authentication/index.js.map +1 -1
  25. package/dist/external/external.interface.d.ts +2 -2
  26. package/dist/external/external.service.d.ts +3 -3
  27. package/dist/external/external.service.js +2 -2
  28. package/dist/external/external.service.js.map +1 -1
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/permission/index.js.map +1 -0
  33. package/dist/{authentication/permission → permission}/permission.guard.d.ts +3 -3
  34. package/dist/{authentication/permission → permission}/permission.guard.js +8 -8
  35. package/dist/permission/permission.guard.js.map +1 -0
  36. package/dist/permission/permission.interface.js.map +1 -0
  37. package/dist/tsconfig.build.tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/dist/authentication/access/access.guard.js.map +0 -1
  40. package/dist/authentication/access/access.interface.js.map +0 -1
  41. package/dist/authentication/access/index.js.map +0 -1
  42. package/dist/authentication/access-interceptor/access-interceptor.js.map +0 -1
  43. package/dist/authentication/access-interceptor/index.d.ts +0 -1
  44. package/dist/authentication/access-interceptor/index.js +0 -18
  45. package/dist/authentication/access-interceptor/index.js.map +0 -1
  46. package/dist/authentication/auth/auth.interface.d.ts +0 -2
  47. package/dist/authentication/auth/auth.interface.js.map +0 -1
  48. package/dist/authentication/auth/auth.module.d.ts +0 -2
  49. package/dist/authentication/auth/auth.module.js.map +0 -1
  50. package/dist/authentication/auth/auth.service.d.ts +0 -9
  51. package/dist/authentication/auth/auth.service.js.map +0 -1
  52. package/dist/authentication/auth/index.d.ts +0 -3
  53. package/dist/authentication/auth/index.js +0 -20
  54. package/dist/authentication/auth/index.js.map +0 -1
  55. package/dist/authentication/permission/index.js.map +0 -1
  56. package/dist/authentication/permission/permission.guard.js.map +0 -1
  57. package/dist/authentication/permission/permission.interface.js.map +0 -1
  58. /package/dist/{authentication/access-interceptor/access-interceptor.d.ts → access/access.interceptor.d.ts} +0 -0
  59. /package/dist/{authentication/access → access}/access.interface.d.ts +0 -0
  60. /package/dist/{authentication/access → access}/access.interface.js +0 -0
  61. /package/dist/{authentication/permission → permission}/index.d.ts +0 -0
  62. /package/dist/{authentication/permission → permission}/index.js +0 -0
  63. /package/dist/{authentication/permission → permission}/permission.interface.d.ts +0 -0
  64. /package/dist/{authentication/permission → permission}/permission.interface.js +0 -0
@@ -1,9 +1,9 @@
1
1
  import { CanActivate, ExecutionContext } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
- import { AuthService } from '../auth';
3
+ import { AuthenticationService } from '../authentication';
4
4
  export declare class AccessGuard implements CanActivate {
5
- private readonly authService;
5
+ private readonly authenticationService;
6
6
  private readonly reflector;
7
- constructor(authService: AuthService, reflector: Reflector);
7
+ constructor(authenticationService: AuthenticationService, reflector: Reflector);
8
8
  canActivate(context: ExecutionContext): true | Promise<boolean>;
9
9
  }
@@ -12,16 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AccessGuard = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const core_1 = require("@nestjs/core");
15
- const app_decorator_1 = require("../../app.decorator");
16
- const app_interface_1 = require("../../app.interface");
17
- const util_1 = require("../../util");
18
- const auth_1 = require("../auth");
15
+ const app_decorator_1 = require("../app.decorator");
16
+ const app_interface_1 = require("../app.interface");
17
+ const authentication_1 = require("../authentication");
18
+ const util_1 = require("../util");
19
19
  const access_interface_1 = require("./access.interface");
20
20
  let AccessGuard = class AccessGuard {
21
- authService;
21
+ authenticationService;
22
22
  reflector;
23
- constructor(authService, reflector) {
24
- this.authService = authService;
23
+ constructor(authenticationService, reflector) {
24
+ this.authenticationService = authenticationService;
25
25
  this.reflector = reflector;
26
26
  }
27
27
  canActivate(context) {
@@ -42,7 +42,7 @@ let AccessGuard = class AccessGuard {
42
42
  code: 401004,
43
43
  message: 'No required authentication token found; a token is essential for access authentication'
44
44
  })(app_interface_1.APIError.UNAUTHORIZED);
45
- return this.authService.authAccess(headers).then(payload => {
45
+ return this.authenticationService.authenticationAccess(headers).then(payload => {
46
46
  payload.sub === 'guest' &&
47
47
  requiredAccesses &&
48
48
  !requiredAccesses.includes(access_interface_1.Access.GUEST) &&
@@ -58,7 +58,7 @@ let AccessGuard = class AccessGuard {
58
58
  exports.AccessGuard = AccessGuard;
59
59
  exports.AccessGuard = AccessGuard = __decorate([
60
60
  (0, common_1.Injectable)(),
61
- __metadata("design:paramtypes", [auth_1.AuthService,
61
+ __metadata("design:paramtypes", [authentication_1.AuthenticationService,
62
62
  core_1.Reflector])
63
63
  ], AccessGuard);
64
64
  //# sourceMappingURL=access.guard.js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,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAC3E,OAAO,CAAC,GAAG,KAAK,OAAO;gBACnB,gBAAgB;gBAChB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,yBAAM,CAAC,KAAK,CAAC;gBACxC,IAAA,oBAAa,EAAC;oBACV,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,uDAAuD;iBACnE,CAAC,CAAC,wBAAQ,CAAC,YAAY,CAAC,CAAA;YAE7B,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAA;YAEzB,OAAO,IAAI,CAAA;QACf,CAAC,CAAC,CAAA;IACN,CAAC;CACJ,CAAA;AA3CY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAGmC,sCAAqB;QACjC,gBAAS;GAHhC,WAAW,CA2CvB"}
@@ -21,4 +21,4 @@ exports.AccessInterceptor = AccessInterceptor;
21
21
  exports.AccessInterceptor = AccessInterceptor = __decorate([
22
22
  (0, common_1.Injectable)()
23
23
  ], AccessInterceptor);
24
- //# sourceMappingURL=access-interceptor.js.map
24
+ //# sourceMappingURL=access.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.interceptor.js","sourceRoot":"","sources":["../../src/access/access.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAyF;AAGlF,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC1B,SAAS,CAAC,OAAyB,EAAE,IAAiB;QAClD,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAA;QAEnD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAA;QACzD,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;IACxB,CAAC;CACJ,CAAA;AAVY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAU7B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.interface.js","sourceRoot":"","sources":["../../src/access/access.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAGX;AAHD,WAAY,MAAM;IACd,uBAAa,CAAA;IACb,yBAAe,CAAA;AACnB,CAAC,EAHW,MAAM,sBAAN,MAAM,QAGjB"}
@@ -1,2 +1,3 @@
1
1
  export * from './access.guard';
2
+ export * from './access.interceptor';
2
3
  export * from './access.interface';
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./access.guard"), exports);
18
+ __exportStar(require("./access.interceptor"), exports);
18
19
  __exportStar(require("./access.interface"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/access/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,uDAAoC;AACpC,qDAAkC"}
@@ -1,9 +1,10 @@
1
1
  import common from '@nestjs/common';
2
2
  import { ValidationOptions } from 'class-validator';
3
- import { Access, Permission } from './authentication';
4
- export declare const AUTHENTICATION_PERMISSIONS_KEY = "authenticationPermission";
3
+ import { Access } from './access';
4
+ import { Permission } from './permission';
5
+ export declare const AUTHENTICATION_PERMISSIONS_KEY = "AuthenticationPermission";
5
6
  export declare const IS_PUBLIC_KEY = "Public";
6
- export declare const AuthPermission: (permissions: Permission[]) => common.CustomDecorator<string>;
7
+ export declare const AuthenticationPermission: (permissions: Permission[]) => common.CustomDecorator<string>;
7
8
  export declare const Public: (accesses: Access[]) => common.CustomDecorator<string>;
8
9
  export declare const IsNanoid: (validationOptions?: ValidationOptions) => (object: Record<string, any>, propertyName: string) => void;
9
10
  export declare const IsPassword: (validationOptions?: ValidationOptions) => (object: Record<string, any>, propertyName: string) => void;
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.IsVersion = exports.IsPassword = exports.IsNanoid = exports.Public = exports.AuthPermission = exports.IS_PUBLIC_KEY = exports.AUTHENTICATION_PERMISSIONS_KEY = void 0;
6
+ exports.IsVersion = exports.IsPassword = exports.IsNanoid = exports.Public = exports.AuthenticationPermission = exports.IS_PUBLIC_KEY = exports.AUTHENTICATION_PERMISSIONS_KEY = void 0;
7
7
  const common_1 = __importDefault(require("@nestjs/common"));
8
8
  const class_validator_1 = require("class-validator");
9
- exports.AUTHENTICATION_PERMISSIONS_KEY = 'authenticationPermission';
9
+ exports.AUTHENTICATION_PERMISSIONS_KEY = 'AuthenticationPermission';
10
10
  exports.IS_PUBLIC_KEY = 'Public';
11
- const AuthPermission = (permissions) => common_1.default.SetMetadata(exports.AUTHENTICATION_PERMISSIONS_KEY, permissions);
12
- exports.AuthPermission = AuthPermission;
11
+ const AuthenticationPermission = (permissions) => common_1.default.SetMetadata(exports.AUTHENTICATION_PERMISSIONS_KEY, permissions);
12
+ exports.AuthenticationPermission = AuthenticationPermission;
13
13
  const Public = (accesses) => common_1.default.SetMetadata(exports.IS_PUBLIC_KEY, accesses);
14
14
  exports.Public = Public;
15
15
  const IsNanoid = (validationOptions) => (object, propertyName) => {
@@ -1 +1 @@
1
- {"version":3,"file":"app.decorator.js","sourceRoot":"","sources":["../src/app.decorator.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AACnC,qDAAoE;AAGvD,QAAA,8BAA8B,GAAG,0BAA0B,CAAA;AAC3D,QAAA,aAAa,GAAG,QAAQ,CAAA;AAE9B,MAAM,cAAc,GAAG,CAAC,WAAyB,EAAE,EAAE,CACxD,gBAAM,CAAC,WAAW,CAAC,sCAA8B,EAAE,WAAW,CAAC,CAAA;AADtD,QAAA,cAAc,k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AEtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAChE,CAAC;SACJ;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAlBQ,QAAA,SAAS,aAkBjB"}
@@ -0,0 +1,2 @@
1
+ import { AuthenticationExternalPermissionOptions } from '../external';
2
+ export type AuthenticationPermissionOptions = AuthenticationExternalPermissionOptions;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=auth.interface.js.map
3
+ //# sourceMappingURL=authentication.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.interface.js","sourceRoot":"","sources":["../../src/authentication/authentication.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare class AuthenticationModule {
2
+ }
@@ -6,18 +6,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AuthModule = void 0;
9
+ exports.AuthenticationModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
- const external_1 = require("../../external");
12
- const auth_service_1 = require("./auth.service");
13
- let AuthModule = class AuthModule {
11
+ const external_1 = require("../external");
12
+ const authentication_service_1 = require("./authentication.service");
13
+ let AuthenticationModule = class AuthenticationModule {
14
14
  };
15
- exports.AuthModule = AuthModule;
16
- exports.AuthModule = AuthModule = __decorate([
15
+ exports.AuthenticationModule = AuthenticationModule;
16
+ exports.AuthenticationModule = AuthenticationModule = __decorate([
17
17
  (0, common_1.Module)({
18
- exports: [auth_service_1.AuthService],
18
+ exports: [authentication_service_1.AuthenticationService],
19
19
  imports: [external_1.ExternalModule],
20
- providers: [auth_service_1.AuthService]
20
+ providers: [authentication_service_1.AuthenticationService]
21
21
  })
22
- ], AuthModule);
23
- //# sourceMappingURL=auth.module.js.map
22
+ ], AuthenticationModule);
23
+ //# sourceMappingURL=authentication.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.module.js","sourceRoot":"","sources":["../../src/authentication/authentication.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqC;AACrC,0CAA0C;AAC1C,qEAA8D;AAOvD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IALhC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,8CAAqB,CAAC;QAChC,OAAO,EAAE,CAAC,yBAAc,CAAC;QACzB,SAAS,EAAE,CAAC,8CAAqB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG"}
@@ -0,0 +1,9 @@
1
+ import { APIHeaders } from '../app.interface';
2
+ import { ExternalService } from '../external';
3
+ import { AuthenticationPermissionOptions } from './authentication.interface';
4
+ export declare class AuthenticationService {
5
+ private readonly externalService;
6
+ constructor(externalService: ExternalService);
7
+ authenticationAccess(headers: APIHeaders): Promise<import("../external").AuthenticatedToken>;
8
+ authenticationPermission(headers: APIHeaders): (options: AuthenticationPermissionOptions) => Promise<import("../external").AuthenticatedPermission>;
9
+ }
@@ -9,24 +9,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AuthService = void 0;
12
+ exports.AuthenticationService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
- const external_1 = require("../../external");
15
- let AuthService = class AuthService {
14
+ const external_1 = require("../external");
15
+ let AuthenticationService = class AuthenticationService {
16
16
  externalService;
17
17
  constructor(externalService) {
18
18
  this.externalService = externalService;
19
19
  }
20
- async authAccess(headers) {
21
- return this.externalService.authUserAccess(headers);
20
+ async authenticationAccess(headers) {
21
+ return this.externalService.authenticationUserAccess(headers);
22
22
  }
23
- authPermission(headers) {
24
- return async (options) => this.externalService.authUserPermission(headers)(options);
23
+ authenticationPermission(headers) {
24
+ return async (options) => this.externalService.authenticationUserPermission(headers)(options);
25
25
  }
26
26
  };
27
- exports.AuthService = AuthService;
28
- exports.AuthService = AuthService = __decorate([
27
+ exports.AuthenticationService = AuthenticationService;
28
+ exports.AuthenticationService = AuthenticationService = __decorate([
29
29
  (0, common_1.Injectable)(),
30
30
  __metadata("design:paramtypes", [external_1.ExternalService])
31
- ], AuthService);
32
- //# sourceMappingURL=auth.service.js.map
31
+ ], AuthenticationService);
32
+ //# sourceMappingURL=authentication.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.service.js","sourceRoot":"","sources":["../../src/authentication/authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyC;AAEzC,0CAA2C;AAIpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACD;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAEjE,KAAK,CAAC,oBAAoB,CAAC,OAAmB;QAC1C,OAAO,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAA;IACjE,CAAC;IAED,wBAAwB,CAAC,OAAmB;QACxC,OAAO,KAAK,EAAE,OAAwC,EAAE,EAAE,CACtD,IAAI,CAAC,eAAe,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;IAC3E,CAAC;CACJ,CAAA;AAXY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAEqC,0BAAe;GADpD,qBAAqB,CAWjC"}
@@ -1,4 +1,3 @@
1
- export * from './access';
2
- export * from './access-interceptor';
3
- export * from './auth';
4
- export * from './permission';
1
+ export * from './authentication.interface';
2
+ export * from './authentication.module';
3
+ export * from './authentication.service';
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./access"), exports);
18
- __exportStar(require("./access-interceptor"), exports);
19
- __exportStar(require("./auth"), exports);
20
- __exportStar(require("./permission"), exports);
17
+ __exportStar(require("./authentication.interface"), exports);
18
+ __exportStar(require("./authentication.module"), exports);
19
+ __exportStar(require("./authentication.service"), exports);
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,uDAAoC;AACpC,yCAAsB;AACtB,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA0C;AAC1C,0DAAuC;AACvC,2DAAwC"}
@@ -1,6 +1,6 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { Action, ActionResult, APIHeaders } from '../app.interface';
3
- import { Permission } from '../authentication';
3
+ import { Permission } from '../permission';
4
4
  export interface RequestOptions extends Omit<AxiosRequestConfig, 'headers'> {
5
5
  headers: APIHeaders;
6
6
  path?: string;
@@ -16,7 +16,7 @@ export interface CreateExternalActionLogOptions {
16
16
  result: ActionResult;
17
17
  serviceName: string;
18
18
  }
19
- export interface AuthExternalPermissionOptions {
19
+ export interface AuthenticationExternalPermissionOptions {
20
20
  keys: Permission[];
21
21
  userId: string;
22
22
  }
@@ -1,13 +1,13 @@
1
1
  import { HttpService } from '@nestjs/axios';
2
2
  import { ConfigService } from '@nestjs/config';
3
3
  import { APIHeaders } from '../app.interface';
4
- import { AuthenticatedPermission, AuthenticatedToken, AuthExternalPermissionOptions, CreateExternalActionLogOptions, RequestOptions } from './external.interface';
4
+ import { AuthenticatedPermission, AuthenticatedToken, AuthenticationExternalPermissionOptions, CreateExternalActionLogOptions, RequestOptions } from './external.interface';
5
5
  export declare class ExternalService {
6
6
  private readonly configService;
7
7
  private readonly httpService;
8
8
  constructor(configService: ConfigService, httpService: HttpService);
9
- authUserAccess(headers: APIHeaders): Promise<AuthenticatedToken>;
10
- authUserPermission(headers: APIHeaders): (options: AuthExternalPermissionOptions) => Promise<AuthenticatedPermission>;
9
+ authenticationUserAccess(headers: APIHeaders): Promise<AuthenticatedToken>;
10
+ authenticationUserPermission(headers: APIHeaders): (options: AuthenticationExternalPermissionOptions) => Promise<AuthenticatedPermission>;
11
11
  createActionLog(headers: APIHeaders): (options: CreateExternalActionLogOptions) => Promise<void>;
12
12
  request({ method, path, ...options }: RequestOptions): Promise<any>;
13
13
  }
@@ -23,10 +23,10 @@ let ExternalService = class ExternalService {
23
23
  this.configService = configService;
24
24
  this.httpService = httpService;
25
25
  }
26
- async authUserAccess(headers) {
26
+ async authenticationUserAccess(headers) {
27
27
  return this.request({ method: 'GET', path: '/users/authentication-access', headers });
28
28
  }
29
- authUserPermission(headers) {
29
+ authenticationUserPermission(headers) {
30
30
  return async (options) => {
31
31
  const { keys, ...args } = options;
32
32
  return this.request({
@@ -1 +1 @@
1
- {"version":3,"file":"external.service.js","sourceRoot":"","sources":["../../src/external/external.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAyC;AACzC,2CAAyC;AACzC,2CAA4C;AAC5C,+BAA+C;AAC/C,oDAAqD;AACrD,kCAAqC;AAU9B,IAAM,eAAe,GAArB,MAAM,eAAe;IAEH;IACA;IAFrB,YACqB,aAA4B,EAC5B,WAAwB;QADxB,kBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAEJ,KAAK,CAAC,cAAc,CAAC,OAAmB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,8BAA8B,EAAE,OAAO,EAAC,CAAC,CAAA;IACvF,CAAC;IAED,kBAAkB,CA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Ac,EACjB,IAAI,CAAC,WAAW;aACX,OAAO,CAAC;YACL,GAAG,OAAO;YACV,OAAO,EAAE,OAAO;YAChB,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,oBAAoB,CAAC;YACrD,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAAE;SAC5D,CAAC;aACD,IAAI,CACD,IAAA,iBAAU,EAAC,KAAK,CAAC,EAAE;YACf,KAAK,CAAC,MAAM,IAAI,IAAA,oBAAa,EAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAC,CAAC,CAAC,wBAAQ,CAAC,cAAc,CAAC,CAAA;YAE/F,MAAM,KAAK,CAAA;QACf,CAAC,CAAC,CACL,CACR,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC;CACJ,CAAA;AAlEY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAG2B,sBAAa;QACf,mBAAW;GAHpC,eAAe,CAkE3B"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './access';
1
2
  export * from './action-log';
2
3
  export * from './app.decorator';
3
4
  export * from './app.dto';
@@ -8,5 +9,6 @@ export * from './base';
8
9
  export * from './common';
9
10
  export * from './database';
10
11
  export * from './external';
12
+ export * from './permission';
11
13
  export * from './redis';
12
14
  export * from './util';
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./access"), exports);
17
18
  __exportStar(require("./action-log"), exports);
18
19
  __exportStar(require("./app.decorator"), exports);
19
20
  __exportStar(require("./app.dto"), exports);
@@ -24,6 +25,7 @@ __exportStar(require("./base"), exports);
24
25
  __exportStar(require("./common"), exports);
25
26
  __exportStar(require("./database"), exports);
26
27
  __exportStar(require("./external"), exports);
28
+ __exportStar(require("./permission"), exports);
27
29
  __exportStar(require("./redis"), exports);
28
30
  __exportStar(require("./util"), exports);
29
31
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,kDAA+B;AAC/B,4CAAyB;AACzB,+CAA4B;AAC5B,kDAA+B;AAC/B,mDAAgC;AAChC,yCAAsB;AACtB,2CAAwB;AACxB,6CAA0B;AAC1B,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,+CAA4B;AAC5B,kDAA+B;AAC/B,4CAAyB;AACzB,+CAA4B;AAC5B,kDAA+B;AAC/B,mDAAgC;AAChC,yCAAsB;AACtB,2CAAwB;AACxB,6CAA0B;AAC1B,6CAA0B;AAC1B,+CAA4B;AAC5B,0CAAuB;AACvB,yCAAsB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,yDAAsC"}
@@ -1,9 +1,9 @@
1
1
  import { CanActivate, ExecutionContext } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
- import { AuthService } from '../auth';
3
+ import { AuthenticationService } from '../authentication';
4
4
  export declare class PermissionGuard implements CanActivate {
5
- private readonly authService;
5
+ private readonly authenticationService;
6
6
  private readonly reflector;
7
- constructor(authService: AuthService, reflector: Reflector);
7
+ constructor(authenticationService: AuthenticationService, reflector: Reflector);
8
8
  canActivate(context: ExecutionContext): true | Promise<boolean>;
9
9
  }
@@ -12,13 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PermissionGuard = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const core_1 = require("@nestjs/core");
15
- const app_decorator_1 = require("../../app.decorator");
16
- const auth_1 = require("../auth");
15
+ const app_decorator_1 = require("../app.decorator");
16
+ const authentication_1 = require("../authentication");
17
17
  let PermissionGuard = class PermissionGuard {
18
- authService;
18
+ authenticationService;
19
19
  reflector;
20
- constructor(authService, reflector) {
21
- this.authService = authService;
20
+ constructor(authenticationService, reflector) {
21
+ this.authenticationService = authenticationService;
22
22
  this.reflector = reflector;
23
23
  }
24
24
  canActivate(context) {
@@ -34,15 +34,15 @@ let PermissionGuard = class PermissionGuard {
34
34
  if (headers['x-internal'] ?? isSelf) {
35
35
  return true;
36
36
  }
37
- return this.authService
38
- .authPermission(headers)({ keys: requiredPermissions, userId: user.sub })
37
+ return this.authenticationService
38
+ .authenticationPermission(headers)({ keys: requiredPermissions, userId: user.sub })
39
39
  .then(({ result }) => result === 'successes');
40
40
  }
41
41
  };
42
42
  exports.PermissionGuard = PermissionGuard;
43
43
  exports.PermissionGuard = PermissionGuard = __decorate([
44
44
  (0, common_1.Injectable)(),
45
- __metadata("design:paramtypes", [auth_1.AuthService,
45
+ __metadata("design:paramtypes", [authentication_1.AuthenticationService,
46
46
  core_1.Reflector])
47
47
  ], PermissionGuard);
48
48
  //# sourceMappingURL=permission.guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.guard.js","sourceRoot":"","sources":["../../src/permission/permission.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwE;AACxE,uCAAsC;AACtC,oDAA+D;AAC/D,sDAAuD;AAKhD,IAAM,eAAe,GAArB,MAAM,eAAe;IAEH;IACA;IAFrB,YACqB,qBAA4C,EAC5C,SAAoB;QADpB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,cAAS,GAAT,SAAS,CAAW;IACtC,CAAC;IAEJ,WAAW,CAAC,OAAyB;QACjC,MAAM,mBAAmB,GAAiB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,8CAA8B,EAAE;YACvG,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SACrB,CAAC,CAAA;QAEF,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA;QACf,CAAC;QAED,MAAM,EAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAc,CAAA;QAC/E,MAAM,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,EAAE,CAAA;QAEtC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,MAAM,EAAE,CAAC;YAClC,OAAO,IAAI,CAAA;QACf,CAAC;QAED,OAAO,IAAI,CAAC,qBAAqB;aAC5B,wBAAwB,CAAC,OAAO,CAAC,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAC,CAAC;aAChF,IAAI,CAAC,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,CAAC,CAAA;IACnD,CAAC;CACJ,CAAA;AA3BY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAGmC,sCAAqB;QACjC,gBAAS;GAHhC,eAAe,CA2B3B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.interface.js","sourceRoot":"","sources":["../../src/permission/permission.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAkCX;AAlCD,WAAY,UAAU;IAClB,oDAAsC,CAAA;IACtC,2CAA6B,CAAA;IAC7B,qDAAuC,CAAA;IACvC,+CAAiC,CAAA;IACjC,iDAAmC,CAAA;IACnC,yCAA2B,CAAA;IAC3B,oDAAsC,CAAA;IACtC,yCAA2B,CAAA;IAC3B,sDAAwC,CAAA;IACxC,2CAA6B,CAAA;IAC7B,qDAAuC,CAAA;IACvC,+CAAiC,CAAA;IACjC,iDAAmC,CAAA;IACnC,yCAA2B,CAAA;IAC3B,oDAAsC,CAAA;IACtC,yCAA2B,CAAA;IAC3B,sDAAwC,CAAA;IACxC,2CAA6B,CAAA;IAC7B,qDAAuC,CAAA;IACvC,+CAAiC,CAAA;IACjC,iDAAmC,CAAA;IACnC,yCAA2B,CAAA;IAC3B,oDAAsC,CAAA;IACtC,yCAA2B,CAAA;IAC3B,sDAAwC,CAAA;IACxC,gDAAkC,CAAA;IAClC,uCAAyB,CAAA;IACzB,iDAAmC,CAAA;IACnC,2CAA6B,CAAA;IAC7B,6CAA+B,CAAA;IAC/B,qCAAuB,CAAA;IACvB,gDAAkC,CAAA;IAClC,qCAAuB,CAAA;AAC3B,CAAC,EAlCW,UAAU,0BAAV,UAAU,QAkCrB"}