@attraccess/plugins-backend-sdk 0.0.11 → 1.5.2
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 +4 -6
- package/src/index.d.ts +1 -3
- package/src/index.js +1 -3
- package/src/index.js.map +1 -1
- package/src/lib/auth-decorator.js +2 -3
- package/src/lib/auth-decorator.js.map +1 -1
- package/src/lib/auth.types.d.ts +4 -4
- package/src/lib/dual-auth.guard.d.ts +16 -0
- package/src/lib/dual-auth.guard.js +63 -0
- package/src/lib/dual-auth.guard.js.map +1 -0
- package/src/lib/jwt.guard.d.ts +0 -4
- package/src/lib/jwt.guard.js +0 -13
- package/src/lib/jwt.guard.js.map +0 -1
- package/src/lib/plugin-api.module.d.ts +0 -2
- package/src/lib/plugin-api.module.js +0 -22
- package/src/lib/plugin-api.module.js.map +0 -1
- package/src/lib/plugin-api.service.d.ts +0 -9
- package/src/lib/plugin-api.service.js +0 -24
- package/src/lib/plugin-api.service.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attraccess/plugins-backend-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -20,15 +20,13 @@
|
|
|
20
20
|
"!**/*.tsbuildinfo"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"tslib": "^2.
|
|
23
|
+
"tslib": "^2.8.1",
|
|
24
24
|
"@attraccess/database-entities": "*",
|
|
25
25
|
"@nestjs/common": "^11.1.0",
|
|
26
26
|
"rxjs": "^7.8.2",
|
|
27
27
|
"@nestjs/core": "^11.1.0",
|
|
28
28
|
"@nestjs/swagger": "^11.2.0",
|
|
29
|
-
"express": "
|
|
30
|
-
"@nestjs/passport": "^11.0.5"
|
|
31
|
-
"typeorm": "0.3.20",
|
|
32
|
-
"@nestjs/typeorm": "^11.0.0"
|
|
29
|
+
"express": "4.21.2",
|
|
30
|
+
"@nestjs/passport": "^11.0.5"
|
|
33
31
|
}
|
|
34
32
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -3,7 +3,5 @@ export * from './lib/semver';
|
|
|
3
3
|
export * from './lib/auth-decorator';
|
|
4
4
|
export * from '@attraccess/database-entities';
|
|
5
5
|
export * as entities from '@attraccess/database-entities';
|
|
6
|
-
export * from './lib/plugin-api.service';
|
|
7
|
-
export * from './lib/plugin-api.module';
|
|
8
6
|
export * from './lib/auth.types';
|
|
9
|
-
export * from './lib/
|
|
7
|
+
export * from './lib/dual-auth.guard';
|
package/src/index.js
CHANGED
|
@@ -7,8 +7,6 @@ tslib_1.__exportStar(require("./lib/semver"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./lib/auth-decorator"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("@attraccess/database-entities"), exports);
|
|
9
9
|
exports.entities = tslib_1.__importStar(require("@attraccess/database-entities"));
|
|
10
|
-
tslib_1.__exportStar(require("./lib/plugin-api.service"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./lib/plugin-api.module"), exports);
|
|
12
10
|
tslib_1.__exportStar(require("./lib/auth.types"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./lib/
|
|
11
|
+
tslib_1.__exportStar(require("./lib/dual-auth.guard"), exports);
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plugins-backend-sdk/src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAuC;AACvC,uDAA6B;AAE7B,+DAAqC;AACrC,wEAA8C;AAC9C,kFAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plugins-backend-sdk/src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAuC;AACvC,uDAA6B;AAE7B,+DAAqC;AACrC,wEAA8C;AAC9C,kFAA0D;AAC1D,2DAAiC;AACjC,gEAAsC"}
|
|
@@ -7,10 +7,10 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
const common_1 = require("@nestjs/common");
|
|
8
8
|
const core_1 = require("@nestjs/core");
|
|
9
9
|
const swagger_1 = require("@nestjs/swagger");
|
|
10
|
-
const
|
|
10
|
+
const dual_auth_guard_1 = require("./dual-auth.guard");
|
|
11
11
|
const NeedsSystemPermissions = core_1.Reflector.createDecorator();
|
|
12
12
|
function Auth(...permissions) {
|
|
13
|
-
return (0, common_1.applyDecorators)(NeedsSystemPermissions(permissions), (0, common_1.UseGuards)(
|
|
13
|
+
return (0, common_1.applyDecorators)(NeedsSystemPermissions(permissions), (0, common_1.UseGuards)(dual_auth_guard_1.DualAuthGuard, SystemPermissionsGuard), (0, swagger_1.ApiBearerAuth)(), (0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' }));
|
|
14
14
|
}
|
|
15
15
|
let SystemPermissionsGuard = SystemPermissionsGuard_1 = class SystemPermissionsGuard {
|
|
16
16
|
constructor(reflector) {
|
|
@@ -36,7 +36,6 @@ let SystemPermissionsGuard = SystemPermissionsGuard_1 = class SystemPermissionsG
|
|
|
36
36
|
// Check each permission individually and log the result
|
|
37
37
|
const results = permissionsArray.map((permission) => {
|
|
38
38
|
const hasPermission = user.systemPermissions[permission] === true;
|
|
39
|
-
this.logger.debug(`Permission '${permission}': ${hasPermission}`);
|
|
40
39
|
return hasPermission;
|
|
41
40
|
});
|
|
42
41
|
return results.every((result) => result === true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-decorator.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/auth-decorator.ts"],"names":[],"mappings":";;;;AAkBA,oBAOC;;AAzBD,2CAQwB;AAExB,uCAAyC;AAGzC,6CAAyE;AACzE,
|
|
1
|
+
{"version":3,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,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEO,gBAAgB,CAAC,mBAA0D,EAAE,IAAU;QAC7F,kEAAkE;QAClE,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAE1G,wDAAwD;QACxD,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAClD,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;YAClE,OAAO,aAAa,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;IACpD,CAAC;CACF,CAAA;AAnCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;6CAIoB,gBAAS;GAH7B,sBAAsB,CAmClC"}
|
package/src/lib/auth.types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { User } from '@attraccess/database-entities';
|
|
2
2
|
import { Request as BaseRequest } from 'express';
|
|
3
|
+
export interface AuthenticatedUser extends User {
|
|
4
|
+
jwtTokenId: string;
|
|
5
|
+
}
|
|
3
6
|
export interface AuthenticatedRequest extends Omit<BaseRequest, 'logout'> {
|
|
4
|
-
user:
|
|
5
|
-
authInfo: {
|
|
6
|
-
tokenId: string;
|
|
7
|
-
};
|
|
7
|
+
user: AuthenticatedUser;
|
|
8
8
|
logout: (callback: () => void) => Promise<void>;
|
|
9
9
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
+
declare const DualAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
3
|
+
export declare class DualAuthGuard extends DualAuthGuard_base {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
/**
|
|
6
|
+
* Handles authentication requests using the session strategy
|
|
7
|
+
* Supports both cookie and Authorization header authentication
|
|
8
|
+
* Priority: Authorization header > Cookie
|
|
9
|
+
*/
|
|
10
|
+
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Handles authentication errors with proper error messages
|
|
13
|
+
*/
|
|
14
|
+
handleRequest<TUser = unknown>(err: unknown, user: unknown, info: unknown, context: ExecutionContext): TUser;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var DualAuthGuard_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DualAuthGuard = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const passport_1 = require("@nestjs/passport");
|
|
8
|
+
let DualAuthGuard = DualAuthGuard_1 = class DualAuthGuard extends (0, passport_1.AuthGuard)('session') {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.logger = new common_1.Logger(DualAuthGuard_1.name);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Handles authentication requests using the session strategy
|
|
15
|
+
* Supports both cookie and Authorization header authentication
|
|
16
|
+
* Priority: Authorization header > Cookie
|
|
17
|
+
*/
|
|
18
|
+
canActivate(context) {
|
|
19
|
+
const _super = Object.create(null, {
|
|
20
|
+
canActivate: { get: () => super.canActivate }
|
|
21
|
+
});
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
const result = yield _super.canActivate.call(this, context);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.logger.debug(`Authentication failed: ${error.message}`);
|
|
29
|
+
// Re-throw with consistent error message for both cookie and header failures
|
|
30
|
+
if (error instanceof common_1.UnauthorizedException) {
|
|
31
|
+
throw new common_1.UnauthorizedException('Authentication required');
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handles authentication errors with proper error messages
|
|
39
|
+
*/
|
|
40
|
+
handleRequest(err, user, info, context) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (err || !user) {
|
|
43
|
+
const request = context.switchToHttp().getRequest();
|
|
44
|
+
const hasAuthHeader = (_a = request.headers.authorization) === null || _a === void 0 ? void 0 : _a.startsWith('Bearer ');
|
|
45
|
+
const hasCookie = (_b = request.cookies) === null || _b === void 0 ? void 0 : _b['auth-session'];
|
|
46
|
+
let errorMessage = 'Authentication required';
|
|
47
|
+
if (hasAuthHeader) {
|
|
48
|
+
errorMessage = 'Invalid or expired authorization token';
|
|
49
|
+
}
|
|
50
|
+
else if (hasCookie) {
|
|
51
|
+
errorMessage = 'Invalid or expired session cookie';
|
|
52
|
+
}
|
|
53
|
+
this.logger.debug(`Authentication failed: ${errorMessage}`);
|
|
54
|
+
throw new common_1.UnauthorizedException(errorMessage);
|
|
55
|
+
}
|
|
56
|
+
return user;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.DualAuthGuard = DualAuthGuard;
|
|
60
|
+
exports.DualAuthGuard = DualAuthGuard = DualAuthGuard_1 = tslib_1.__decorate([
|
|
61
|
+
(0, common_1.Injectable)()
|
|
62
|
+
], DualAuthGuard);
|
|
63
|
+
//# sourceMappingURL=dual-auth.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dual-auth.guard.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/dual-auth.guard.ts"],"names":[],"mappings":";;;;;AAAA,2CAA6F;AAC7F,+CAA6C;AAGtC,IAAM,aAAa,qBAAnB,MAAM,aAAc,SAAQ,IAA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IAAI,8BAAqB,CAAC,YAAY,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAa,CAAC;IACvB,CAAC;CACF,CAAA;AApDY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAoDzB"}
|
package/src/lib/jwt.guard.d.ts
DELETED
package/src/lib/jwt.guard.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JwtGuard = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const passport_1 = require("@nestjs/passport");
|
|
7
|
-
let JwtGuard = class JwtGuard extends (0, passport_1.AuthGuard)('jwt') {
|
|
8
|
-
};
|
|
9
|
-
exports.JwtGuard = JwtGuard;
|
|
10
|
-
exports.JwtGuard = JwtGuard = tslib_1.__decorate([
|
|
11
|
-
(0, common_1.Injectable)()
|
|
12
|
-
], JwtGuard);
|
|
13
|
-
//# sourceMappingURL=jwt.guard.js.map
|
package/src/lib/jwt.guard.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.guard.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/jwt.guard.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,+CAA6C;AAGtC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;CAAG,CAAA;AAApC,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,mBAAU,GAAE;GACA,QAAQ,CAA4B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluginApiModule = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const plugin_api_service_1 = require("./plugin-api.service");
|
|
7
|
-
let PluginApiModule = class PluginApiModule {
|
|
8
|
-
};
|
|
9
|
-
exports.PluginApiModule = PluginApiModule;
|
|
10
|
-
exports.PluginApiModule = PluginApiModule = tslib_1.__decorate([
|
|
11
|
-
(0, common_1.Global)(),
|
|
12
|
-
(0, common_1.Module)({
|
|
13
|
-
providers: [
|
|
14
|
-
{
|
|
15
|
-
provide: plugin_api_service_1.PLUGIN_API_SERVICE,
|
|
16
|
-
useClass: plugin_api_service_1.PluginApiService,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
exports: [plugin_api_service_1.PLUGIN_API_SERVICE],
|
|
20
|
-
})
|
|
21
|
-
], PluginApiModule);
|
|
22
|
-
//# sourceMappingURL=plugin-api.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-api.module.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-api.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAgD;AAChD,6DAA4E;AAYrE,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAV3B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,uCAAkB;gBAC3B,QAAQ,EAAE,qCAAgB;aAC3B;SACF;QACD,OAAO,EAAE,CAAC,uCAAkB,CAAC;KAC9B,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@nestjs/common';
|
|
2
|
-
import { DataSource, ObjectLiteral } from 'typeorm';
|
|
3
|
-
import { entities } from '@attraccess/database-entities';
|
|
4
|
-
export declare class PluginApiService {
|
|
5
|
-
private readonly dataSource;
|
|
6
|
-
constructor(dataSource: DataSource);
|
|
7
|
-
getRepository<TEntity extends ObjectLiteral>(entityName: keyof typeof entities): import("typeorm").Repository<TEntity>;
|
|
8
|
-
}
|
|
9
|
-
export declare const PLUGIN_API_SERVICE: InjectionToken<PluginApiService>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PLUGIN_API_SERVICE = exports.PluginApiService = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const typeorm_2 = require("@nestjs/typeorm");
|
|
8
|
-
const database_entities_1 = require("@attraccess/database-entities");
|
|
9
|
-
let PluginApiService = class PluginApiService {
|
|
10
|
-
constructor(dataSource) {
|
|
11
|
-
this.dataSource = dataSource;
|
|
12
|
-
}
|
|
13
|
-
getRepository(entityName) {
|
|
14
|
-
return this.dataSource.getRepository(database_entities_1.entities[entityName]);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
exports.PluginApiService = PluginApiService;
|
|
18
|
-
exports.PluginApiService = PluginApiService = tslib_1.__decorate([
|
|
19
|
-
(0, common_1.Injectable)(),
|
|
20
|
-
tslib_1.__param(0, (0, typeorm_2.InjectDataSource)()),
|
|
21
|
-
tslib_1.__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
22
|
-
], PluginApiService);
|
|
23
|
-
exports.PLUGIN_API_SERVICE = 'PLUGIN_API_SERVICE';
|
|
24
|
-
//# sourceMappingURL=plugin-api.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-api.service.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-api.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4D;AAC5D,qCAAoD;AACpD,6CAAmD;AACnD,qEAAyD;AAGlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEG,aAAa,CAAgC,UAAiC;QACnF,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAU,4BAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AATY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,0BAAgB,GAAE,CAAA;6CACU,oBAAU;GAH9B,gBAAgB,CAS5B;AAEY,QAAA,kBAAkB,GAAG,oBAAwD,CAAC"}
|