@riao/iam 1.0.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +20 -0
  3. package/README.md +5 -0
  4. package/auth.d.ts +11 -0
  5. package/auth.js +16 -0
  6. package/auth.js.map +1 -0
  7. package/authentication-base.d.ts +12 -0
  8. package/authentication-base.js +48 -0
  9. package/authentication-base.js.map +1 -0
  10. package/authentication-password.d.ts +11 -0
  11. package/authentication-password.js +43 -0
  12. package/authentication-password.js.map +1 -0
  13. package/authentication-passwordless.d.ts +24 -0
  14. package/authentication-passwordless.js +55 -0
  15. package/authentication-passwordless.js.map +1 -0
  16. package/authorization-abac.d.ts +8 -0
  17. package/authorization-abac.js +33 -0
  18. package/authorization-abac.js.map +1 -0
  19. package/authorization-base.d.ts +17 -0
  20. package/authorization-base.js +30 -0
  21. package/authorization-base.js.map +1 -0
  22. package/authorization-hmm.d.ts +0 -0
  23. package/authorization-hmm.js +173 -0
  24. package/authorization-hmm.js.map +1 -0
  25. package/authorization-rbac.d.ts +14 -0
  26. package/authorization-rbac.js +61 -0
  27. package/authorization-rbac.js.map +1 -0
  28. package/errors/authentication-error.d.ts +3 -0
  29. package/errors/authentication-error.js +8 -0
  30. package/errors/authentication-error.js.map +1 -0
  31. package/errors/authorization-error.d.ts +3 -0
  32. package/errors/authorization-error.js +8 -0
  33. package/errors/authorization-error.js.map +1 -0
  34. package/errors/error.d.ts +2 -0
  35. package/errors/error.js +7 -0
  36. package/errors/error.js.map +1 -0
  37. package/iam.d.ts +40 -0
  38. package/iam.js +73 -0
  39. package/iam.js.map +1 -0
  40. package/index.d.ts +2 -0
  41. package/index.js +19 -0
  42. package/index.js.map +1 -0
  43. package/jwt.d.ts +28 -0
  44. package/jwt.js +84 -0
  45. package/jwt.js.map +1 -0
  46. package/keypair.d.ts +24 -0
  47. package/keypair.js +71 -0
  48. package/keypair.js.map +1 -0
  49. package/migrations/1725221752756-create-users-table.d.ts +7 -0
  50. package/migrations/1725221752756-create-users-table.js +36 -0
  51. package/migrations/1725221752756-create-users-table.js.map +1 -0
  52. package/migrations/1725221859886-create-roles-table.d.ts +7 -0
  53. package/migrations/1725221859886-create-roles-table.js +36 -0
  54. package/migrations/1725221859886-create-roles-table.js.map +1 -0
  55. package/migrations/1725221896876-create-permissions-table.d.ts +7 -0
  56. package/migrations/1725221896876-create-permissions-table.js +41 -0
  57. package/migrations/1725221896876-create-permissions-table.js.map +1 -0
  58. package/migrations/1725221935064-create-role-permissions-table.d.ts +7 -0
  59. package/migrations/1725221935064-create-role-permissions-table.js +56 -0
  60. package/migrations/1725221935064-create-role-permissions-table.js.map +1 -0
  61. package/migrations/1725221951873-create-user-roles-table.d.ts +7 -0
  62. package/migrations/1725221951873-create-user-roles-table.js +56 -0
  63. package/migrations/1725221951873-create-user-roles-table.js.map +1 -0
  64. package/migrations/index.d.ts +5 -0
  65. package/migrations/index.js +22 -0
  66. package/migrations/index.js.map +1 -0
  67. package/package.json +29 -0
  68. package/secret.d.ts +5 -0
  69. package/secret.js +3 -0
  70. package/secret.js.map +1 -0
  71. package/token.d.ts +13 -0
  72. package/token.js +3 -0
  73. package/token.js.map +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ # riao-iam - Changelog
package/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2022 riao-iam and others
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # riao-iam - Readme
2
+
3
+ ## Contributing & Development
4
+
5
+ See [contributing.md](docs/contributing/contributing.md) for information on how to develop or contribute to this project!
package/auth.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Database, DatabaseRecord, QueryRepository } from '@riao/dbal';
2
+ export interface AuthOptions {
3
+ db: Database;
4
+ userTable?: string;
5
+ }
6
+ export declare abstract class AuthBase<TUser extends DatabaseRecord = DatabaseRecord> {
7
+ protected db: Database;
8
+ protected userRepo: QueryRepository<TUser>;
9
+ protected userTable: string;
10
+ constructor(options: AuthOptions);
11
+ }
package/auth.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthBase = void 0;
4
+ class AuthBase {
5
+ constructor(options) {
6
+ var _a, _b;
7
+ this.userTable = 'users';
8
+ this.db = (_a = options.db) !== null && _a !== void 0 ? _a : this.db;
9
+ this.userTable = (_b = options.userTable) !== null && _b !== void 0 ? _b : this.userTable;
10
+ this.userRepo = this.db.getQueryRepository({
11
+ table: this.userTable,
12
+ });
13
+ }
14
+ }
15
+ exports.AuthBase = AuthBase;
16
+ //# sourceMappingURL=auth.js.map
package/auth.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;AAOA,MAAsB,QAAQ;IAK7B,YAAmB,OAAoB;;QAF7B,cAAS,GAAG,OAAO,CAAC;QAG7B,IAAI,CAAC,EAAE,GAAG,MAAA,OAAO,CAAC,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI,CAAC,SAAS,CAAC;QAErD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC;YAC1C,KAAK,EAAE,IAAI,CAAC,SAAS;SACrB,CAAC,CAAC;IACJ,CAAC;CACD;AAbD,4BAaC"}
@@ -0,0 +1,12 @@
1
+ import { DatabaseRecord, Expression, SelectQuery } from '@riao/dbal';
2
+ import { AuthBase, AuthOptions } from './auth';
3
+ export interface AuthenticationOptions extends AuthOptions {
4
+ loginColumn: string;
5
+ }
6
+ export declare abstract class AuthenticationBase<TUser extends DatabaseRecord = DatabaseRecord> extends AuthBase<TUser> {
7
+ protected loginColumn: string;
8
+ constructor(options: AuthenticationOptions);
9
+ findActiveUser(query: SelectQuery<TUser>): Promise<TUser>;
10
+ login(credentials: any): Promise<TUser>;
11
+ protected userIsActive(): Expression<TUser>;
12
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthenticationBase = void 0;
13
+ const dbal_1 = require("@riao/dbal");
14
+ const authentication_error_1 = require("./errors/authentication-error");
15
+ const auth_1 = require("./auth");
16
+ class AuthenticationBase extends auth_1.AuthBase {
17
+ constructor(options) {
18
+ var _a;
19
+ super(options);
20
+ this.loginColumn = (_a = options.loginColumn) !== null && _a !== void 0 ? _a : this.loginColumn;
21
+ }
22
+ findActiveUser(query) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const userWhere = this.userIsActive();
25
+ if (query.where && userWhere !== undefined) {
26
+ query.where = [userWhere, dbal_1.and, query.where];
27
+ }
28
+ else if (userWhere !== undefined) {
29
+ query.where = userWhere;
30
+ }
31
+ const user = yield this.userRepo.findOne(Object.assign({ columns: ['id'] }, query));
32
+ if (!user) {
33
+ throw new authentication_error_1.AuthenticationError('Could not find active user');
34
+ }
35
+ return user;
36
+ });
37
+ }
38
+ login(credentials) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ throw new Error('No login implementation');
41
+ });
42
+ }
43
+ userIsActive() {
44
+ return undefined;
45
+ }
46
+ }
47
+ exports.AuthenticationBase = AuthenticationBase;
48
+ //# sourceMappingURL=authentication-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-base.js","sourceRoot":"","sources":["../../src/authentication-base.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOoB;AACpB,wEAAoE;AACpE,iCAA+C;AAM/C,MAAsB,kBAEpB,SAAQ,eAAe;IAGxB,YAAmB,OAA8B;;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,CAAC,WAAW,CAAC;IAC5D,CAAC;IAEY,cAAc,CAAC,KAAyB;;YACpD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAEtC,IAAI,KAAK,CAAC,KAAK,IAAI,SAAS,KAAK,SAAS,EAAE;gBAC3C,KAAK,CAAC,KAAK,GAAG,CAAC,SAAS,EAAE,UAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aAC5C;iBACI,IAAI,SAAS,KAAK,SAAS,EAAE;gBACjC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;aACxB;YAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,iBACvC,OAAO,EAAE,CAAC,IAAI,CAAC,IACZ,KAAK,EACP,CAAC;YAEH,IAAI,CAAC,IAAI,EAAE;gBACV,MAAM,IAAI,0CAAmB,CAAC,4BAA4B,CAAC,CAAC;aAC5D;YAED,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IAEY,KAAK,CAAC,WAAW;;YAC7B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC5C,CAAC;KAAA;IAES,YAAY;QACrB,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AAxCD,gDAwCC"}
@@ -0,0 +1,11 @@
1
+ import { DatabaseRecord } from '@riao/dbal';
2
+ import { AuthenticationBase } from './authentication-base';
3
+ export interface PasswordLogin {
4
+ login: string;
5
+ password: string;
6
+ }
7
+ export declare class AuthenticationPassword<TUser extends DatabaseRecord = DatabaseRecord> extends AuthenticationBase<TUser> {
8
+ login(credentials: PasswordLogin): Promise<TUser>;
9
+ hashPassword(password: string): Promise<string>;
10
+ verifyPassword(hash: string, password: string): Promise<boolean>;
11
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthenticationPassword = void 0;
13
+ const authentication_base_1 = require("./authentication-base");
14
+ const argon2 = require("argon2");
15
+ const authentication_error_1 = require("./errors/authentication-error");
16
+ class AuthenticationPassword extends authentication_base_1.AuthenticationBase {
17
+ login(credentials) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const user = yield this.findActiveUser({
20
+ columns: ['id', 'password'],
21
+ where: { [this.loginColumn]: credentials.login },
22
+ });
23
+ if (yield this.verifyPassword(user.password, credentials.password)) {
24
+ return user;
25
+ }
26
+ else {
27
+ throw new authentication_error_1.AuthenticationError('Wrong password');
28
+ }
29
+ });
30
+ }
31
+ hashPassword(password) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ return yield argon2.hash(password);
34
+ });
35
+ }
36
+ verifyPassword(hash, password) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ return yield argon2.verify(hash, password);
39
+ });
40
+ }
41
+ }
42
+ exports.AuthenticationPassword = AuthenticationPassword;
43
+ //# sourceMappingURL=authentication-password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-password.js","sourceRoot":"","sources":["../../src/authentication-password.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAA2D;AAE3D,iCAAiC;AACjC,wEAAoE;AAOpE,MAAa,sBAEX,SAAQ,wCAAyB;IACrB,KAAK,CAAC,WAA0B;;YAC5C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;gBACtC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC;gBAC3B,KAAK,EAAO,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE;aACrD,CAAC,CAAC;YAEH,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE;gBACnE,OAAO,IAAI,CAAC;aACZ;iBACI;gBACJ,MAAM,IAAI,0CAAmB,CAAC,gBAAgB,CAAC,CAAC;aAChD;QACF,CAAC;KAAA;IAEY,YAAY,CAAC,QAAgB;;YACzC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;KAAA;IAEY,cAAc,CAC1B,IAAY,EACZ,QAAgB;;YAEhB,OAAO,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;KAAA;CACD;AA3BD,wDA2BC"}
@@ -0,0 +1,24 @@
1
+ import { DatabaseRecord, DatabaseRecordId } from '@riao/dbal';
2
+ import { AuthenticationBase, AuthenticationOptions } from './authentication-base';
3
+ import { Token, Jwt, JwtOptions } from './jwt';
4
+ export interface MagicLinkPayload {
5
+ type: 'magic-link';
6
+ userId: DatabaseRecordId;
7
+ }
8
+ export interface PasswordlessAuthenticationOptions extends AuthenticationOptions {
9
+ jwt: JwtOptions;
10
+ }
11
+ export interface TokenOptions {
12
+ expiresIn: string;
13
+ }
14
+ export declare const defaultTokenOptions: TokenOptions;
15
+ export declare class AuthenticationPasswordless<TUser extends DatabaseRecord = DatabaseRecord> extends AuthenticationBase<TUser> {
16
+ protected jwt: Jwt<MagicLinkPayload>;
17
+ constructor(options: PasswordlessAuthenticationOptions);
18
+ getMagicToken(credentials: {
19
+ login: string;
20
+ }, options?: TokenOptions): Promise<Token>;
21
+ login(credentials: {
22
+ token: string;
23
+ }): Promise<TUser>;
24
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthenticationPasswordless = exports.defaultTokenOptions = void 0;
13
+ const authentication_base_1 = require("./authentication-base");
14
+ const jwt_1 = require("./jwt");
15
+ const authentication_error_1 = require("./errors/authentication-error");
16
+ exports.defaultTokenOptions = {
17
+ expiresIn: '5m',
18
+ };
19
+ class AuthenticationPasswordless extends authentication_base_1.AuthenticationBase {
20
+ constructor(options) {
21
+ super(options);
22
+ this.jwt = new jwt_1.Jwt(options.jwt);
23
+ }
24
+ getMagicToken(credentials, options = exports.defaultTokenOptions) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ // Check user
27
+ const user = yield this.findActiveUser({
28
+ where: { [this.loginColumn]: credentials.login },
29
+ });
30
+ // Generate & return token
31
+ return yield this.jwt.generateToken({
32
+ type: 'magic-link',
33
+ userId: user.id,
34
+ }, {
35
+ expiresIn: options.expiresIn,
36
+ });
37
+ });
38
+ }
39
+ login(credentials) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ // Verify magic token
42
+ const data = yield this.jwt.decodeToken(credentials.token);
43
+ if (data.type !== 'magic-link') {
44
+ throw new authentication_error_1.AuthenticationError('Wrong type of token provided for this operation.');
45
+ }
46
+ // Check user
47
+ const user = yield this.findActiveUser({
48
+ where: { id: data.userId },
49
+ });
50
+ return user;
51
+ });
52
+ }
53
+ }
54
+ exports.AuthenticationPasswordless = AuthenticationPasswordless;
55
+ //# sourceMappingURL=authentication-passwordless.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-passwordless.js","sourceRoot":"","sources":["../../src/authentication-passwordless.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAG+B;AAC/B,+BAA+C;AAC/C,wEAAoE;AAgBvD,QAAA,mBAAmB,GAAiB;IAChD,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,MAAa,0BAEX,SAAQ,wCAAyB;IAGlC,YAAmB,OAA0C;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,GAAG,GAAG,IAAI,SAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEY,aAAa,CACzB,WAA8B,EAC9B,UAAwB,2BAAmB;;YAE3C,aAAa;YACb,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;gBACtC,KAAK,EAAO,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE;aACrD,CAAC,CAAC;YAEH,0BAA0B;YAC1B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAClC;gBACC,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,IAAI,CAAC,EAAE;aACf,EACD;gBACC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC5B,CACD,CAAC;QACH,CAAC;KAAA;IAEY,KAAK,CAAC,WAA8B;;YAChD,qBAAqB;YACrB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAE3D,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;gBAC/B,MAAM,IAAI,0CAAmB,CAC5B,kDAAkD,CAClD,CAAC;aACF;YAED,aAAa;YACb,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;gBACtC,KAAK,EAAO,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;aAC/B,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;CACD;AAjDD,gEAiDC"}
@@ -0,0 +1,8 @@
1
+ import { AuthorizationBase, AuthorizationLookup } from './authorization-base';
2
+ import { AuthOptions } from './auth';
3
+ export type AttributeBasedAuthorizationOptions = AuthOptions;
4
+ export declare class AttributeBasedAuthorization extends AuthorizationBase {
5
+ constructor(options: AttributeBasedAuthorizationOptions);
6
+ checkQuery(lookup: AuthorizationLookup): Promise<boolean>;
7
+ check(lookup: AuthorizationLookup): Promise<void>;
8
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AttributeBasedAuthorization = void 0;
13
+ const authorization_base_1 = require("./authorization-base");
14
+ const authorization_error_1 = require("./errors/authorization-error");
15
+ class AttributeBasedAuthorization extends authorization_base_1.AuthorizationBase {
16
+ constructor(options) {
17
+ super(options);
18
+ }
19
+ checkQuery(lookup) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ return false;
22
+ });
23
+ }
24
+ check(lookup) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ if (!(yield this.checkQuery(lookup))) {
27
+ throw new authorization_error_1.AuthorizationError();
28
+ }
29
+ });
30
+ }
31
+ }
32
+ exports.AttributeBasedAuthorization = AttributeBasedAuthorization;
33
+ //# sourceMappingURL=authorization-abac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-abac.js","sourceRoot":"","sources":["../../src/authorization-abac.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA8E;AAC9E,sEAAkE;AAKlE,MAAa,2BAA4B,SAAQ,sCAAiB;IACjE,YAAmB,OAA2C;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;IAChB,CAAC;IAEY,UAAU,CAAC,MAA2B;;YAClD,OAAO,KAAK,CAAC;QACd,CAAC;KAAA;IAEY,KAAK,CAAC,MAA2B;;YAC7C,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;gBACrC,MAAM,IAAI,wCAAkB,EAAE,CAAC;aAC/B;QACF,CAAC;KAAA;CACD;AAdD,kEAcC"}
@@ -0,0 +1,17 @@
1
+ import { DatabaseRecord, DatabaseRecordId } from '@riao/dbal';
2
+ import { AuthBase } from './auth';
3
+ export declare enum CrudActions {
4
+ CREATE = "c",
5
+ READ = "r",
6
+ UPDATE = "u",
7
+ DELETE = "d"
8
+ }
9
+ export type Action = string | CrudActions;
10
+ export interface AuthorizationLookup {
11
+ userId: DatabaseRecordId;
12
+ action: Action;
13
+ model?: string;
14
+ }
15
+ export declare abstract class AuthorizationBase<TUser extends DatabaseRecord = DatabaseRecord> extends AuthBase<TUser> {
16
+ check(lookup: AuthorizationLookup): Promise<void>;
17
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthorizationBase = exports.CrudActions = void 0;
13
+ const authorization_error_1 = require("./errors/authorization-error");
14
+ const auth_1 = require("./auth");
15
+ var CrudActions;
16
+ (function (CrudActions) {
17
+ CrudActions["CREATE"] = "c";
18
+ CrudActions["READ"] = "r";
19
+ CrudActions["UPDATE"] = "u";
20
+ CrudActions["DELETE"] = "d";
21
+ })(CrudActions = exports.CrudActions || (exports.CrudActions = {}));
22
+ class AuthorizationBase extends auth_1.AuthBase {
23
+ check(lookup) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ throw new authorization_error_1.AuthorizationError();
26
+ });
27
+ }
28
+ }
29
+ exports.AuthorizationBase = AuthorizationBase;
30
+ //# sourceMappingURL=authorization-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-base.js","sourceRoot":"","sources":["../../src/authorization-base.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sEAAkE;AAClE,iCAAkC;AAElC,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,2BAAY,CAAA;IACZ,yBAAU,CAAA;IACV,2BAAY,CAAA;IACZ,2BAAY,CAAA;AACb,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAUD,MAAsB,iBAEpB,SAAQ,eAAe;IACX,KAAK,CAAC,MAA2B;;YAC7C,MAAM,IAAI,wCAAkB,EAAE,CAAC;QAChC,CAAC;KAAA;CACD;AAND,8CAMC"}
File without changes
@@ -0,0 +1,173 @@
1
+ // import {
2
+ // and,
3
+ // columnName,
4
+ // Database,
5
+ // DatabaseRecordId,
6
+ // DeleteOptions,
7
+ // InsertOptions,
8
+ // QueryRepository,
9
+ // or,
10
+ // SelectQuery,
11
+ // UpdateOptions,
12
+ // DatabaseRecord,
13
+ // } from '@riao/dbal';
14
+ // import { Action } from './action';
15
+ // import { ActionEnum } from './action';
16
+ // import { AuthorizationError } from './errors/authorization-error';
17
+ // export class Permission {
18
+ // // If the model is null, access is global (meaning access to all models)
19
+ // model?: string;
20
+ // // If the column is null, access is model-global (meaning access to all
21
+ // // columns on the model)
22
+ // column?: string;
23
+ // // The action, e.g. create, update, or a custom action
24
+ // action: Action;
25
+ // }
26
+ // export interface LookupInterface {
27
+ // userId: DatabaseRecordId;
28
+ // action: Action;
29
+ // model: string;
30
+ // column?: string;
31
+ // }
32
+ // export interface AuthorizationOptions {
33
+ // db: Database;
34
+ // }
35
+ // export abstract class AuthorizationBase {
36
+ // protected db: Database;
37
+ // public constructor(options: AuthorizationOptions) {
38
+ // this.db = options.db;
39
+ // }
40
+ // public async lookupPermissions(
41
+ // lookup: LookupInterface
42
+ // ): Promise<Permission[]> {
43
+ // return [];
44
+ // }
45
+ // protected async getColumnAccess(
46
+ // lookup: LookupInterface
47
+ // ): Promise<{ hasModelAccess: boolean; columns: string[] }> {
48
+ // // TODO: Only fetch necessary permission columns
49
+ // const permissions = await this.lookupPermissions(lookup);
50
+ // const columns: string[] = [];
51
+ // for (const permission of permissions) {
52
+ // if (
53
+ // permission.column === null &&
54
+ // (permission.model === null ||
55
+ // (lookup.model &&
56
+ // permission.model === lookup.model &&
57
+ // lookup.action === permission.action))
58
+ // ) {
59
+ // // User has permission globally or for all columns on model
60
+ // return { hasModelAccess: true, columns: [] };
61
+ // }
62
+ // else {
63
+ // // Append column to array, to check column by column later
64
+ // columns.push(permission.column);
65
+ // }
66
+ // }
67
+ // return { hasModelAccess: false, columns };
68
+ // }
69
+ // public async create(options: {
70
+ // userId: DatabaseRecordId;
71
+ // model: string;
72
+ // records: DatabaseRecord | DatabaseRecord[];
73
+ // }) {
74
+ // const { hasModelAccess, columns } = await this.getColumnAccess({
75
+ // model: options.model,
76
+ // userId: options.userId,
77
+ // action: ActionEnum.CREATE,
78
+ // });
79
+ // if (!hasModelAccess) {
80
+ // const records: DatabaseRecord[] = Array.isArray(options.records)
81
+ // ? options.records
82
+ // : [options.records];
83
+ // for (const record of records) {
84
+ // for (const key in record) {
85
+ // if (!columns.includes(key)) {
86
+ // this.fail({
87
+ // userId: options.userId,
88
+ // model: options.model,
89
+ // column: key,
90
+ // action: ActionEnum.CREATE,
91
+ // });
92
+ // }
93
+ // }
94
+ // }
95
+ // }
96
+ // return await this.db.query.insert({
97
+ // table: options.model, // TODO: Validate
98
+ // records: options.records,
99
+ // });
100
+ // }
101
+ // public async read(options: {
102
+ // userId: DatabaseRecordId;
103
+ // query: SelectQuery;
104
+ // }) {
105
+ // const { hasModelAccess, columns } = await this.getColumnAccess({
106
+ // model: options.query.table,
107
+ // userId: options.userId,
108
+ // action: ActionEnum.READ,
109
+ // });
110
+ // // Check columns
111
+ // for (const column of options.query.columns) {
112
+ // if (typeof column !== 'string') {
113
+ // throw new AuthorizationError('Can only select column names');
114
+ // }
115
+ // if (!hasModelAccess && !columns.includes(column)) {
116
+ // throw new AuthorizationError(
117
+ // 'Access denied on column ' + column
118
+ // );
119
+ // }
120
+ // }
121
+ // // TODO: Check Join
122
+ // for (const join of options.query.join) {
123
+ // // TODO: To join, the user must have access to:
124
+ // // 1. The relation column on the parent model
125
+ // // 2. Any/all columns on the joined table
126
+ // // 3. Columns in the `on` clause
127
+ // }
128
+ // // TODO: Where
129
+ // // TODO: Group by
130
+ // // TODO: Having
131
+ // // TODO: Order by
132
+ // // TODO: Schema permission check
133
+ // // TODO: Need to check all parts of query, e.g. grouping, order, etc.
134
+ // return await this.db.query.find(options.query);
135
+ // }
136
+ // public async readOne(options: {
137
+ // userId: DatabaseRecordId;
138
+ // update: UpdateOptions;
139
+ // }) {}
140
+ // public async update(options: {
141
+ // userId: DatabaseRecordId;
142
+ // update: UpdateOptions;
143
+ // }) {
144
+ // // TODO: Check model
145
+ // // TODO: Need to check all update options - e.g. join, etc.?
146
+ // // TODO: Check options.update.where, similar to read()
147
+ // // TODO: Check options.update.set, similar to insert()
148
+ // return await this.db.query.update(options.update);
149
+ // }
150
+ // public async delete(options: {
151
+ // userId: DatabaseRecordId;
152
+ // delete: DeleteOptions;
153
+ // }) {
154
+ // // TODO: Check model permission
155
+ // // TODO: Need to check all delete options - e.g. join, etc.?
156
+ // // TODO: Check options.update.where, similar to read()
157
+ // return await this.db.query.delete(options.delete);
158
+ // }
159
+ // public async getUserScopes(userId: DatabaseRecordId): Promise<string[]> {
160
+ // return [];
161
+ // }
162
+ // protected async fail(lookup: LookupInterface): Promise<void> {
163
+ // let message = `User "${lookup.userId}" cannot "${lookup.action}"`;
164
+ // if ('model' in lookup && 'column' in lookup) {
165
+ // message += ` on "${lookup.model}.${lookup.column}"`;
166
+ // }
167
+ // else if ('model' in lookup) {
168
+ // message += ` on model "${lookup.model}"`;
169
+ // }
170
+ // throw new Error(message);
171
+ // }
172
+ // }
173
+ //# sourceMappingURL=authorization-hmm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-hmm.js","sourceRoot":"","sources":["../../src/authorization-hmm.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,QAAQ;AACR,eAAe;AACf,aAAa;AACb,qBAAqB;AACrB,kBAAkB;AAClB,kBAAkB;AAClB,oBAAoB;AACpB,OAAO;AACP,gBAAgB;AAChB,kBAAkB;AAClB,mBAAmB;AACnB,uBAAuB;AACvB,qCAAqC;AACrC,yCAAyC;AACzC,qEAAqE;AAErE,4BAA4B;AAC5B,4EAA4E;AAC5E,mBAAmB;AAEnB,2EAA2E;AAC3E,4BAA4B;AAC5B,oBAAoB;AAEpB,0DAA0D;AAC1D,mBAAmB;AACnB,IAAI;AAEJ,qCAAqC;AACrC,6BAA6B;AAC7B,mBAAmB;AACnB,kBAAkB;AAClB,oBAAoB;AACpB,IAAI;AAEJ,0CAA0C;AAC1C,iBAAiB;AACjB,IAAI;AAEJ,4CAA4C;AAC5C,2BAA2B;AAE3B,uDAAuD;AACvD,0BAA0B;AAC1B,KAAK;AAEL,mCAAmC;AACnC,4BAA4B;AAC5B,8BAA8B;AAC9B,eAAe;AACf,KAAK;AAEL,oCAAoC;AACpC,4BAA4B;AAC5B,gEAAgE;AAChE,qDAAqD;AACrD,8DAA8D;AAC9D,kCAAkC;AAElC,4CAA4C;AAC5C,UAAU;AACV,oCAAoC;AACpC,oCAAoC;AACpC,wBAAwB;AACxB,6CAA6C;AAC7C,8CAA8C;AAC9C,SAAS;AACT,kEAAkE;AAClE,oDAAoD;AACpD,OAAO;AACP,YAAY;AACZ,iEAAiE;AACjE,uCAAuC;AACvC,OAAO;AACP,MAAM;AAEN,+CAA+C;AAC/C,KAAK;AAEL,kCAAkC;AAClC,8BAA8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D;AACvD,KAAK;AAEL,6EAA6E;AAC7E,eAAe;AACf,KAAK;AAEL,kEAAkE;AAClE,uEAAuE;AAEvE,mDAAmD;AACnD,0DAA0D;AAC1D,MAAM;AACN,kCAAkC;AAClC,+CAA+C;AAC/C,MAAM;AAEN,8BAA8B;AAC9B,KAAK;AACL,IAAI"}
@@ -0,0 +1,14 @@
1
+ import { AuthorizationBase, AuthorizationLookup } from './authorization-base';
2
+ import { AuthOptions } from './auth';
3
+ export interface RoleBasedAuthorizationOptions extends AuthOptions {
4
+ permissionTable?: string;
5
+ userRoleTable?: string;
6
+ rolePermissionTable?: string;
7
+ }
8
+ export declare class RoleBasedAuthorization extends AuthorizationBase {
9
+ protected permissionTable: any;
10
+ protected userRoleTable: any;
11
+ protected rolePermissionTable: any;
12
+ constructor(options: RoleBasedAuthorizationOptions);
13
+ check(lookup: AuthorizationLookup): Promise<void>;
14
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RoleBasedAuthorization = void 0;
13
+ const dbal_1 = require("@riao/dbal");
14
+ const authorization_base_1 = require("./authorization-base");
15
+ const authorization_error_1 = require("./errors/authorization-error");
16
+ class RoleBasedAuthorization extends authorization_base_1.AuthorizationBase {
17
+ constructor(options) {
18
+ var _a, _b, _c, _d, _e, _f;
19
+ super(options);
20
+ this.permissionTable =
21
+ (_b = (_a = options.permissionTable) !== null && _a !== void 0 ? _a : this.permissionTable) !== null && _b !== void 0 ? _b : 'permissions';
22
+ this.userRoleTable =
23
+ (_d = (_c = options.userRoleTable) !== null && _c !== void 0 ? _c : this.userRoleTable) !== null && _d !== void 0 ? _d : 'user_roles';
24
+ this.rolePermissionTable =
25
+ (_f = (_e = options.rolePermissionTable) !== null && _e !== void 0 ? _e : this.rolePermissionTable) !== null && _f !== void 0 ? _f : 'role_permissions';
26
+ }
27
+ check(lookup) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const found = yield this.db.query.findOne({
30
+ table: this.permissionTable,
31
+ columns: [`${this.permissionTable}.id`],
32
+ join: [
33
+ {
34
+ type: 'INNER',
35
+ table: this.rolePermissionTable,
36
+ on: {
37
+ [`${this.rolePermissionTable}.permission_id`]: (0, dbal_1.columnName)(`${this.permissionTable}.id`),
38
+ },
39
+ },
40
+ {
41
+ type: 'INNER',
42
+ table: this.userRoleTable,
43
+ on: {
44
+ [`${this.userRoleTable}.role_id`]: (0, dbal_1.columnName)(`${this.rolePermissionTable}.role_id`),
45
+ },
46
+ },
47
+ ],
48
+ where: {
49
+ [`${this.userRoleTable}.user_id`]: lookup.userId,
50
+ [`${this.permissionTable}.action`]: lookup.action,
51
+ [`${this.permissionTable}.model`]: lookup.model,
52
+ },
53
+ });
54
+ if (!found) {
55
+ throw new authorization_error_1.AuthorizationError();
56
+ }
57
+ });
58
+ }
59
+ }
60
+ exports.RoleBasedAuthorization = RoleBasedAuthorization;
61
+ //# sourceMappingURL=authorization-rbac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-rbac.js","sourceRoot":"","sources":["../../src/authorization-rbac.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwC;AACxC,6DAA8E;AAC9E,sEAAkE;AASlE,MAAa,sBAAuB,SAAQ,sCAAiB;IAK5D,YAAmB,OAAsC;;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,eAAe;YACnB,MAAA,MAAA,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