@riao/iam 2.0.0 → 3.1.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 (95) hide show
  1. package/README.md +67 -1
  2. package/auth/auth-migrations.d.ts +5 -3
  3. package/auth/auth-migrations.js +8 -5
  4. package/auth/auth-migrations.js.map +1 -1
  5. package/auth/auth.d.ts +6 -8
  6. package/auth/auth.js +5 -8
  7. package/auth/auth.js.map +1 -1
  8. package/auth/index.d.ts +1 -0
  9. package/auth/migrations/{001-create-accounts-table.d.ts → 001-create-principals-table.d.ts} +1 -1
  10. package/auth/migrations/001-create-principals-table.js +39 -0
  11. package/auth/migrations/001-create-principals-table.js.map +1 -0
  12. package/auth/principal.d.ts +8 -0
  13. package/auth/principal.js +3 -0
  14. package/auth/principal.js.map +1 -0
  15. package/authentication/authentication.d.ts +9 -0
  16. package/authentication/authentication.js +41 -0
  17. package/authentication/authentication.js.map +1 -0
  18. package/authentication/index.d.ts +1 -0
  19. package/authentication/index.js +6 -0
  20. package/authentication/index.js.map +1 -0
  21. package/authorization/authorization.d.ts +58 -0
  22. package/authorization/authorization.js +32 -0
  23. package/authorization/authorization.js.map +1 -0
  24. package/authorization/index.d.ts +1 -0
  25. package/authorization/index.js +6 -0
  26. package/authorization/index.js.map +1 -0
  27. package/crypto.d.ts +16 -0
  28. package/crypto.js +35 -0
  29. package/crypto.js.map +1 -0
  30. package/index.d.ts +5 -1
  31. package/index.js +12 -2
  32. package/index.js.map +1 -1
  33. package/jwt.d.ts +1 -1
  34. package/jwt.js +3 -9
  35. package/jwt.js.map +1 -1
  36. package/keypair.d.ts +5 -5
  37. package/keypair.js +21 -23
  38. package/keypair.js.map +1 -1
  39. package/package.json +9 -29
  40. package/auth/migrations/001-create-accounts-table.js +0 -27
  41. package/auth/migrations/001-create-accounts-table.js.map +0 -1
  42. package/authentication/authentication-base/authentication-base.d.ts +0 -10
  43. package/authentication/authentication-base/authentication-base.js +0 -33
  44. package/authentication/authentication-base/authentication-base.js.map +0 -1
  45. package/authentication/authentication-base/index.d.ts +0 -1
  46. package/authentication/authentication-base/index.js +0 -6
  47. package/authentication/authentication-base/index.js.map +0 -1
  48. package/authentication/authentication-fido2/authentication-fido2-migrations.d.ts +0 -5
  49. package/authentication/authentication-fido2/authentication-fido2-migrations.js +0 -17
  50. package/authentication/authentication-fido2/authentication-fido2-migrations.js.map +0 -1
  51. package/authentication/authentication-fido2/authentication-fido2.d.ts +0 -58
  52. package/authentication/authentication-fido2/authentication-fido2.js +0 -260
  53. package/authentication/authentication-fido2/authentication-fido2.js.map +0 -1
  54. package/authentication/authentication-fido2/index.d.ts +0 -1
  55. package/authentication/authentication-fido2/index.js +0 -6
  56. package/authentication/authentication-fido2/index.js.map +0 -1
  57. package/authentication/authentication-fido2/migrations/create-fido-challenges-table.d.ts +0 -5
  58. package/authentication/authentication-fido2/migrations/create-fido-challenges-table.js +0 -61
  59. package/authentication/authentication-fido2/migrations/create-fido-challenges-table.js.map +0 -1
  60. package/authentication/authentication-fido2/migrations/create-fido-credentials-table.d.ts +0 -5
  61. package/authentication/authentication-fido2/migrations/create-fido-credentials-table.js +0 -68
  62. package/authentication/authentication-fido2/migrations/create-fido-credentials-table.js.map +0 -1
  63. package/authentication/authentication-fido2/migrations/index.d.ts +0 -2
  64. package/authentication/authentication-fido2/migrations/index.js +0 -6
  65. package/authentication/authentication-fido2/migrations/index.js.map +0 -1
  66. package/authentication/authentication-magic-token/authentication-magic-token-migrations.d.ts +0 -5
  67. package/authentication/authentication-magic-token/authentication-magic-token-migrations.js +0 -16
  68. package/authentication/authentication-magic-token/authentication-magic-token-migrations.js.map +0 -1
  69. package/authentication/authentication-magic-token/authentication-magic-token.d.ts +0 -25
  70. package/authentication/authentication-magic-token/authentication-magic-token.js +0 -76
  71. package/authentication/authentication-magic-token/authentication-magic-token.js.map +0 -1
  72. package/authentication/authentication-magic-token/index.d.ts +0 -1
  73. package/authentication/authentication-magic-token/index.js +0 -6
  74. package/authentication/authentication-magic-token/index.js.map +0 -1
  75. package/authentication/authentication-magic-token/magic-token.d.ts +0 -17
  76. package/authentication/authentication-magic-token/magic-token.js +0 -7
  77. package/authentication/authentication-magic-token/magic-token.js.map +0 -1
  78. package/authentication/authentication-magic-token/migrations/001-create-magic-token-table.d.ts +0 -5
  79. package/authentication/authentication-magic-token/migrations/001-create-magic-token-table.js +0 -44
  80. package/authentication/authentication-magic-token/migrations/001-create-magic-token-table.js.map +0 -1
  81. package/authentication/authentication-password/authentication-password-migrations.d.ts +0 -5
  82. package/authentication/authentication-password/authentication-password-migrations.js +0 -16
  83. package/authentication/authentication-password/authentication-password-migrations.js.map +0 -1
  84. package/authentication/authentication-password/authentication-password.d.ts +0 -8
  85. package/authentication/authentication-password/authentication-password.js +0 -28
  86. package/authentication/authentication-password/authentication-password.js.map +0 -1
  87. package/authentication/authentication-password/index.d.ts +0 -1
  88. package/authentication/authentication-password/index.js +0 -6
  89. package/authentication/authentication-password/index.js.map +0 -1
  90. package/authentication/authentication-password/migrations/001-add-password-column.d.ts +0 -5
  91. package/authentication/authentication-password/migrations/001-add-password-column.js +0 -21
  92. package/authentication/authentication-password/migrations/001-add-password-column.js.map +0 -1
  93. package/encrypt.d.ts +0 -6
  94. package/encrypt.js +0 -18
  95. package/encrypt.js.map +0 -1
