@solidxai/core 0.1.9-beta.7 → 0.1.9-beta.8
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/dist/constants/chatter-message.constants.d.ts +6 -0
- package/dist/constants/chatter-message.constants.d.ts.map +1 -1
- package/dist/constants/chatter-message.constants.js +7 -1
- package/dist/constants/chatter-message.constants.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +12 -0
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +13 -0
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/controllers/chatter-message.controller.d.ts +1 -0
- package/dist/controllers/chatter-message.controller.d.ts.map +1 -1
- package/dist/controllers/chatter-message.controller.js +12 -0
- package/dist/controllers/chatter-message.controller.js.map +1 -1
- package/dist/controllers/facebook-authentication.controller.d.ts +27 -0
- package/dist/controllers/facebook-authentication.controller.d.ts.map +1 -0
- package/dist/controllers/facebook-authentication.controller.js +117 -0
- package/dist/controllers/facebook-authentication.controller.js.map +1 -0
- package/dist/controllers/menu-item-metadata.controller.d.ts +1 -0
- package/dist/controllers/menu-item-metadata.controller.d.ts.map +1 -1
- package/dist/controllers/menu-item-metadata.controller.js +15 -0
- package/dist/controllers/menu-item-metadata.controller.js.map +1 -1
- package/dist/controllers/microsoft-authentication.controller.d.ts +27 -0
- package/dist/controllers/microsoft-authentication.controller.d.ts.map +1 -0
- package/dist/controllers/microsoft-authentication.controller.js +118 -0
- package/dist/controllers/microsoft-authentication.controller.js.map +1 -0
- package/dist/controllers/setting.controller.d.ts +2 -2
- package/dist/controllers/setting.controller.js +2 -2
- package/dist/decorators/auth.decorator.d.ts.map +1 -1
- package/dist/decorators/computed-field-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/disallow-in-production.decorator.d.ts.map +1 -1
- package/dist/decorators/error-codes-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/extension-user-creation-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/is-not-in-enum.decorator.d.ts.map +1 -1
- package/dist/decorators/mail-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/roles.decorator.d.ts.map +1 -1
- package/dist/decorators/scheduled-job-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/security-rule-config-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/selection-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/sms-provider.decorator.d.ts.map +1 -1
- package/dist/decorators/solid-database-module.decorator.d.ts.map +1 -1
- package/dist/decorators/whatsapp-provider.decorator.d.ts.map +1 -1
- package/dist/dtos/create-chatter-message.dto.d.ts +1 -0
- package/dist/dtos/create-chatter-message.dto.d.ts.map +1 -1
- package/dist/dtos/create-chatter-message.dto.js +7 -1
- package/dist/dtos/create-chatter-message.dto.js.map +1 -1
- package/dist/dtos/post-chatter-message.dto.d.ts +1 -0
- package/dist/dtos/post-chatter-message.dto.d.ts.map +1 -1
- package/dist/dtos/post-chatter-message.dto.js +6 -1
- package/dist/dtos/post-chatter-message.dto.js.map +1 -1
- package/dist/dtos/update-chatter-message.dto.d.ts +1 -0
- package/dist/dtos/update-chatter-message.dto.d.ts.map +1 -1
- package/dist/dtos/update-chatter-message.dto.js +7 -1
- package/dist/dtos/update-chatter-message.dto.js.map +1 -1
- package/dist/entities/chatter-message.entity.d.ts +1 -0
- package/dist/entities/chatter-message.entity.d.ts.map +1 -1
- package/dist/entities/chatter-message.entity.js +5 -1
- package/dist/entities/chatter-message.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts +8 -0
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +33 -1
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/helpers/cors.helper.js +1 -1
- package/dist/helpers/cors.helper.js.map +1 -1
- package/dist/helpers/facebook-oauth.helper.d.ts +8 -0
- package/dist/helpers/facebook-oauth.helper.d.ts.map +1 -0
- package/dist/helpers/facebook-oauth.helper.js +11 -0
- package/dist/helpers/facebook-oauth.helper.js.map +1 -0
- package/dist/helpers/microsoft-oauth.helper.d.ts +9 -0
- package/dist/helpers/microsoft-oauth.helper.d.ts.map +1 -0
- package/dist/helpers/microsoft-oauth.helper.js +12 -0
- package/dist/helpers/microsoft-oauth.helper.js.map +1 -0
- package/dist/helpers/security.helper.d.ts.map +1 -1
- package/dist/helpers/string.helper.d.ts.map +1 -1
- package/dist/helpers/user-helper.d.ts.map +1 -1
- package/dist/helpers/user-helper.js +4 -0
- package/dist/helpers/user-helper.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +19 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/passport-strategies/facebook-oauth.strategy.d.ts +14 -0
- package/dist/passport-strategies/facebook-oauth.strategy.d.ts.map +1 -0
- package/dist/passport-strategies/facebook-oauth.strategy.js +73 -0
- package/dist/passport-strategies/facebook-oauth.strategy.js.map +1 -0
- package/dist/passport-strategies/microsoft-oauth.strategy.d.ts +14 -0
- package/dist/passport-strategies/microsoft-oauth.strategy.d.ts.map +1 -0
- package/dist/passport-strategies/microsoft-oauth.strategy.js +77 -0
- package/dist/passport-strategies/microsoft-oauth.strategy.js.map +1 -0
- package/dist/seeders/seed-data/solid-core-metadata.json +27 -58
- package/dist/services/api-key.service.d.ts +17 -1
- package/dist/services/api-key.service.d.ts.map +1 -1
- package/dist/services/api-key.service.js +38 -2
- package/dist/services/api-key.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +51 -16
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +318 -150
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +1 -0
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +24 -7
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +1 -1
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/setting.service.d.ts +5 -2
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +51 -6
- package/dist/services/setting.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +830 -0
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +1033 -117
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/services/user.service.d.ts +2 -0
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/services/user.service.js +72 -0
- package/dist/services/user.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +11 -3
- package/dist/solid-core.module.js.map +1 -1
- package/dist/transformers/array-transformer.d.ts.map +1 -1
- package/dist/transformers/boolean-transformer.d.ts.map +1 -1
- package/dist/transformers/datetime-transformer.d.ts.map +1 -1
- package/dist/transformers/integer-transformer.d.ts.map +1 -1
- package/dist/validators/is-parsable-int.d.ts.map +1 -1
- package/dist-tests/api/authenticate.spec.js +119 -0
- package/dist-tests/api/authenticate.spec.js.map +1 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
- package/dist-tests/api/ping.spec.js +21 -0
- package/dist-tests/api/ping.spec.js.map +1 -0
- package/dist-tests/helpers/auth.js +41 -0
- package/dist-tests/helpers/auth.js.map +1 -0
- package/dist-tests/helpers/env.js +11 -0
- package/dist-tests/helpers/env.js.map +1 -0
- package/docs/java-spring/README.md +3 -0
- package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
- package/nest +0 -0
- package/package.json +7 -1
- package/src/constants/chatter-message.constants.ts +7 -0
- package/src/controllers/authentication.controller.ts +8 -1
- package/src/controllers/chatter-message.controller.ts +6 -0
- package/src/controllers/facebook-authentication.controller.ts +113 -0
- package/src/controllers/menu-item-metadata.controller.ts +21 -15
- package/src/controllers/microsoft-authentication.controller.ts +116 -0
- package/src/dtos/create-chatter-message.dto.ts +11 -0
- package/src/dtos/post-chatter-message.dto.ts +4 -0
- package/src/dtos/update-chatter-message.dto.ts +13 -1
- package/src/entities/chatter-message.entity.ts +4 -1
- package/src/entities/user.entity.ts +32 -0
- package/src/helpers/cors.helper.ts +1 -1
- package/src/helpers/facebook-oauth.helper.ts +17 -0
- package/src/helpers/microsoft-oauth.helper.ts +19 -0
- package/src/helpers/user-helper.ts +4 -0
- package/src/index.ts +2 -0
- package/src/interfaces.ts +32 -1
- package/src/passport-strategies/facebook-oauth.strategy.ts +64 -0
- package/src/passport-strategies/microsoft-oauth.strategy.ts +70 -0
- package/src/seeders/seed-data/solid-core-metadata.json +27 -58
- package/src/services/api-key.service.ts +77 -35
- package/src/services/authentication.service.ts +1717 -1278
- package/src/services/chatter-message.service.ts +23 -3
- package/src/services/model-metadata.service.ts +1 -1
- package/src/services/setting.service.ts +64 -8
- package/src/services/settings/default-settings-provider.service.ts +1104 -155
- package/src/services/user.service.ts +87 -0
- package/src/solid-core.module.ts +25 -8
- package/.claude/settings.local.json +0 -15
- package/src/services/1.js +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facebook-oauth.strategy.js","sourceRoot":"","sources":["../../src/passport-strategies/facebook-oauth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAA+D;AAC/D,yDAA6C;AAC7C,4EAAyG;AACzG,+BAAkC;AAClC,2DAAuD;AAEvD,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAGzC,IAAM,kBAAkB,GAAxB,MAAM,kBAA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G7C,MAAM,eAAe,GAAW,IAAA,SAAI,GAAE,CAAC;QAEvC,MAAM,IAAI,GAAG;YACX,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,EAAE;YACd,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK;YACzB,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;YAC5C,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK;YAC3B,UAAU,EAAE,eAAe;SAC5B,CAAC;QAGF,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC;YAC9C,GAAG,IAAI;YACP,WAAW,EAAE,YAAY;YACzB,YAAY,EAAE,IAAI;SACrB,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnB,CAAC;CACF,CAAA;AAhDY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAI+B,0BAAW;GAH1C,qBAAqB,CAgDjC","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { AuthGuard, PassportStrategy } from '@nestjs/passport';\nimport { Strategy } from 'passport-facebook';\nimport { FacebookAuthConfiguration, isFacebookOAuthConfigured } from 'src/helpers/facebook-oauth.helper';\nimport { v4 as uuid } from 'uuid';\nimport { UserService } from '../services/user.service';\n\nconst DUMMY_CLIENT_ID = 'DUMMY_CLIENT_ID';\nconst DUMMY_CLIENT_SECRET = 'DUMMY_CLIENT_SECRET';\nconst DUMMY_CALLBACK_URL = 'DUMMY_CALLBACK_URL';\n\n@Injectable()\nexport class FacebookOauthGuard extends AuthGuard('facebook') { }\n\n@Injectable()\nexport class FacebookOAuthStrategy extends PassportStrategy(Strategy, 'facebook') {\n private readonly logger = new Logger(FacebookOAuthStrategy.name);\n\n constructor(private readonly userService: UserService) {\n // Reading configuration from environment variables (Static approach like Google)\n const clientID = process.env.IAM_FACEBOOK_OAUTH_CLIENT_ID ?? DUMMY_CLIENT_ID;\n const clientSecret = process.env.IAM_FACEBOOK_OAUTH_CLIENT_SECRET ?? DUMMY_CLIENT_SECRET;\n const callbackURL = process.env.IAM_FACEBOOK_OAUTH_CALLBACK_URL ?? DUMMY_CALLBACK_URL;\n const redirectURL = process.env.IAM_FACEBOOK_OAUTH_REDIRECT_URL;\n\n super({\n clientID,\n clientSecret,\n callbackURL,\n scope: ['email'],\n profileFields: ['id', 'emails', 'name', 'photos'],\n });\n\n const facebookOauth: FacebookAuthConfiguration = { clientID, clientSecret, callbackURL, redirectURL };\n if (!isFacebookOAuthConfigured(facebookOauth)) {\n this.logger.debug('Facebook OAuth strategy is not configured');\n }\n }\n\n async validate(_accessToken: string, _refreshToken: string, profile: any, done: any): Promise<any> {\n const { id, name, emails, photos } = profile;\n\n // generate a unique access code. \n const loginAccessCode: string = uuid();\n\n const user = {\n provider: 'facebook',\n providerId: id,\n email: emails?.[0]?.value,\n name: `${name.givenName} ${name.familyName}`,\n picture: photos?.[0]?.value,\n accessCode: loginAccessCode,\n };\n\n // store the access code and the access token in the database. \n await this.userService.resolveUserOnOauthFacebook({ \n ...user, \n accessToken: _accessToken, \n refreshToken: null \n });\n\n done(null, user);\n }\n}"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Strategy } from 'passport-microsoft';
|
|
2
|
+
import { UserService } from '../services/user.service';
|
|
3
|
+
declare const MicrosoftOauthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
4
|
+
export declare class MicrosoftOauthGuard extends MicrosoftOauthGuard_base {
|
|
5
|
+
}
|
|
6
|
+
declare const MicrosoftOAuthStrategy_base: new (...args: any[]) => Strategy;
|
|
7
|
+
export declare class MicrosoftOAuthStrategy extends MicrosoftOAuthStrategy_base {
|
|
8
|
+
private readonly userService;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(userService: UserService);
|
|
11
|
+
validate(_accessToken: string, _refreshToken: string, profile: any, done: any): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=microsoft-oauth.strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microsoft-oauth.strategy.d.ts","sourceRoot":"","sources":["../../src/passport-strategies/microsoft-oauth.strategy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;;AAOvD,qBACa,mBAAoB,SAAQ,wBAAsB;CAAI;;AAEnE,qBACa,sBAAuB,SAAQ,2BAAuC;IAGrE,OAAO,CAAC,QAAQ,CAAC,WAAW;IAFxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAErC,WAAW,EAAE,WAAW;IAuB/C,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CA2BnG"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
var MicrosoftOAuthStrategy_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.MicrosoftOAuthStrategy = exports.MicrosoftOauthGuard = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const passport_1 = require("@nestjs/passport");
|
|
16
|
+
const passport_microsoft_1 = require("passport-microsoft");
|
|
17
|
+
const microsoft_oauth_helper_1 = require("../helpers/microsoft-oauth.helper");
|
|
18
|
+
const uuid_1 = require("uuid");
|
|
19
|
+
const user_service_1 = require("../services/user.service");
|
|
20
|
+
const DUMMY_CLIENT_ID = 'DUMMY_CLIENT_ID';
|
|
21
|
+
const DUMMY_CLIENT_SECRET = 'DUMMY_CLIENT_SECRET';
|
|
22
|
+
const DUMMY_TENANT = 'common';
|
|
23
|
+
const DUMMY_CALLBACK_URL = 'DUMMY_CALLBACK_URL';
|
|
24
|
+
let MicrosoftOauthGuard = class MicrosoftOauthGuard extends (0, passport_1.AuthGuard)('microsoft') {
|
|
25
|
+
};
|
|
26
|
+
exports.MicrosoftOauthGuard = MicrosoftOauthGuard;
|
|
27
|
+
exports.MicrosoftOauthGuard = MicrosoftOauthGuard = __decorate([
|
|
28
|
+
(0, common_1.Injectable)()
|
|
29
|
+
], MicrosoftOauthGuard);
|
|
30
|
+
let MicrosoftOAuthStrategy = MicrosoftOAuthStrategy_1 = class MicrosoftOAuthStrategy extends (0, passport_1.PassportStrategy)(passport_microsoft_1.Strategy, 'microsoft') {
|
|
31
|
+
constructor(userService) {
|
|
32
|
+
const clientID = process.env.IAM_MICROSOFT_OAUTH_CLIENT_ID ?? DUMMY_CLIENT_ID;
|
|
33
|
+
const clientSecret = process.env.IAM_MICROSOFT_OAUTH_CLIENT_SECRET ?? DUMMY_CLIENT_SECRET;
|
|
34
|
+
const tenant = process.env.IAM_MICROSOFT_OAUTH_TENANT_ID ?? DUMMY_TENANT;
|
|
35
|
+
const callbackURL = process.env.IAM_MICROSOFT_OAUTH_CALLBACK_URL ?? DUMMY_CALLBACK_URL;
|
|
36
|
+
const redirectURL = process.env.IAM_MICROSOFT_OAUTH_REDIRECT_URL;
|
|
37
|
+
super({
|
|
38
|
+
clientID,
|
|
39
|
+
clientSecret,
|
|
40
|
+
callbackURL,
|
|
41
|
+
tenant,
|
|
42
|
+
scope: ['user.read'],
|
|
43
|
+
addUPNAsEmail: true,
|
|
44
|
+
});
|
|
45
|
+
this.userService = userService;
|
|
46
|
+
this.logger = new common_1.Logger(MicrosoftOAuthStrategy_1.name);
|
|
47
|
+
const microsoftOauth = { clientID, clientSecret, tenant, callbackURL, redirectURL };
|
|
48
|
+
if (!(0, microsoft_oauth_helper_1.isMicrosoftOAuthConfigured)(microsoftOauth)) {
|
|
49
|
+
this.logger.debug('Microsoft OAuth strategy is not configured');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async validate(_accessToken, _refreshToken, profile, done) {
|
|
53
|
+
const { id, displayName, emails, photos } = profile;
|
|
54
|
+
const loginAccessCode = (0, uuid_1.v4)();
|
|
55
|
+
const email = emails?.[0]?.value || profile._json?.mail || profile._json?.userPrincipalName;
|
|
56
|
+
const user = {
|
|
57
|
+
provider: 'microsoft',
|
|
58
|
+
providerId: id,
|
|
59
|
+
email: email,
|
|
60
|
+
name: displayName,
|
|
61
|
+
picture: photos?.[0]?.value || null,
|
|
62
|
+
accessCode: loginAccessCode,
|
|
63
|
+
};
|
|
64
|
+
await this.userService.resolveUserOnOauthMicrosoft({
|
|
65
|
+
...user,
|
|
66
|
+
accessToken: _accessToken,
|
|
67
|
+
refreshToken: null
|
|
68
|
+
});
|
|
69
|
+
done(null, user);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.MicrosoftOAuthStrategy = MicrosoftOAuthStrategy;
|
|
73
|
+
exports.MicrosoftOAuthStrategy = MicrosoftOAuthStrategy = MicrosoftOAuthStrategy_1 = __decorate([
|
|
74
|
+
(0, common_1.Injectable)(),
|
|
75
|
+
__metadata("design:paramtypes", [user_service_1.UserService])
|
|
76
|
+
], MicrosoftOAuthStrategy);
|
|
77
|
+
//# sourceMappingURL=microsoft-oauth.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microsoft-oauth.strategy.js","sourceRoot":"","sources":["../../src/passport-strategies/microsoft-oauth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAA+D;AAC/D,2DAA8C;AAC9C,8EAA4G;AAC5G,+BAAkC;AAClC,2DAAuD;AAEvD,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAGzC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,IAAA,oBAAS,EAAC,WAAW,CAAC;CAAI,CAAA;AAAtD,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;GACA,mBAAmB,CAAmC;AAG5D,IAAM,sBAAsB,8BAA5B,MAAM,sBAAuB,SAAQ,IAAA,2BAAgB,EAAC,6BAAQ,EAAE,WAAW,CAAC;IAGjF,YAA6B,WAAwB;QAEnD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,eAAe,CAAC;QAC9E,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,mBAAmB,CAAC;QAC1F,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,YAAY,CAAC;QACzE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,kBAAkB,CAAC;QACvF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;QAEjE,KAAK,CAAC;YACJ,QAAQ;YACR,YAAY;YACZ,WAAW;YACX,MAAM;YACN,KAAK,EAAE,CAAC,WAAW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AA,mBAAU,GAAE;qCAI+B,0BAAW;GAH1C,sBAAsB,CAqDlC","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { AuthGuard, PassportStrategy } from '@nestjs/passport';\nimport { Strategy } from 'passport-microsoft';\nimport { MicrosoftAuthConfiguration, isMicrosoftOAuthConfigured } from 'src/helpers/microsoft-oauth.helper';\nimport { v4 as uuid } from 'uuid';\nimport { UserService } from '../services/user.service';\n\nconst DUMMY_CLIENT_ID = 'DUMMY_CLIENT_ID';\nconst DUMMY_CLIENT_SECRET = 'DUMMY_CLIENT_SECRET';\nconst DUMMY_TENANT = 'common';\nconst DUMMY_CALLBACK_URL = 'DUMMY_CALLBACK_URL';\n\n@Injectable()\nexport class MicrosoftOauthGuard extends AuthGuard('microsoft') { }\n\n@Injectable()\nexport class MicrosoftOAuthStrategy extends PassportStrategy(Strategy, 'microsoft') {\n private readonly logger = new Logger(MicrosoftOAuthStrategy.name);\n\n constructor(private readonly userService: UserService) {\n // Reading configuration from environment variables (Static approach like Google)\n const clientID = process.env.IAM_MICROSOFT_OAUTH_CLIENT_ID ?? DUMMY_CLIENT_ID;\n const clientSecret = process.env.IAM_MICROSOFT_OAUTH_CLIENT_SECRET ?? DUMMY_CLIENT_SECRET;\n const tenant = process.env.IAM_MICROSOFT_OAUTH_TENANT_ID ?? DUMMY_TENANT;\n const callbackURL = process.env.IAM_MICROSOFT_OAUTH_CALLBACK_URL ?? DUMMY_CALLBACK_URL;\n const redirectURL = process.env.IAM_MICROSOFT_OAUTH_REDIRECT_URL;\n\n super({\n clientID,\n clientSecret,\n callbackURL,\n tenant,\n scope: ['user.read'],\n addUPNAsEmail: true,\n });\n\n const microsoftOauth: MicrosoftAuthConfiguration = { clientID, clientSecret, tenant, callbackURL, redirectURL };\n if (!isMicrosoftOAuthConfigured(microsoftOauth)) {\n this.logger.debug('Microsoft OAuth strategy is not configured');\n }\n }\n\n async validate(_accessToken: string, _refreshToken: string, profile: any, done: any): Promise<any> {\n const { id, displayName, emails, photos } = profile;\n\n // generate a unique access code. \n const loginAccessCode: string = uuid();\n\n // Handle email fallback logic within the standard validate flow\n const email = emails?.[0]?.value || profile._json?.mail || profile._json?.userPrincipalName;\n\n const user = {\n provider: 'microsoft',\n providerId: id,\n email: email,\n name: displayName,\n picture: photos?.[0]?.value || null,\n accessCode: loginAccessCode,\n };\n\n // store the access code and the access token in the database. \n await this.userService.resolveUserOnOauthMicrosoft({ \n ...user, \n accessToken: _accessToken, \n refreshToken: null \n });\n\n done(null, user);\n }\n}"]}
|
|
@@ -1511,7 +1511,7 @@
|
|
|
1511
1511
|
"encrypt": false,
|
|
1512
1512
|
"relationType": "many-to-many",
|
|
1513
1513
|
"relationCoModelSingularName": "roleMetadata",
|
|
1514
|
-
"relationCoModelFieldName": "
|
|
1514
|
+
"relationCoModelFieldName": "menuItems",
|
|
1515
1515
|
"relationCreateInverse": true,
|
|
1516
1516
|
"relationCascade": "set null",
|
|
1517
1517
|
"relationModelModuleName": "solid-core",
|
|
@@ -3780,7 +3780,9 @@
|
|
|
3780
3780
|
"audit_insert:audit_insert",
|
|
3781
3781
|
"audit_update:audit_update",
|
|
3782
3782
|
"audit_delete:audit_delete",
|
|
3783
|
-
"custom:custom"
|
|
3783
|
+
"custom:custom",
|
|
3784
|
+
"note:note",
|
|
3785
|
+
"task:task"
|
|
3784
3786
|
]
|
|
3785
3787
|
},
|
|
3786
3788
|
{
|
|
@@ -3891,6 +3893,21 @@
|
|
|
3891
3893
|
"private": false,
|
|
3892
3894
|
"encrypt": false,
|
|
3893
3895
|
"isSystem": false
|
|
3896
|
+
},
|
|
3897
|
+
{
|
|
3898
|
+
"name": "status",
|
|
3899
|
+
"displayName": "Message Status",
|
|
3900
|
+
"type": "selectionStatic",
|
|
3901
|
+
"defaultValue": "pending",
|
|
3902
|
+
"length": 256,
|
|
3903
|
+
"required": true,
|
|
3904
|
+
"index": false,
|
|
3905
|
+
"isSystem": false,
|
|
3906
|
+
"selectionValueType": "string",
|
|
3907
|
+
"selectionStaticValues": [
|
|
3908
|
+
"pending:pending",
|
|
3909
|
+
"completed:completed"
|
|
3910
|
+
]
|
|
3894
3911
|
}
|
|
3895
3912
|
]
|
|
3896
3913
|
},
|
|
@@ -5907,7 +5924,8 @@
|
|
|
5907
5924
|
},
|
|
5908
5925
|
"permissions": [
|
|
5909
5926
|
"mcp:invoke",
|
|
5910
|
-
"agent:invoke"
|
|
5927
|
+
"agent:invoke",
|
|
5928
|
+
"settings:view_encrypted"
|
|
5911
5929
|
],
|
|
5912
5930
|
"roles": [
|
|
5913
5931
|
{
|
|
@@ -5951,6 +5969,7 @@
|
|
|
5951
5969
|
"ChatterMessageController.getChatterMessages",
|
|
5952
5970
|
"ChatterMessageController.postMessage",
|
|
5953
5971
|
"ChatterMessageController.findMany",
|
|
5972
|
+
"ChatterMessageController.markCompleted",
|
|
5954
5973
|
"ImportTransactionController.getImportTemplate",
|
|
5955
5974
|
"ImportTransactionController.getImportInstructions",
|
|
5956
5975
|
"ImportTransactionController.getImportMappingInfo",
|
|
@@ -6408,38 +6427,12 @@
|
|
|
6408
6427
|
"modelUserKey": "userActivityHistory"
|
|
6409
6428
|
},
|
|
6410
6429
|
{
|
|
6411
|
-
"displayName": "
|
|
6412
|
-
"name": "
|
|
6413
|
-
"type": "custom",
|
|
6414
|
-
"domain": "",
|
|
6415
|
-
"context": "",
|
|
6416
|
-
"customComponent": "/admin/core/solid-core/settings/app-settings",
|
|
6417
|
-
"customIsModal": true,
|
|
6418
|
-
"serverEndpoint": "",
|
|
6419
|
-
"viewUserKey": "",
|
|
6420
|
-
"moduleUserKey": "solid-core",
|
|
6421
|
-
"modelUserKey": "setting"
|
|
6422
|
-
},
|
|
6423
|
-
{
|
|
6424
|
-
"displayName": "Authentication Settings Action",
|
|
6425
|
-
"name": "authenticationSettings-action",
|
|
6426
|
-
"type": "custom",
|
|
6427
|
-
"domain": "",
|
|
6428
|
-
"context": "",
|
|
6429
|
-
"customComponent": "/admin/core/solid-core/settings/authentication-settings",
|
|
6430
|
-
"customIsModal": true,
|
|
6431
|
-
"serverEndpoint": "",
|
|
6432
|
-
"viewUserKey": "",
|
|
6433
|
-
"moduleUserKey": "solid-core",
|
|
6434
|
-
"modelUserKey": "setting"
|
|
6435
|
-
},
|
|
6436
|
-
{
|
|
6437
|
-
"displayName": "Misc Action",
|
|
6438
|
-
"name": "miscSettings-action",
|
|
6430
|
+
"displayName": "Settings",
|
|
6431
|
+
"name": "settings-action",
|
|
6439
6432
|
"type": "custom",
|
|
6440
6433
|
"domain": "",
|
|
6441
6434
|
"context": "",
|
|
6442
|
-
"customComponent": "/admin/core/
|
|
6435
|
+
"customComponent": "/admin/core/settings",
|
|
6443
6436
|
"customIsModal": true,
|
|
6444
6437
|
"serverEndpoint": "",
|
|
6445
6438
|
"viewUserKey": "",
|
|
@@ -6920,35 +6913,11 @@
|
|
|
6920
6913
|
"displayName": "Settings",
|
|
6921
6914
|
"name": "settings-menu-item",
|
|
6922
6915
|
"sequenceNumber": 9,
|
|
6923
|
-
"actionUserKey": "",
|
|
6916
|
+
"actionUserKey": "settings-action",
|
|
6924
6917
|
"moduleUserKey": "solid-core",
|
|
6925
6918
|
"parentMenuItemUserKey": "",
|
|
6926
6919
|
"iconName": "settings"
|
|
6927
6920
|
},
|
|
6928
|
-
{
|
|
6929
|
-
"displayName": "App Settings",
|
|
6930
|
-
"name": "appSettings-menu-item",
|
|
6931
|
-
"sequenceNumber": 1,
|
|
6932
|
-
"actionUserKey": "appSettings-action",
|
|
6933
|
-
"moduleUserKey": "solid-core",
|
|
6934
|
-
"parentMenuItemUserKey": "settings-menu-item"
|
|
6935
|
-
},
|
|
6936
|
-
{
|
|
6937
|
-
"displayName": "Authentication Settings",
|
|
6938
|
-
"name": "authenticationSettings-menu-item",
|
|
6939
|
-
"sequenceNumber": 2,
|
|
6940
|
-
"actionUserKey": "authenticationSettings-action",
|
|
6941
|
-
"moduleUserKey": "solid-core",
|
|
6942
|
-
"parentMenuItemUserKey": "settings-menu-item"
|
|
6943
|
-
},
|
|
6944
|
-
{
|
|
6945
|
-
"displayName": "Misc",
|
|
6946
|
-
"name": "miscSettings-menu-item",
|
|
6947
|
-
"sequenceNumber": 3,
|
|
6948
|
-
"actionUserKey": "miscSettings-action",
|
|
6949
|
-
"moduleUserKey": "solid-core",
|
|
6950
|
-
"parentMenuItemUserKey": "settings-menu-item"
|
|
6951
|
-
},
|
|
6952
6921
|
{
|
|
6953
6922
|
"displayName": "Model Sequence",
|
|
6954
6923
|
"name": "modelSequence-menu-item",
|
|
@@ -10518,7 +10487,7 @@
|
|
|
10518
10487
|
"edit": true,
|
|
10519
10488
|
"delete": true,
|
|
10520
10489
|
"groupBy": "stage",
|
|
10521
|
-
"draggable":
|
|
10490
|
+
"draggable": false,
|
|
10522
10491
|
"allowedViews": [
|
|
10523
10492
|
"list",
|
|
10524
10493
|
"kanban"
|
|
@@ -4,17 +4,33 @@ import { UserApiKey } from '../entities/user-api-key.entity';
|
|
|
4
4
|
import { ActiveUserData } from '../interfaces/active-user-data.interface';
|
|
5
5
|
import { UserApiKeyRepository } from '../repository/user-api-key.repository';
|
|
6
6
|
import { PermissionMetadataService } from '../services/permission-metadata.service';
|
|
7
|
+
import { AuthenticationService } from './authentication.service';
|
|
8
|
+
import { UserRepository } from '../repository/user.repository';
|
|
7
9
|
export declare class ApiKeyService {
|
|
8
10
|
private readonly apiKeyRepository;
|
|
9
11
|
private readonly permissionMetadataService;
|
|
12
|
+
private readonly authenticationService;
|
|
13
|
+
private readonly userRepository;
|
|
10
14
|
private readonly logger;
|
|
11
|
-
constructor(apiKeyRepository: UserApiKeyRepository, permissionMetadataService: PermissionMetadataService);
|
|
15
|
+
constructor(apiKeyRepository: UserApiKeyRepository, permissionMetadataService: PermissionMetadataService, authenticationService: AuthenticationService, userRepository: UserRepository);
|
|
12
16
|
generate(userId: number, dto: CreateApiKeyDto): Promise<{
|
|
13
17
|
apiKey: string;
|
|
14
18
|
record: UserApiKey;
|
|
15
19
|
}>;
|
|
16
20
|
validate(rawKey: string): Promise<ActiveUserData>;
|
|
17
21
|
updateKey(id: number, userId: number, dto: UpdateApiKeyDto): Promise<void>;
|
|
22
|
+
apiKeyMe(apiKey: string): Promise<{
|
|
23
|
+
accessToken: string;
|
|
24
|
+
refreshToken: string;
|
|
25
|
+
user: {
|
|
26
|
+
email: string;
|
|
27
|
+
mobile: string;
|
|
28
|
+
username: string;
|
|
29
|
+
forcePasswordChange: boolean;
|
|
30
|
+
id: number;
|
|
31
|
+
roles: string[];
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
18
34
|
private hash;
|
|
19
35
|
}
|
|
20
36
|
//# sourceMappingURL=api-key.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.service.d.ts","sourceRoot":"","sources":["../../src/services/api-key.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-key.service.d.ts","sourceRoot":"","sources":["../../src/services/api-key.service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,qBACa,aAAa;IAIlB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,cAAc;IANnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;gBAGpC,gBAAgB,EAAE,oBAAoB,EACtC,yBAAyB,EAAE,yBAAyB,EACpD,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EAAE,cAAc;IAG7C,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,CAAE;IA+BlG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAG,cAAc,CAAE;IAkCpD,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB1E,QAAQ,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;IAoC7B,OAAO,CAAC,IAAI;CAGf"}
|
|
@@ -13,14 +13,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.ApiKeyService = void 0;
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const crypto_1 = require("crypto");
|
|
16
|
+
const error_messages_1 = require("../constants/error-messages");
|
|
16
17
|
const user_api_key_entity_1 = require("../entities/user-api-key.entity");
|
|
17
18
|
const user_entity_1 = require("../entities/user.entity");
|
|
18
19
|
const user_api_key_repository_1 = require("../repository/user-api-key.repository");
|
|
19
20
|
const permission_metadata_service_1 = require("./permission-metadata.service");
|
|
21
|
+
const authentication_service_1 = require("./authentication.service");
|
|
22
|
+
const user_repository_1 = require("../repository/user.repository");
|
|
20
23
|
let ApiKeyService = ApiKeyService_1 = class ApiKeyService {
|
|
21
|
-
constructor(apiKeyRepository, permissionMetadataService) {
|
|
24
|
+
constructor(apiKeyRepository, permissionMetadataService, authenticationService, userRepository) {
|
|
22
25
|
this.apiKeyRepository = apiKeyRepository;
|
|
23
26
|
this.permissionMetadataService = permissionMetadataService;
|
|
27
|
+
this.authenticationService = authenticationService;
|
|
28
|
+
this.userRepository = userRepository;
|
|
24
29
|
this.logger = new common_1.Logger(ApiKeyService_1.name);
|
|
25
30
|
}
|
|
26
31
|
async generate(userId, dto) {
|
|
@@ -85,6 +90,35 @@ let ApiKeyService = ApiKeyService_1 = class ApiKeyService {
|
|
|
85
90
|
.where('id = :id', { id })
|
|
86
91
|
.execute();
|
|
87
92
|
}
|
|
93
|
+
async apiKeyMe(apiKey) {
|
|
94
|
+
const hasedKey = this.hash(apiKey);
|
|
95
|
+
const apiKeyRecord = await this.apiKeyRepository.findOne({
|
|
96
|
+
where: {
|
|
97
|
+
hashedKey: hasedKey,
|
|
98
|
+
},
|
|
99
|
+
relations: {
|
|
100
|
+
user: {
|
|
101
|
+
roles: true
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (!apiKeyRecord) {
|
|
106
|
+
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
107
|
+
}
|
|
108
|
+
const user = apiKeyRecord.user;
|
|
109
|
+
const tokens = await this.authenticationService.generateTokens(user);
|
|
110
|
+
return {
|
|
111
|
+
user: {
|
|
112
|
+
email: user.email,
|
|
113
|
+
mobile: user.mobile,
|
|
114
|
+
username: user.username,
|
|
115
|
+
forcePasswordChange: user.forcePasswordChange,
|
|
116
|
+
id: user.id,
|
|
117
|
+
roles: user.roles.map((role) => role.name)
|
|
118
|
+
},
|
|
119
|
+
...tokens
|
|
120
|
+
};
|
|
121
|
+
}
|
|
88
122
|
hash(rawKey) {
|
|
89
123
|
return (0, crypto_1.createHash)('sha256').update(rawKey).digest('hex');
|
|
90
124
|
}
|
|
@@ -93,6 +127,8 @@ exports.ApiKeyService = ApiKeyService;
|
|
|
93
127
|
exports.ApiKeyService = ApiKeyService = ApiKeyService_1 = __decorate([
|
|
94
128
|
(0, common_1.Injectable)(),
|
|
95
129
|
__metadata("design:paramtypes", [user_api_key_repository_1.UserApiKeyRepository,
|
|
96
|
-
permission_metadata_service_1.PermissionMetadataService
|
|
130
|
+
permission_metadata_service_1.PermissionMetadataService,
|
|
131
|
+
authentication_service_1.AuthenticationService,
|
|
132
|
+
user_repository_1.UserRepository])
|
|
97
133
|
], ApiKeyService);
|
|
98
134
|
//# sourceMappingURL=api-key.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.service.js","sourceRoot":"","sources":["../../src/services/api-key.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAMwB;AACxB,mCAAiD;
|
|
1
|
+
{"version":3,"file":"api-key.service.js","sourceRoot":"","sources":["../../src/services/api-key.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAMwB;AACxB,mCAAiD;AACjD,gEAA8D;AAG9D,yEAA8D;AAC9D,yDAAgD;AAEhD,mFAA8E;AAC9E,+EAAqF;AACrF,qEAAiE;AACjE,mEAAgE;AAGzD,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGtB,YACqB,gBAAsC,EACtC,yBAAoD,EACpD,qBAA4C,EAC5C,cAA8B;QAH9B,qBAAgB,GAAhB,gBAAgB,CAAsB;QACtC,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QANlC,WAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAOtD,CAAC;IAEJ,KAAK,CAAC,QAAQ,CAAC,MAAc,EAAE,GAAoB;QAC3C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAI,EAAE;YAC3D,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACrB,MAAM,EAAE,CAAC,IAAI,EAAE,4BAA4B,CAAC;SAC/C,CAAC,CAAC;QAEH,IAAG,CAAC,IAAI,EAAE,0BAA0B,EAAE,CAAC;YACnC,MA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AAI,CAAC,MAAc;QACvB,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACJ,CAAA;AApIY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAK8B,8CAAoB;QACX,uDAAyB;QAC7B,8CAAqB;QAC5B,gCAAc;GAP1C,aAAa,CAoIzB","sourcesContent":["import {\n ForbiddenException,\n Injectable,\n Logger,\n NotFoundException,\n UnauthorizedException,\n} from '@nestjs/common';\nimport { createHash, randomBytes } from 'crypto';\nimport { ERROR_MESSAGES } from 'src/constants/error-messages';\nimport { CreateApiKeyDto } from 'src/dtos/create-api-key.dto';\nimport { UpdateApiKeyDto } from 'src/dtos/update-api-key.dto';\nimport { UserApiKey } from 'src/entities/user-api-key.entity';\nimport { User } from 'src/entities/user.entity';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { UserApiKeyRepository } from 'src/repository/user-api-key.repository';\nimport { PermissionMetadataService } from 'src/services/permission-metadata.service';\nimport { AuthenticationService } from './authentication.service';\nimport { UserRepository } from 'src/repository/user.repository';\n\n@Injectable()\nexport class ApiKeyService {\n private readonly logger = new Logger(ApiKeyService.name);\n\n constructor(\n private readonly apiKeyRepository: UserApiKeyRepository,\n private readonly permissionMetadataService: PermissionMetadataService,\n private readonly authenticationService: AuthenticationService,\n private readonly userRepository: UserRepository,\n ) {}\n\n async generate(userId: number, dto: CreateApiKeyDto): Promise < { apiKey: string; record: UserApiKey } > {\n const user = await this.apiKeyRepository.manager.findOne(User, {\n where: { id: userId },\n select: ['id', 'isAllowedToGenerateApiKeys'],\n });\n\n if(!user?.isAllowedToGenerateApiKeys) {\n throw new ForbiddenException('You are not allowed to generate API keys');\n }\n\n const rawKey = 'sldx_' + randomBytes(32).toString('hex');\n const hashedKey = this.hash(rawKey);\n const maskedKey = 'sldx_****' + rawKey.slice(-4);\n\n const record = this.apiKeyRepository.create({\n name: dto.name,\n hashedKey,\n maskedKey,\n isActive: true,\n expiresAt: dto.expiresAt ? new Date(dto.expiresAt) : null,\n user,\n });\n\n await this.apiKeyRepository.save(record);\n\n // Strip hashedKey from the returned record — maskedKey is all the UI needs\n delete(record as any).hashedKey;\n\n return { apiKey: rawKey, record };\n }\n\n async validate(rawKey: string): Promise < ActiveUserData > {\n const hashedKey = this.hash(rawKey);\n\n // Bypass security rules for auth validation — must find the key regardless of caller context\n const keyRecord = await this.apiKeyRepository.findOne({\n where: { hashedKey, isActive: true },\n relations: ['user', 'user.roles'],\n });\n\n if(!keyRecord) {\n throw new UnauthorizedException();\n }\n\n if(keyRecord.expiresAt && keyRecord.expiresAt < new Date()) {\n throw new UnauthorizedException('API key expired');\n }\n\n // Fire-and-forget — does not need security rule context\n this.apiKeyRepository.update(keyRecord.id, { lastUsedAt: new Date() }).catch((err) => {\n this.logger.warn(`Failed to update lastUsedAt for key ${keyRecord.id}: ${err.message}`);\n });\n\n const roles = (keyRecord.user.roles ?? []).map((r) => r.name);\n const permissions = await this.permissionMetadataService.findAllUsingRoles(roles);\n\n return {\n sub: keyRecord.user.id,\n username: keyRecord.user.username,\n email: keyRecord.user.email,\n roles,\n permissions: permissions.map((p) => p.name),\n };\n }\n\n async updateKey(id: number, userId: number, dto: UpdateApiKeyDto): Promise<void> {\n const keyRecord = await this.apiKeyRepository.findOne({\n where: { id, user: { id: userId } },\n });\n\n if (!keyRecord) {\n throw new NotFoundException('API key not found');\n }\n\n await this.apiKeyRepository.manager\n .createQueryBuilder()\n .update(UserApiKey)\n .set({ isActive: dto.isActive })\n .where('id = :id', { id })\n .execute();\n }\n\n\n async apiKeyMe(apiKey: string) {\n\n const hasedKey = this.hash(apiKey);\n const apiKeyRecord = await this.apiKeyRepository.findOne({\n where: {\n hashedKey: hasedKey,\n },\n relations: {\n user: {\n roles: true\n }\n }\n });\n\n if (!apiKeyRecord) {\n throw new UnauthorizedException(ERROR_MESSAGES.INVALID_CREDENTIALS);\n }\n\n const user = apiKeyRecord.user;\n\n const tokens = await this.authenticationService.generateTokens(user);\n\n\n return {\n user: {\n email: user.email,\n mobile: user.mobile,\n username: user.username,\n forcePasswordChange: user.forcePasswordChange,\n id: user.id,\n roles: user.roles.map((role) => role.name)\n },\n ...tokens\n }\n }\n\n private hash(rawKey: string): string {\n return createHash('sha256').update(rawKey).digest('hex');\n }\n}\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { HttpService } from
|
|
2
|
-
import { EventEmitter2 } from
|
|
3
|
-
import { JwtService } from
|
|
4
|
-
import { CreateUserDto } from
|
|
5
|
-
import { MailFactory } from
|
|
6
|
-
import { UserRepository } from
|
|
7
|
-
import { DataSource, Repository } from
|
|
1
|
+
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
import { EventEmitter2 } from "@nestjs/event-emitter";
|
|
3
|
+
import { JwtService } from "@nestjs/jwt";
|
|
4
|
+
import { CreateUserDto } from "../dtos/create-user.dto";
|
|
5
|
+
import { MailFactory } from "../factories/mail.factory";
|
|
6
|
+
import { UserRepository } from "../repository/user.repository";
|
|
7
|
+
import { DataSource, Repository } from "typeorm";
|
|
8
8
|
import { ChangePasswordDto } from "../dtos/change-password.dto";
|
|
9
|
-
import { ConfirmForgotPasswordDto } from
|
|
10
|
-
import { InitiateForgotPasswordDto } from
|
|
11
|
-
import { OTPConfirmOTPDto } from
|
|
12
|
-
import { OTPSignInDto } from
|
|
13
|
-
import { OTPSignUpDto } from
|
|
14
|
-
import { RefreshTokenDto } from
|
|
15
|
-
import { SignInDto } from
|
|
16
|
-
import { SignUpDto } from
|
|
17
|
-
import { User } from
|
|
9
|
+
import { ConfirmForgotPasswordDto } from "../dtos/confirm-forgot-password.dto";
|
|
10
|
+
import { InitiateForgotPasswordDto } from "../dtos/initiate-forgot-password.dto";
|
|
11
|
+
import { OTPConfirmOTPDto } from "../dtos/otp-confirm-otp.dto";
|
|
12
|
+
import { OTPSignInDto } from "../dtos/otp-sign-in.dto";
|
|
13
|
+
import { OTPSignUpDto } from "../dtos/otp-sign-up.dto";
|
|
14
|
+
import { RefreshTokenDto } from "../dtos/refresh-token.dto";
|
|
15
|
+
import { SignInDto } from "../dtos/sign-in.dto";
|
|
16
|
+
import { SignUpDto } from "../dtos/sign-up.dto";
|
|
17
|
+
import { User } from "../entities/user.entity";
|
|
18
18
|
import { ActiveUserData } from '../interfaces/active-user-data.interface';
|
|
19
19
|
import { HashingService } from './hashing.service';
|
|
20
20
|
import { RefreshTokenIdsStorageService } from './refresh-token-ids-storage.service';
|
|
@@ -172,6 +172,41 @@ export declare class AuthenticationService {
|
|
|
172
172
|
roles: string[];
|
|
173
173
|
};
|
|
174
174
|
}>;
|
|
175
|
+
validateUserUsingFacebook(user: User): Promise<any>;
|
|
176
|
+
signInUsingFacebook(accessCode: string): Promise<{
|
|
177
|
+
accessToken: string;
|
|
178
|
+
refreshToken: string;
|
|
179
|
+
user: {
|
|
180
|
+
email: string;
|
|
181
|
+
mobile: string;
|
|
182
|
+
username: string;
|
|
183
|
+
id: number;
|
|
184
|
+
roles: string[];
|
|
185
|
+
};
|
|
186
|
+
}>;
|
|
187
|
+
validateUserUsingMicrosoft(user: User): Promise<any>;
|
|
188
|
+
signInUsingMicrosoft(accessCode: string): Promise<{
|
|
189
|
+
accessToken: string;
|
|
190
|
+
refreshToken: string;
|
|
191
|
+
user: {
|
|
192
|
+
email: string;
|
|
193
|
+
mobile: string;
|
|
194
|
+
username: string;
|
|
195
|
+
id: number;
|
|
196
|
+
roles: string[];
|
|
197
|
+
};
|
|
198
|
+
}>;
|
|
199
|
+
signInUsingApple(accessCode: string): Promise<{
|
|
200
|
+
accessToken: string;
|
|
201
|
+
refreshToken: string;
|
|
202
|
+
user: {
|
|
203
|
+
email: string;
|
|
204
|
+
mobile: string;
|
|
205
|
+
username: string;
|
|
206
|
+
id: number;
|
|
207
|
+
roles: string[];
|
|
208
|
+
};
|
|
209
|
+
}>;
|
|
175
210
|
private isPasswordlessRegistrationEnabled;
|
|
176
211
|
private checkAccountBlocked;
|
|
177
212
|
private incrementFailedAttempts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.service.d.ts","sourceRoot":"","sources":["../../src/services/authentication.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"authentication.service.d.ts","sourceRoot":"","sources":["../../src/services/authentication.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAe,UAAU,EAAE,MAAM,SAAS,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAA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