package/keypair.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyPairGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const crypto = tslib_1.__importStar(require("crypto"));
6
- const fs_1 = require("fs");
6
+ const promises_1 = require("fs/promises");
7
7
  class KeyPairGenerator {
8
8
  algorithm;
9
9
  constructor(options) {
@@ -12,10 +12,18 @@ class KeyPairGenerator {
12
12
  generate() {
13
13
  let type = null;
14
14
  let modulusLength, namedCurve;
15
- if (this.algorithm.startsWith('RS')) {
15
+ if (this.algorithm === 'RS256') {
16
16
  type = 'rsa';
17
17
  modulusLength = 2048;
18
18
  }
19
+ else if (this.algorithm === 'RS384') {
20
+ type = 'rsa';
21
+ modulusLength = 3072;
22
+ }
23
+ else if (this.algorithm === 'RS512') {
24
+ type = 'rsa';
25
+ modulusLength = 4096;
26
+ }
19
27
  else if (this.algorithm === 'ES256') {
20
28
  type = 'ec';
21
29
  namedCurve = 'prime256v1';
@@ -31,17 +39,11 @@ class KeyPairGenerator {
31
39
  if (type === null) {
32
40
  throw new Error('Keypair type could not be inferred');
33
41
  }
34
- const { publicKey, privateKey } = crypto.generateKeyPairSync(type, {
42
+ const { publicKey, privateKey } = crypto.generateKeyPairSync(
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ type, {
35
45
  modulusLength,
36
46
  namedCurve,
37
- publicKeyEncoding: {
38
- type: 'spki',
39
- format: 'pem',
40
- },
41
- privateKeyEncoding: {
42
- type: 'pkcs8',
43
- format: 'pem',
44
- },
45
47
  });
46
48
  return {
47
49
  algorithm: this.algorithm,
@@ -49,24 +51,20 @@ class KeyPairGenerator {
49
51
  privateKey,
50
52
  };
51
53
  }
52
- load(options) {
53
- const publicKey = (0, fs_1.readFileSync)(options.publicKeyPath).toString();
54
- const privateKey = (0, fs_1.readFileSync)(options.privateKeyPath).toString();
54
+ async load(options) {
55
+ const publicKey = (await (0, promises_1.readFile)(options.publicKeyPath)).toString();
56
+ const privateKey = (await (0, promises_1.readFile)(options.privateKeyPath)).toString();
55
57
  return {
56
58
  algorithm: this.algorithm,
57
59
  publicKey: crypto.createPublicKey(publicKey),
58
60
  privateKey: crypto.createPrivateKey(privateKey),
59
61
  };
60
62
  }
61
- save(options) {
62
- const publicKey = options.keys.publicKey instanceof crypto.KeyObject
63
- ? options.keys.publicKey.export().toString()
64
- : options.keys.publicKey;
65
- const privateKey = options.keys.privateKey instanceof crypto.KeyObject
66
- ? options.keys.privateKey.export().toString()
67
- : options.keys.privateKey;
68
- (0, fs_1.writeFileSync)(options.publicKeyPath, publicKey);
69
- (0, fs_1.writeFileSync)(options.privateKeyPath, privateKey);
63
+ async save(options) {
64
+ const publicKey = options.keys.publicKey;
65
+ const privateKey = options.keys.privateKey;
66
+ await (0, promises_1.writeFile)(options.publicKeyPath, publicKey.export({ format: 'pem', type: 'spki' }));
67
+ await (0, promises_1.writeFile)(options.privateKeyPath, privateKey.export({ format: 'pem', type: 'pkcs8' }));
70
68
  }
71
69
  }
72
70
  exports.KeyPairGenerator = KeyPairGenerator;
package/keypair.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"keypair.js","sourceRoot":"","sources":["../../src/keypair.ts"],"names":[],"mappings":";;;;AAAA,uDAAiC;AACjC,2BAAiD;AAgBjD,MAAa,gBAAgB;IACrB,SAAS,CAAmB;IAEnC,YAAmB,OAAwC;QAC1D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,CAAC;IAEM,QAAQ;QACd,IAAI,IAAI,GAAwB,IAAI,CAAC;QACrC,IAAI,aAAa,EAAE,UAAU,CAAC;QAE9B,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrC,IAAI,GAAG,KAAK,CAAC;YACb,aAAa,GAAG,IAAI,CAAC;QACtB,CAAC;aACI,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;YACrC,IAAI,GAAG,IAAI,CAAC;YACZ,UAAU,GAAG,YAAY,CAAC;QAC3B,CAAC;aACI,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;YACrC,IAAI,GAAG,IAAI,CAAC;YACZ,UAAU,GAAG,WAAW,CAAC;QAC1B,CAAC;aACI,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;YACrC,IAAI,GAAG,IAAI,CAAC;YACZ,UAAU,GAAG,WAAW,CAAC;QAC1B,CAAC;QAED,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACvD,CAAC;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C;CACD;AAvFD,4CAuFC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riao/iam",
3
- "version": "2.0.0",
4
- "description": "riao-iam",
3
+ "version": "3.1.0",
4
+ "description": "Identity Access Management for Riao",
5
5
  "typescript-template": {
6
6
  "base": "1.0.1",
7
7
  "jasmine": "1.0.0",
@@ -9,42 +9,22 @@
9
9
  },
10
10
  "scripts": {},
11
11
  "dependencies": {
12
- "@riao/dbal": "^3.7.1",
13
- "@riao/postgres": "^3.5.0",
14
- "@simplewebauthn/server": "^13.2.2",
12
+ "@riao/dbal": "^3.8.0",
15
13
  "bcrypt": "^6.0.0",
16
- "jsonwebtoken": "^9.0.2",
14
+ "jsonwebtoken": "^9.0.3",
17
15
  "ms": "^2.1.3"
18
16
  },
19
17
  "repository": {
20
18
  "type": "git",
21
- "url": "git+https://github.com/riao-project/riao-iam.git"
19
+ "url": "git+https://github.com/riao-iam/riao-iam.git"
22
20
  },
23
- "author": "riao-project",
21
+ "author": "riao-iam",
24
22
  "license": "MIT",
25
23
  "bugs": {
26
- "url": "https://github.com/riao-project/riao-iam/issues"
24
+ "url": "https://github.com/riao-iam/riao-iam/issues"
27
25
  },
28
- "homepage": "https://github.com/riao-project/riao-iam#readme",
29
- "keywords": [
30
- "iam",
31
- "authentication",
32
- "authorization",
33
- "riao",
34
- "riao-project",
35
- "typescript",
36
- "password",
37
- "magic-link",
38
- "webauthn",
39
- "oauth2",
40
- "fido2",
41
- "jwt",
42
- "openid-connect",
43
- "acl",
44
- "rbac",
45
- "abac",
46
- "rebac"
47
- ],
26
+ "homepage": "https://github.com/riao-iam/riao-iam#readme",
27
+ "keywords": [],
48
28
  "main": "index.js",
49
29
  "types": "index.d.ts"
50
30
  }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateAccountsTableMigration = void 0;
4
- const column_pack_1 = require("@riao/dbal/column-pack");
5
- const dbal_1 = require("@riao/dbal");
6
- class CreateAccountsTableMigration extends dbal_1.Migration {
7
- async up() {
8
- await this.ddl.createTable({
9
- name: 'iam_accounts',
10
- columns: [
11
- column_pack_1.UUIDKeyColumn,
12
- {
13
- ...column_pack_1.UsernameColumn,
14
- name: 'login',
15
- },
16
- column_pack_1.CreateTimestampColumn,
17
- ],
18
- });
19
- }
20
- async down() {
21
- await this.ddl.dropTable({
22
- tables: ['iam_accounts'],
23
- });
24
- }
25
- }
26
- exports.CreateAccountsTableMigration = CreateAccountsTableMigration;
27
- //# sourceMappingURL=001-create-accounts-table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"001-create-accounts-table.js","sourceRoot":"","sources":["../../../../src/auth/migrations/001-create-accounts-table.ts"],"names":[],"mappings":";;;AAAA,wDAIgC;AAChC,qCAAuC;AAEvC,MAAa,4BAA6B,SAAQ,gBAAS;IACjD,KAAK,CAAC,EAAE;QAChB,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC;YAC1B,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACR,2BAAa;gBACb;oBACC,GAAG,4BAAc;oBACjB,IAAI,EAAE,OAAO;iBACb;gBACD,mCAAqB;aACrB;SACD,CAAC,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,IAAI;QAClB,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YACxB,MAAM,EAAE,CAAC,cAAc,CAAC;SACxB,CAAC,CAAC;IACJ,CAAC;CACD;AApBD,oEAoBC"}
@@ -1,10 +0,0 @@
1
- import { DatabaseRecord, DatabaseRecordId, Expression, SelectQuery } from '@riao/dbal';
2
- import { Auth } from '../../auth/auth';
3
- import { Hash } from '../../hash';
4
- export declare abstract class AuthenticationBase<TAccount extends DatabaseRecord> extends Auth<TAccount> {
5
- protected hash: Hash;
6
- createAccount(account: TAccount): Promise<DatabaseRecordId>;
7
- abstract authenticate(credentials: any): Promise<TAccount | null>;
8
- findActiveAccount(query: SelectQuery<TAccount>): Promise<TAccount | null>;
9
- protected isActiveQuery(): undefined | Expression<TAccount>;
10
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthenticationBase = void 0;
4
- const dbal_1 = require("@riao/dbal");
5
- const auth_1 = require("../../auth/auth");
6
- const hash_1 = require("../../hash");
7
- class AuthenticationBase extends auth_1.Auth {
8
- hash = new hash_1.Hash();
9
- async createAccount(account) {
10
- const inserted = await this.accountRepo.insertOne({
11
- record: account,
12
- });
13
- return inserted[this.accountIdColumn];
14
- }
15
- async findActiveAccount(query) {
16
- const isActiveQuery = this.isActiveQuery();
17
- if (query.where && isActiveQuery !== undefined) {
18
- query.where = [isActiveQuery, dbal_1.and, query.where];
19
- }
20
- else if (isActiveQuery !== undefined) {
21
- query.where = isActiveQuery;
22
- }
23
- const account = await this.accountRepo.findOne({
24
- ...query,
25
- });
26
- return account;
27
- }
28
- isActiveQuery() {
29
- return undefined;
30
- }
31
- }
32
- exports.AuthenticationBase = AuthenticationBase;
33
- //# sourceMappingURL=authentication-base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-base.js","sourceRoot":"","sources":["../../../../src/authentication/authentication-base/authentication-base.ts"],"names":[],"mappings":";;;AAAA,qCAMoB;AACpB,0CAAuC;AACvC,qCAAkC;AAElC,MAAsB,kBAEpB,SAAQ,WAAc;IACb,IAAI,GAAS,IAAI,WAAI,EAAE,CAAC;IAE3B,KAAK,CAAC,aAAa,CAAC,OAAiB;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;YACjD,MAAM,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAqB,CAAC;IAC3D,CAAC;IAIM,KAAK,CAAC,iBAAiB,CAC7B,KAA4B;QAE5B,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAE3C,IAAI,KAAK,CAAC,KAAK,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChD,KAAK,CAAC,KAAK,GAAG,CAAC,aAAa,EAAE,UAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;aACI,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YACtC,KAAK,CAAC,KAAK,GAAG,aAAa,CAAC;QAC7B,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC9C,GAAG,KAAK;SACR,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IAChB,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AArCD,gDAqCC"}
@@ -1 +0,0 @@
1
- export { AuthenticationBase } from './authentication-base';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthenticationBase = void 0;
4
- var authentication_base_1 = require("./authentication-base");
5
- Object.defineProperty(exports, "AuthenticationBase", { enumerable: true, get: function () { return authentication_base_1.AuthenticationBase; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/authentication/authentication-base/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA"}
@@ -1,5 +0,0 @@
1
- import { Migration } from '@riao/dbal';
2
- import { AuthMigrations } from '../../auth/auth-migrations';
3
- export declare class AuthenticationFido2Migrations extends AuthMigrations {
4
- getMigrations(): Record<string, typeof Migration<any>>;
5
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthenticationFido2Migrations = void 0;
4
- const auth_migrations_1 = require("../../auth/auth-migrations");
5
- const migrations_1 = require("./migrations");
6
- class AuthenticationFido2Migrations extends auth_migrations_1.AuthMigrations {
7
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- getMigrations() {
9
- return {
10
- ...super.getMigrations(),
11
- 'create-fido2-credentials-table': migrations_1.CreateFido2CredentialsTableMigration,
12
- 'create-fido2-challenges-table': migrations_1.CreateFido2ChallengesTableMigration,
13
- };
14
- }
15
- }
16
- exports.AuthenticationFido2Migrations = AuthenticationFido2Migrations;
17
- //# sourceMappingURL=authentication-fido2-migrations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-fido2-migrations.js","sourceRoot":"","sources":["../../../../src/authentication/authentication-fido2/authentication-fido2-migrations.ts"],"names":[],"mappings":";;;AACA,gEAA4D;AAE5D,6CAGsB;AAEtB,MAAa,6BAA8B,SAAQ,gCAAc;IAChE,8DAA8D;IAC9C,aAAa;QAC5B,OAAO;YACN,GAAG,KAAK,CAAC,aAAa,EAAE;YACxB,gCAAgC,EAC/B,iDAAoC;YACrC,+BAA+B,EAC9B,gDAAmC;SACpC,CAAC;IACH,CAAC;CACD;AAXD,sEAWC"}
@@ -1,58 +0,0 @@
1
- import { DatabaseRecordId, QueryRepository } from '@riao/dbal';
2
- import { Account } from '../../../test/account';
3
- import { AuthenticationBase } from '../authentication-base';
4
- import { Database } from '@riao/dbal';
5
- import { type RegistrationResponseJSON, type AuthenticationResponseJSON, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type AuthenticatorTransportFuture } from '@simplewebauthn/server';
6
- import { AuthOptions } from '../../auth/auth';
7
- export interface StoredChallenge {
8
- id: string;
9
- account_id: DatabaseRecordId;
10
- challenge_type: 'registration' | 'authentication';
11
- expires: Date;
12
- used: boolean;
13
- created_at?: Date;
14
- }
15
- export interface AuthenticatorCredential {
16
- id: string;
17
- account_id: DatabaseRecordId;
18
- public_key: string;
19
- counter: number;
20
- transports?: string;
21
- device_name?: string;
22
- created_at?: Date;
23
- updated_at?: Date;
24
- }
25
- export interface Fido2Credentials {
26
- response: AuthenticationResponseJSON;
27
- accountId: DatabaseRecordId;
28
- }
29
- export interface Fido2AuthenticationOptions<TAccount extends Account = Account> extends AuthOptions<TAccount> {
30
- db: Database;
31
- rpName: string;
32
- rpID: string;
33
- origin: string;
34
- }
35
- export declare class Fido2Authentication<TAccount extends Account> extends AuthenticationBase<TAccount> {
36
- protected readonly rpName: string;
37
- protected readonly rpID: string;
38
- protected readonly origin: string;
39
- protected challengeTable: string;
40
- protected credentialTable: string;
41
- protected challengeRepo: QueryRepository<StoredChallenge>;
42
- protected credentialRepo: QueryRepository<AuthenticatorCredential>;
43
- constructor(options: Fido2AuthenticationOptions<TAccount>);
44
- generateRegistrationOptions(account: TAccount): Promise<PublicKeyCredentialCreationOptionsJSON>;
45
- verifyRegistration(account: TAccount, response: RegistrationResponseJSON): Promise<{
46
- verified: boolean;
47
- registrationInfo?: object;
48
- }>;
49
- generateAuthenticationOptions(userID?: string): Promise<PublicKeyCredentialRequestOptionsJSON>;
50
- createAccount(account: TAccount): Promise<DatabaseRecordId>;
51
- authenticate(credentials: Fido2Credentials): Promise<TAccount | null>;
52
- protected getExistingCredentials(accountId: string): Promise<{
53
- id: string;
54
- type: 'public-key';
55
- transports?: AuthenticatorTransportFuture[];
56
- }[]>;
57
- protected getAuthenticatorByCredentialID(credentialID: string): Promise<AuthenticatorCredential | null>;
58
- }
@@ -1,260 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fido2Authentication = void 0;
4
- const authentication_base_1 = require("../authentication-base");
5
- const server_1 = require("@simplewebauthn/server");
6
- class Fido2Authentication extends authentication_base_1.AuthenticationBase {
7
- rpName;
8
- rpID;
9
- origin;
10
- challengeTable = 'iam_fido2_challenges';
11
- credentialTable = 'iam_fido2_credentials';
12
- challengeRepo;
13
- credentialRepo;
14
- constructor(options) {
15
- super(options);
16
- this.rpName = options.rpName;
17
- this.rpID = options.rpID;
18
- this.origin = options.origin;
19
- this.challengeRepo = options.db.getQueryRepository({
20
- table: this.challengeTable,
21
- });
22
- this.credentialRepo =
23
- options.db.getQueryRepository({
24
- table: this.credentialTable,
25
- });
26
- }
27
- async generateRegistrationOptions(account) {
28
- if (!account[this.accountIdColumn]) {
29
- throw new Error('Account must have an ID');
30
- }
31
- const accountId = account[this.accountIdColumn].toString();
32
- const login = account[this.loginColumn] || accountId;
33
- // TODO: Display name?
34
- const accountName = account[this.loginColumn] || accountId;
35
- const options = {
36
- rpName: this.rpName,
37
- rpID: this.rpID,
38
- userID: new Uint8Array(Buffer.from(accountId, 'utf8')),
39
- userName: login,
40
- userDisplayName: accountName,
41
- attestationType: 'none',
42
- authenticatorSelection: {
43
- // Allow both platform and cross-platform authenticators
44
- userVerification: 'preferred',
45
- requireResidentKey: false,
46
- },
47
- excludeCredentials: await this.getExistingCredentials(accountId),
48
- };
49
- const registrationOptions = await (0, server_1.generateRegistrationOptions)(options);
50
- const expiresAt = new Date(Date.now() + 5 * 60 * 1000); // 5 minutes
51
- await this.challengeRepo.insert({
52
- records: [
53
- {
54
- id: registrationOptions.challenge,
55
- account_id: account[this.accountIdColumn],
56
- challenge_type: 'registration',
57
- expires: expiresAt,
58
- used: false,
59
- },
60
- ],
61
- });
62
- return registrationOptions;
63
- }
64
- async verifyRegistration(account, response) {
65
- if (!account[this.accountIdColumn]) {
66
- throw new Error('Account must have an ID');
67
- }
68
- // Find the challenge from database
69
- const challengesRaw = await this.challengeRepo.find({
70
- where: {
71
- account_id: account[this.accountIdColumn],
72
- challenge_type: 'registration',
73
- used: false,
74
- },
75
- limit: 1,
76
- });
77
- if (challengesRaw.length === 0) {
78
- return { verified: false };
79
- }
80
- const storedChallenge = challengesRaw[0];
81
- const opts = {
82
- response,
83
- expectedChallenge: storedChallenge.id,
84
- expectedOrigin: this.origin,
85
- expectedRPID: this.rpID,
86
- };
87
- try {
88
- const verification = await (0, server_1.verifyRegistrationResponse)(opts);
89
- if (verification.verified && verification.registrationInfo) {
90
- // Store the credential in database
91
- const { credential } = verification.registrationInfo;
92
- // Extract transports from the original response
93
- let transports = [];
94
- if (response.response.transports) {
95
- transports = response.response.transports;
96
- }
97
- else {
98
- // Default to common transports if not specified
99
- transports = ['internal', 'hybrid'];
100
- }
101
- await this.credentialRepo.insert({
102
- records: [
103
- {
104
- // Use the original credential ID from the response
105
- id: response.id,
106
- account_id: account[this.accountIdColumn],
107
- public_key: Buffer.from(credential.publicKey).toString('base64'),
108
- counter: credential.counter,
109
- transports: JSON.stringify(transports),
110
- },
111
- ],
112
- });
113
- // Mark challenge as used
114
- await this.challengeRepo.update({
115
- set: { used: true },
116
- where: { id: storedChallenge.id },
117
- });
118
- return {
119
- verified: true,
120
- registrationInfo: verification.registrationInfo,
121
- };
122
- }
123
- return { verified: false };
124
- }
125
- catch (error) {
126
- return { verified: false };
127
- }
128
- }
129
- async generateAuthenticationOptions(userID) {
130
- const options = {
131
- rpID: this.rpID,
132
- // Use preferred to allow both platform and cross-platform
133
- userVerification: 'preferred',
134
- };
135
- if (userID) {
136
- options.allowCredentials =
137
- await this.getExistingCredentials(userID);
138
- }
139
- const authenticationOptions = await (0, server_1.generateAuthenticationOptions)(options);
140
- // Store challenge for verification
141
- if (userID) {
142
- const expiresAt = new Date(Date.now() + 5 * 60 * 1000); // 5 minutes
143
- await this.challengeRepo.insert({
144
- records: [
145
- {
146
- id: authenticationOptions.challenge,
147
- account_id: userID,
148
- challenge_type: 'authentication',
149
- expires: expiresAt,
150
- used: false,
151
- },
152
- ],
153
- });
154
- }
155
- return authenticationOptions;
156
- }
157
- async createAccount(account) {
158
- // Store account data first
159
- const accountId = await super.createAccount(account);
160
- // Create a account object with the ID for registration options
161
- const accountWithId = {
162
- ...account,
163
- [this.accountIdColumn]: accountId,
164
- };
165
- // Generate and return registration options for client
166
- // Credential stored when verifyRegistration is called
167
- await this.generateRegistrationOptions(accountWithId);
168
- return accountId;
169
- }
170
- async authenticate(credentials) {
171
- const { response, accountId } = credentials;
172
- // Find the challenge from database
173
- const challengesRaw = await this.challengeRepo.find({
174
- where: {
175
- account_id: accountId,
176
- challenge_type: 'authentication',
177
- used: false,
178
- },
179
- limit: 1,
180
- });
181
- if (challengesRaw.length === 0) {
182
- return null;
183
- }
184
- const storedChallenge = challengesRaw[0];
185
- // Get the authenticator credential
186
- const authenticator = await this.getAuthenticatorByCredentialID(response.id);
187
- if (authenticator === null) {
188
- return null;
189
- }
190
- const opts = {
191
- response,
192
- expectedChallenge: storedChallenge.id,
193
- expectedOrigin: this.origin,
194
- expectedRPID: this.rpID,
195
- credential: {
196
- id: authenticator.id,
197
- publicKey: Buffer.from(authenticator.public_key, 'base64'),
198
- counter: authenticator.counter,
199
- transports: [],
200
- },
201
- };
202
- const verification = await (0, server_1.verifyAuthenticationResponse)(opts);
203
- if (!verification.verified) {
204
- return null;
205
- }
206
- // Update counter in database
207
- await this.credentialRepo.update({
208
- set: {
209
- counter: verification.authenticationInfo.newCounter,
210
- },
211
- where: { id: authenticator.id },
212
- });
213
- // Mark challenge as used
214
- await this.challengeRepo.update({
215
- set: { used: true },
216
- where: { id: storedChallenge.id },
217
- });
218
- // Retrieve and return the account
219
- return await this.findActiveAccount({
220
- where: {
221
- [this.accountIdColumn]: accountId,
222
- },
223
- });
224
- }
225
- async getExistingCredentials(accountId) {
226
- const credentials = await this.credentialRepo.find({
227
- where: { account_id: accountId },
228
- });
229
- return credentials.map((cred) => {
230
- let transports = [];
231
- // Parse transports from stored JSON string
232
- if (cred.transports) {
233
- try {
234
- const parsed = JSON.parse(cred.transports);
235
- transports = Array.isArray(parsed) ? parsed : [];
236
- }
237
- catch (error) {
238
- // Default to internal for platform authenticators
239
- transports = ['internal'];
240
- }
241
- }
242
- else {
243
- // If no transports stored, use common transports
244
- transports = ['internal', 'hybrid'];
245
- }
246
- return {
247
- id: cred.id,
248
- type: 'public-key',
249
- transports,
250
- };
251
- });
252
- }
253
- async getAuthenticatorByCredentialID(credentialID) {
254
- return await this.credentialRepo.findOne({
255
- where: { id: credentialID },
256
- });
257
- }
258
- }
259
- exports.Fido2Authentication = Fido2Authentication;
260
- //# sourceMappingURL=authentication-fido2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-fido2.js","sourceRoot":"","sources":["../../../../src/authentication/authentication-fido2/authentication-fido2.ts"],"names":[],"mappings":";;;AAEA,gEAA4D;AAE5D,mDAcgC;AAoChC,MAAa,mBAEX,SAAQ,wCAA4B;IAClB,MAAM,CAAS;IACf,IAAI,CAAS;IACb,MAAM,CAAS;IAExB,cAAc,GAAG,sBAAsB,CAAC;IACxC,eAAe,GAAG,uBAAuB,CAAC;IAE1C,aAAa,CAAmC;IAChD,cAAc,CAA2C;IAEnE,YAAY,OAA6C;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAkB;YACnE,KAAK,EAAE,IAAI,CAAC,cAAc;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc;YAClB,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAA0B;gBACtD,KAAK,EAAE,IAAI,CAAC,eAAe;aAC3B,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,2BAA2B,CACvC,OAAiB;QAEjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC;QACrD,sBAAsB;QACtB,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC;Q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S,EAAE;SAChC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,UAAU,GAAmC,EAAE,CAAC;YAEpD,2CAA2C;YAC3C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,IAAI,CAAC;oBACJ,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBAC3C,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClD,CAAC;gBACD,OAAO,KAAK,EAAE,CAAC;oBACd,kDAAkD;oBAClD,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC3B,CAAC;YACF,CAAC;iBACI,CAAC;gBACL,iDAAiD;gBACjD,UAAU,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACrC,CAAC;YAED,OAAO;gBACN,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,IAAI,EAAE,YAAqB;gBAC3B,UAAU;aACV,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,8BAA8B,CAC7C,YAAoB;QAEpB,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;SAC3B,CAAC,CAAC;IACJ,CAAC;CACD;AAvUD,kDAuUC"}
@@ -1 +0,0 @@
1
- export { Fido2Authentication } from './authentication-fido2';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fido2Authentication = void 0;
4
- var authentication_fido2_1 = require("./authentication-fido2");
5
- Object.defineProperty(exports, "Fido2Authentication", { enumerable: true, get: function () { return authentication_fido2_1.Fido2Authentication; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/authentication/authentication-fido2/index.ts"],"names":[],"mappings":";;;AAAA,+DAA6D;AAApD,2HAAA,mBAAmB,OAAA"}
@@ -1,5 +0,0 @@
1
- import { Migration } from '@riao/dbal';
2
- export declare class CreateFido2ChallengesTableMigration extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }