@furystack/security 7.0.9 → 8.0.1

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 (90) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +9 -3
  3. package/esm/crypto-password-hasher.d.ts +10 -12
  4. package/esm/crypto-password-hasher.d.ts.map +1 -1
  5. package/esm/crypto-password-hasher.js +43 -36
  6. package/esm/crypto-password-hasher.js.map +1 -1
  7. package/esm/errors/password-complexity-error.d.ts +5 -4
  8. package/esm/errors/password-complexity-error.d.ts.map +1 -1
  9. package/esm/errors/password-complexity-error.js +5 -4
  10. package/esm/errors/password-complexity-error.js.map +1 -1
  11. package/esm/errors/unauthenticated-error.d.ts +3 -1
  12. package/esm/errors/unauthenticated-error.d.ts.map +1 -1
  13. package/esm/errors/unauthenticated-error.js +3 -1
  14. package/esm/errors/unauthenticated-error.js.map +1 -1
  15. package/esm/helpers.d.ts +20 -7
  16. package/esm/helpers.d.ts.map +1 -1
  17. package/esm/helpers.js +27 -13
  18. package/esm/helpers.js.map +1 -1
  19. package/esm/index.d.ts +3 -1
  20. package/esm/index.d.ts.map +1 -1
  21. package/esm/index.js +3 -1
  22. package/esm/index.js.map +1 -1
  23. package/esm/models/password-credential.d.ts +3 -13
  24. package/esm/models/password-credential.d.ts.map +1 -1
  25. package/esm/models/password-credential.js +3 -1
  26. package/esm/models/password-credential.js.map +1 -1
  27. package/esm/models/password-reset-token.d.ts +5 -9
  28. package/esm/models/password-reset-token.d.ts.map +1 -1
  29. package/esm/models/password-reset-token.js +5 -0
  30. package/esm/models/password-reset-token.js.map +1 -1
  31. package/esm/password-authenticator.d.ts +26 -15
  32. package/esm/password-authenticator.d.ts.map +1 -1
  33. package/esm/password-authenticator.js +73 -109
  34. package/esm/password-authenticator.js.map +1 -1
  35. package/esm/password-authenticator.spec.js +122 -212
  36. package/esm/password-authenticator.spec.js.map +1 -1
  37. package/esm/password-complexity-rules/contains-lowercase.d.ts +2 -2
  38. package/esm/password-complexity-rules/contains-lowercase.js +2 -2
  39. package/esm/password-complexity-rules/contains-uppercase.d.ts +2 -2
  40. package/esm/password-complexity-rules/contains-uppercase.js +2 -2
  41. package/esm/password-complexity-rules/max-length.d.ts +1 -4
  42. package/esm/password-complexity-rules/max-length.d.ts.map +1 -1
  43. package/esm/password-complexity-rules/max-length.js +1 -4
  44. package/esm/password-complexity-rules/max-length.js.map +1 -1
  45. package/esm/password-complexity-rules/min-length.d.ts +1 -4
  46. package/esm/password-complexity-rules/min-length.d.ts.map +1 -1
  47. package/esm/password-complexity-rules/min-length.js +1 -4
  48. package/esm/password-complexity-rules/min-length.js.map +1 -1
  49. package/esm/password-credential-store.d.ts +50 -0
  50. package/esm/password-credential-store.d.ts.map +1 -0
  51. package/esm/password-credential-store.js +73 -0
  52. package/esm/password-credential-store.js.map +1 -0
  53. package/esm/password-credential-store.spec.d.ts +2 -0
  54. package/esm/password-credential-store.spec.d.ts.map +1 -0
  55. package/esm/password-credential-store.spec.js +64 -0
  56. package/esm/password-credential-store.spec.js.map +1 -0
  57. package/esm/password-hasher.d.ts +21 -3
  58. package/esm/password-hasher.d.ts.map +1 -1
  59. package/esm/password-hasher.js +1 -19
  60. package/esm/password-hasher.js.map +1 -1
  61. package/esm/security-policy-manager.d.ts +46 -14
  62. package/esm/security-policy-manager.d.ts.map +1 -1
  63. package/esm/security-policy-manager.js +48 -52
  64. package/esm/security-policy-manager.js.map +1 -1
  65. package/esm/security-policy-manager.spec.js +58 -7
  66. package/esm/security-policy-manager.spec.js.map +1 -1
  67. package/esm/security-policy.d.ts +35 -9
  68. package/esm/security-policy.d.ts.map +1 -1
  69. package/esm/security-policy.js +23 -33
  70. package/esm/security-policy.js.map +1 -1
  71. package/package.json +7 -7
  72. package/src/crypto-password-hasher.ts +46 -39
  73. package/src/errors/password-complexity-error.ts +7 -4
  74. package/src/errors/unauthenticated-error.ts +3 -1
  75. package/src/helpers.ts +27 -15
  76. package/src/index.ts +3 -2
  77. package/src/models/password-credential.ts +5 -15
  78. package/src/models/password-reset-token.ts +5 -9
  79. package/src/password-authenticator.spec.ts +134 -254
  80. package/src/password-authenticator.ts +92 -86
  81. package/src/password-complexity-rules/contains-lowercase.ts +2 -2
  82. package/src/password-complexity-rules/contains-uppercase.ts +2 -2
  83. package/src/password-complexity-rules/max-length.ts +1 -4
  84. package/src/password-complexity-rules/min-length.ts +1 -4
  85. package/src/password-credential-store.spec.ts +77 -0
  86. package/src/password-credential-store.ts +79 -0
  87. package/src/password-hasher.ts +21 -9
  88. package/src/security-policy-manager.spec.ts +63 -7
  89. package/src/security-policy-manager.ts +91 -42
  90. package/src/security-policy.ts +50 -18
@@ -1,6 +1,5 @@
1
- import { addStore, InMemoryStore, StoreManager, User } from '@furystack/core';
2
- import { Injector } from '@furystack/inject';
3
- import { getRepository } from '@furystack/repository';
1
+ import { InMemoryStore } from '@furystack/core';
2
+ import { createInjector } from '@furystack/inject';
4
3
  import { usingAsync } from '@furystack/utils';
5
4
  import { randomBytes } from 'crypto';
6
5
  import { describe, expect, it, vi } from 'vitest';
@@ -10,285 +9,196 @@ import { usePasswordPolicy } from './helpers.js';
10
9
  import { PasswordCredential } from './models/password-credential.js';
11
10
  import { PasswordResetToken } from './models/password-reset-token.js';
12
11
  import { PasswordAuthenticator } from './password-authenticator.js';
12
+ import { PasswordCredentialStore, PasswordResetTokenStore } from './password-credential-store.js';
13
13
  import { createMinLengthComplexityRule } from './password-complexity-rules/min-length.js';
14
14
  import { SecurityPolicyManager } from './security-policy-manager.js';
15
15
  const randomString = () => randomBytes(32).toString('hex');
16
- const setupSecurityStores = (i) => {
17
- addStore(i, new InMemoryStore({ model: PasswordCredential, primaryKey: 'userName' }))
18
- .addStore(new InMemoryStore({ model: User, primaryKey: 'username' }))
19
- .addStore(new InMemoryStore({ model: PasswordResetToken, primaryKey: 'token' }));
20
- getRepository(i).createDataSet(PasswordCredential, 'userName');
21
- getRepository(i).createDataSet(PasswordResetToken, 'token');
16
+ /**
17
+ * Binds a fresh in-memory implementation of the two credential stores. The
18
+ * production default factories throw on purpose; tests opt in to memory
19
+ * persistence explicitly per injector.
20
+ */
21
+ const useInMemorySecurityStores = (i) => {
22
+ i.bind(PasswordCredentialStore, () => new InMemoryStore({ model: PasswordCredential, primaryKey: 'userName' }));
23
+ i.bind(PasswordResetTokenStore, () => new InMemoryStore({ model: PasswordResetToken, primaryKey: 'token' }));
22
24
  };
23
25
  describe('PasswordAuthenticator', () => {
24
- it('Should be instantiated', async () => {
25
- await usingAsync(new Injector(), async (i) => {
26
- setupSecurityStores(i);
26
+ it('resolves to a configured authenticator when stores and policy are set up', async () => {
27
+ await usingAsync(createInjector(), async (i) => {
28
+ useInMemorySecurityStores(i);
27
29
  usePasswordPolicy(i);
28
- const auth = i.getInstance(PasswordAuthenticator);
29
- expect(auth).toBeInstanceOf(PasswordAuthenticator);
30
+ const auth = i.get(PasswordAuthenticator);
31
+ expect(auth.policyManager).toBeDefined();
32
+ expect(auth.hasher).toBeDefined();
30
33
  });
31
34
  });
32
- it('Should inherit policy from the extension method', async () => {
33
- await usingAsync(new Injector(), async (i) => {
34
- setupSecurityStores(i);
35
- usePasswordPolicy(i, {
36
- passwordComplexityRules: [createMinLengthComplexityRule(3)],
37
- });
38
- const auth = i.getInstance(PasswordAuthenticator);
39
- expect(auth).toBeInstanceOf(PasswordAuthenticator);
35
+ it('picks up complexity rules supplied via usePasswordPolicy', async () => {
36
+ await usingAsync(createInjector(), async (i) => {
37
+ useInMemorySecurityStores(i);
38
+ usePasswordPolicy(i, { passwordComplexityRules: [createMinLengthComplexityRule(3)] });
39
+ const auth = i.get(PasswordAuthenticator);
40
40
  expect(auth.policyManager.policy.passwordComplexityRules[0].name).toBe('minLength');
41
41
  });
42
42
  });
43
43
  describe('checkPasswordForUser', () => {
44
- it('Should return a truthy value for valid username and password', async () => {
45
- await usingAsync(new Injector(), async (i) => {
44
+ it('returns isValid=true for a valid username and password combination', async () => {
45
+ await usingAsync(createInjector(), async (i) => {
46
46
  const userName = randomString();
47
47
  const password = randomString();
48
- setupSecurityStores(i);
49
- usePasswordPolicy(i, {});
50
- const authenticator = i.getInstance(PasswordAuthenticator);
51
- const { hasher } = authenticator;
52
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
53
- const entry = await hasher.createCredential(userName, password);
54
- await passwordStore.add(entry);
55
- const successResult = await authenticator.checkPasswordForUser(userName, password);
56
- expect(successResult.isValid).toBeTruthy();
48
+ useInMemorySecurityStores(i);
49
+ usePasswordPolicy(i);
50
+ const authenticator = i.get(PasswordAuthenticator);
51
+ const credential = await authenticator.hasher.createCredential(userName, password);
52
+ await i.get(PasswordCredentialStore).add(credential);
53
+ expect((await authenticator.checkPasswordForUser(userName, password)).isValid).toBe(true);
57
54
  });
58
55
  });
59
- it('Should return a falsy value for invalid username', async () => {
60
- await usingAsync(new Injector(), async (i) => {
61
- const userName = randomString();
62
- const password = randomString();
63
- setupSecurityStores(i);
56
+ it('returns badUsernameOrPassword for an unknown username', async () => {
57
+ await usingAsync(createInjector(), async (i) => {
58
+ useInMemorySecurityStores(i);
64
59
  usePasswordPolicy(i);
65
- const authenticator = i.getInstance(PasswordAuthenticator);
66
- const { hasher } = authenticator;
67
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
68
- const entry = await hasher.createCredential(userName, password);
69
- await passwordStore.add(entry);
70
- const failResult = await authenticator.checkPasswordForUser('invalidUsername', password);
71
- expect(failResult.isValid).toBeFalsy();
72
- expect(failResult.reason).toBe('badUsernameOrPassword');
60
+ const authenticator = i.get(PasswordAuthenticator);
61
+ const credential = await authenticator.hasher.createCredential('someone', 'pw');
62
+ await i.get(PasswordCredentialStore).add(credential);
63
+ const failure = (await authenticator.checkPasswordForUser('nobody', 'pw'));
64
+ expect(failure.isValid).toBe(false);
65
+ expect(failure.reason).toBe('badUsernameOrPassword');
73
66
  });
74
67
  });
75
- it('Should return a falsy value for invalid password', async () => {
76
- await usingAsync(new Injector(), async (i) => {
68
+ it('returns badUsernameOrPassword for the wrong password', async () => {
69
+ await usingAsync(createInjector(), async (i) => {
77
70
  const userName = randomString();
78
- const password = randomString();
79
- setupSecurityStores(i);
71
+ useInMemorySecurityStores(i);
80
72
  usePasswordPolicy(i);
81
- const authenticator = i.getInstance(PasswordAuthenticator);
82
- const { hasher } = authenticator;
83
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
84
- const entry = await hasher.createCredential(userName, password);
85
- await passwordStore.add(entry);
86
- const failResult = await authenticator.checkPasswordForUser(userName, 'someInvalidPassword');
87
- expect(failResult.isValid).toBeFalsy();
88
- expect(failResult.reason).toBe('badUsernameOrPassword');
73
+ const authenticator = i.get(PasswordAuthenticator);
74
+ const credential = await authenticator.hasher.createCredential(userName, 'right');
75
+ await i.get(PasswordCredentialStore).add(credential);
76
+ const failure = (await authenticator.checkPasswordForUser(userName, 'wrong'));
77
+ expect(failure.isValid).toBe(false);
78
+ expect(failure.reason).toBe('badUsernameOrPassword');
89
79
  });
90
80
  });
91
- it('Should return a falsy value for an expired password', async () => {
92
- await usingAsync(new Injector(), async (i) => {
81
+ it('returns passwordExpired for a credential older than the configured expiration window', async () => {
82
+ await usingAsync(createInjector(), async (i) => {
93
83
  const userName = randomString();
94
84
  const password = randomString();
95
- setupSecurityStores(i);
85
+ useInMemorySecurityStores(i);
96
86
  usePasswordPolicy(i, { passwordExpirationDays: 1 });
97
- const authenticator = i.getInstance(PasswordAuthenticator);
98
- const { hasher } = authenticator;
99
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
100
- const entry = await hasher.createCredential(userName, password);
101
- const creationDate = new Date();
102
- creationDate.setDate(creationDate.getDate() - 2);
103
- entry.creationDate = creationDate.toISOString();
104
- await passwordStore.add(entry);
105
- const failResult = await authenticator.checkPasswordForUser(userName, password);
106
- expect(failResult.isValid).toBeFalsy();
107
- expect(failResult.reason).toBe('passwordExpired');
87
+ const authenticator = i.get(PasswordAuthenticator);
88
+ const credential = await authenticator.hasher.createCredential(userName, password);
89
+ const olderCreationDate = new Date();
90
+ olderCreationDate.setDate(olderCreationDate.getDate() - 2);
91
+ credential.creationDate = olderCreationDate.toISOString();
92
+ await i.get(PasswordCredentialStore).add(credential);
93
+ const failure = (await authenticator.checkPasswordForUser(userName, password));
94
+ expect(failure.isValid).toBe(false);
95
+ expect(failure.reason).toBe('passwordExpired');
108
96
  });
109
97
  });
110
98
  });
111
99
  describe('setPasswordForUser', () => {
112
- it('Should be able to set the password for the user using the last password', async () => {
113
- await usingAsync(new Injector(), async (i) => {
100
+ it('rotates the credential and keeps only the latest entry', async () => {
101
+ await usingAsync(createInjector(), async (i) => {
114
102
  const userName = randomString();
115
103
  const lastPassword = randomString();
116
104
  const password = randomString();
117
- setupSecurityStores(i);
105
+ useInMemorySecurityStores(i);
118
106
  usePasswordPolicy(i);
119
- const authenticator = i.getInstance(PasswordAuthenticator);
120
- const { hasher } = authenticator;
121
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
122
- const policyManager = i.getInstance(SecurityPolicyManager);
123
- const pmSpy = vi.spyOn(policyManager, 'matchPasswordComplexityRules');
124
- const entry = await hasher.createCredential(userName, lastPassword);
125
- await passwordStore.add(entry);
107
+ const authenticator = i.get(PasswordAuthenticator);
108
+ const store = i.get(PasswordCredentialStore);
109
+ const complexitySpy = vi.spyOn(i.get(SecurityPolicyManager), 'matchPasswordComplexityRules');
110
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
111
+ await store.add(credential);
126
112
  await authenticator.setPasswordForUser(userName, lastPassword, password);
127
- expect(pmSpy).toBeCalled();
128
- const entryCount = await passwordStore.count({ userName: { $eq: userName } });
129
- expect(entryCount).toBe(1); // old entry should be removed
130
- const successResult = await authenticator.checkPasswordForUser(userName, password);
131
- expect(successResult.isValid).toBeTruthy();
132
- // Password updated, cannot use the last password
133
- const failResult = await authenticator.checkPasswordForUser(userName, lastPassword);
134
- expect(failResult.isValid).toBeFalsy();
135
- expect(failResult.reason).toBe('badUsernameOrPassword');
113
+ expect(complexitySpy).toHaveBeenCalled();
114
+ expect(await store.count({ userName: { $eq: userName } })).toBe(1);
115
+ expect((await authenticator.checkPasswordForUser(userName, password)).isValid).toBe(true);
116
+ expect((await authenticator.checkPasswordForUser(userName, lastPassword)).reason).toBe('badUsernameOrPassword');
136
117
  });
137
118
  });
138
- it('Should throw PasswordComplexityError if the complexity rules are not respected', async () => {
139
- await usingAsync(new Injector(), async (i) => {
119
+ it('throws PasswordComplexityError when the new password fails a complexity rule', async () => {
120
+ await usingAsync(createInjector(), async (i) => {
140
121
  const userName = randomString();
141
122
  const lastPassword = randomString();
142
- const password = '';
143
- setupSecurityStores(i);
123
+ useInMemorySecurityStores(i);
144
124
  usePasswordPolicy(i, { passwordComplexityRules: [createMinLengthComplexityRule(3)] });
145
- const authenticator = i.getInstance(PasswordAuthenticator);
146
- const { hasher } = authenticator;
147
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
148
- const policyManager = i.getInstance(SecurityPolicyManager);
149
- const pmSpy = vi.spyOn(policyManager, 'matchPasswordComplexityRules');
150
- const entry = await hasher.createCredential(userName, lastPassword);
151
- await passwordStore.add(entry);
152
- await expect(authenticator.setPasswordForUser(userName, lastPassword, password)).rejects.toThrowError(PasswordComplexityError);
153
- expect(pmSpy).toBeCalled();
154
- const entryCount = await passwordStore.count({ userName: { $eq: userName } });
155
- expect(entryCount).toBe(1); // old entry should be removed
156
- const failResult = await authenticator.checkPasswordForUser(userName, password);
157
- // Password NOT updated, can use the last password
158
- expect(failResult.isValid).toBeFalsy();
159
- expect(failResult.reason).toBe('badUsernameOrPassword');
160
- // Password NOT updated, cannot use the new password
161
- const successResult = await authenticator.checkPasswordForUser(userName, lastPassword);
162
- expect(successResult.isValid).toBeTruthy();
125
+ const authenticator = i.get(PasswordAuthenticator);
126
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
127
+ await i.get(PasswordCredentialStore).add(credential);
128
+ await expect(authenticator.setPasswordForUser(userName, lastPassword, '')).rejects.toBeInstanceOf(PasswordComplexityError);
129
+ expect((await authenticator.checkPasswordForUser(userName, lastPassword)).isValid).toBe(true);
163
130
  });
164
131
  });
165
- it('Should throw UnauthenticatedError if the last password is not valid', async () => {
166
- await usingAsync(new Injector(), async (i) => {
132
+ it('throws UnauthenticatedError when the previous password does not verify', async () => {
133
+ await usingAsync(createInjector(), async (i) => {
167
134
  const userName = randomString();
168
135
  const lastPassword = randomString();
169
- const password = randomString();
170
- setupSecurityStores(i);
136
+ useInMemorySecurityStores(i);
171
137
  usePasswordPolicy(i);
172
- const authenticator = i.getInstance(PasswordAuthenticator);
173
- const { hasher } = authenticator;
174
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
175
- const policyManager = i.getInstance(SecurityPolicyManager);
176
- const pmSpy = vi.spyOn(policyManager, 'matchPasswordComplexityRules');
177
- const entry = await hasher.createCredential(userName, lastPassword);
178
- await passwordStore.add(entry);
179
- await expect(authenticator.setPasswordForUser(userName, 'someBadLastPassword', password)).rejects.toThrowError(UnauthenticatedError);
180
- expect(pmSpy).toBeCalled();
181
- const entryCount = await passwordStore.count({ userName: { $eq: userName } });
182
- expect(entryCount).toBe(1); // old entry should be removed
183
- const failResult = await authenticator.checkPasswordForUser(userName, password);
184
- // Password NOT updated, can use the last password
185
- expect(failResult.isValid).toBeFalsy();
186
- expect(failResult.reason).toBe('badUsernameOrPassword');
187
- // Password NOT updated, cannot use the new password
188
- const successResult = await authenticator.checkPasswordForUser(userName, lastPassword);
189
- expect(successResult.isValid).toBeTruthy();
138
+ const authenticator = i.get(PasswordAuthenticator);
139
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
140
+ await i.get(PasswordCredentialStore).add(credential);
141
+ await expect(authenticator.setPasswordForUser(userName, 'wrong', randomString())).rejects.toBeInstanceOf(UnauthenticatedError);
142
+ expect((await authenticator.checkPasswordForUser(userName, lastPassword)).isValid).toBe(true);
190
143
  });
191
144
  });
192
145
  });
193
146
  describe('resetPasswordForUser', () => {
194
- it('Should reset the password with the valid token', async () => {
195
- await usingAsync(new Injector(), async (i) => {
147
+ it('rotates the credential when the token is valid', async () => {
148
+ await usingAsync(createInjector(), async (i) => {
196
149
  const userName = randomString();
197
150
  const lastPassword = randomString();
198
151
  const password = randomString();
199
152
  const token = randomString();
200
- setupSecurityStores(i);
153
+ useInMemorySecurityStores(i);
201
154
  usePasswordPolicy(i);
202
- const authenticator = i.getInstance(PasswordAuthenticator);
203
- const { hasher } = authenticator;
204
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
205
- const resetTokenStore = i.getInstance(StoreManager).getStoreFor(PasswordResetToken, 'token');
206
- const entry = await hasher.createCredential(userName, lastPassword);
207
- await passwordStore.add(entry);
208
- await resetTokenStore.add({ userName, createdAt: new Date().toISOString(), token });
155
+ const authenticator = i.get(PasswordAuthenticator);
156
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
157
+ await i.get(PasswordCredentialStore).add(credential);
158
+ await i.get(PasswordResetTokenStore).add({ userName, createdAt: new Date().toISOString(), token });
209
159
  await authenticator.resetPasswordForUser(token, password);
210
- const successResult = await authenticator.checkPasswordForUser(userName, password);
211
- expect(successResult.isValid).toBeTruthy();
212
- // Password updated, cannot use the last password
213
- const failResult = await authenticator.checkPasswordForUser(userName, lastPassword);
214
- expect(failResult.isValid).toBeFalsy();
215
- expect(failResult.reason).toBe('badUsernameOrPassword');
160
+ expect((await authenticator.checkPasswordForUser(userName, password)).isValid).toBe(true);
161
+ expect((await authenticator.checkPasswordForUser(userName, lastPassword)).reason).toBe('badUsernameOrPassword');
216
162
  });
217
163
  });
218
- it('Should throw PasswordComplexityError if the complexity rules are not respected', async () => {
219
- await usingAsync(new Injector(), async (i) => {
164
+ it('throws PasswordComplexityError and preserves the stored credential on complexity failure', async () => {
165
+ await usingAsync(createInjector(), async (i) => {
220
166
  const userName = randomString();
221
167
  const lastPassword = randomString();
222
- const password = '';
223
168
  const token = randomString();
224
- setupSecurityStores(i);
169
+ useInMemorySecurityStores(i);
225
170
  usePasswordPolicy(i, { passwordComplexityRules: [createMinLengthComplexityRule(3)] });
226
- const authenticator = i.getInstance(PasswordAuthenticator);
227
- const { hasher } = authenticator;
228
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
229
- const resetTokenStore = i.getInstance(StoreManager).getStoreFor(PasswordResetToken, 'token');
230
- const entry = await hasher.createCredential(userName, lastPassword);
231
- await passwordStore.add(entry);
232
- await resetTokenStore.add({ userName, createdAt: new Date().toISOString(), token });
233
- await expect(authenticator.resetPasswordForUser(token, password)).rejects.toThrowError(PasswordComplexityError);
234
- const successResult = await authenticator.checkPasswordForUser(userName, lastPassword);
235
- expect(successResult.isValid).toBeTruthy();
236
- // Password updated, cannot use the last password
237
- const failResult = await authenticator.checkPasswordForUser(userName, password);
238
- expect(failResult.isValid).toBeFalsy();
239
- expect(failResult.reason).toBe('badUsernameOrPassword');
171
+ const authenticator = i.get(PasswordAuthenticator);
172
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
173
+ await i.get(PasswordCredentialStore).add(credential);
174
+ await i.get(PasswordResetTokenStore).add({ userName, createdAt: new Date().toISOString(), token });
175
+ await expect(authenticator.resetPasswordForUser(token, '')).rejects.toBeInstanceOf(PasswordComplexityError);
176
+ expect((await authenticator.checkPasswordForUser(userName, lastPassword)).isValid).toBe(true);
240
177
  });
241
178
  });
242
- it('Should throw UnauthenticatedError if the token is not valid', async () => {
243
- await usingAsync(new Injector(), async (i) => {
244
- const userName = randomString();
245
- const lastPassword = randomString();
246
- const password = '';
247
- const token = randomString();
248
- setupSecurityStores(i);
179
+ it('throws UnauthenticatedError when the token does not exist', async () => {
180
+ await usingAsync(createInjector(), async (i) => {
181
+ useInMemorySecurityStores(i);
249
182
  usePasswordPolicy(i);
250
- const authenticator = i.getInstance(PasswordAuthenticator);
251
- const { hasher } = authenticator;
252
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
253
- const resetTokenStore = i.getInstance(StoreManager).getStoreFor(PasswordResetToken, 'token');
254
- const entry = await hasher.createCredential(userName, lastPassword);
255
- await passwordStore.add(entry);
256
- await resetTokenStore.add({ userName, createdAt: new Date().toISOString(), token });
257
- await expect(authenticator.resetPasswordForUser('someBadToken', password)).rejects.toThrowError(UnauthenticatedError);
258
- const successResult = await authenticator.checkPasswordForUser(userName, lastPassword);
259
- expect(successResult.isValid).toBeTruthy();
260
- // Password updated, cannot use the last password
261
- const failResult = await authenticator.checkPasswordForUser(userName, password);
262
- expect(failResult.isValid).toBeFalsy();
263
- expect(failResult.reason).toBe('badUsernameOrPassword');
183
+ const authenticator = i.get(PasswordAuthenticator);
184
+ await expect(authenticator.resetPasswordForUser('unknown', 'pw')).rejects.toBeInstanceOf(UnauthenticatedError);
264
185
  });
265
186
  });
266
- it('Should throw UnauthenticatedError and clean up token if the token has been expired', async () => {
267
- await usingAsync(new Injector(), async (i) => {
187
+ it('throws UnauthenticatedError and removes the expired token', async () => {
188
+ await usingAsync(createInjector(), async (i) => {
268
189
  const userName = randomString();
269
190
  const lastPassword = randomString();
270
- const password = '';
271
191
  const token = randomString();
272
- setupSecurityStores(i);
192
+ useInMemorySecurityStores(i);
273
193
  usePasswordPolicy(i, { resetTokenExpirationSeconds: 1 });
274
- const authenticator = i.getInstance(PasswordAuthenticator);
275
- const { hasher } = authenticator;
276
- const passwordStore = i.getInstance(StoreManager).getStoreFor(PasswordCredential, 'userName');
277
- const resetTokenStore = i.getInstance(StoreManager).getStoreFor(PasswordResetToken, 'token');
278
- const entry = await hasher.createCredential(userName, lastPassword);
279
- await passwordStore.add(entry);
280
- const creationDate = new Date();
281
- creationDate.setDate(creationDate.getDate() - 2);
282
- await resetTokenStore.add({ userName, createdAt: creationDate.toISOString(), token });
283
- await expect(authenticator.resetPasswordForUser(token, password)).rejects.toThrowError(UnauthenticatedError);
284
- const successResult = await authenticator.checkPasswordForUser(userName, lastPassword);
285
- expect(successResult.isValid).toBeTruthy();
286
- // Password updated, cannot use the last password
287
- const failResult = await authenticator.checkPasswordForUser(userName, password);
288
- expect(failResult.isValid).toBeFalsy();
289
- expect(failResult.reason).toBe('badUsernameOrPassword');
290
- const tokenCount = await resetTokenStore.count();
291
- expect(tokenCount).toBe(0);
194
+ const authenticator = i.get(PasswordAuthenticator);
195
+ const credential = await authenticator.hasher.createCredential(userName, lastPassword);
196
+ await i.get(PasswordCredentialStore).add(credential);
197
+ const pastCreatedAt = new Date();
198
+ pastCreatedAt.setDate(pastCreatedAt.getDate() - 2);
199
+ await i.get(PasswordResetTokenStore).add({ userName, createdAt: pastCreatedAt.toISOString(), token });
200
+ await expect(authenticator.resetPasswordForUser(token, randomString())).rejects.toBeInstanceOf(UnauthenticatedError);
201
+ expect(await i.get(PasswordResetTokenStore).count()).toBe(0);
292
202
  });
293
203
  });
294
204
  });
@@ -1 +1 @@
1
- {"version":3,"file":"password-authenticator.spec.js","sourceRoot":"","sources":["../src/password-authenticator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD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Aa,GAAG,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;gBAClD,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;gBACtF,MAAM,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;gBACpD,MAAM,aAAa,GAAG,IAAI,IAAI,EAAE,CAAA;gBAChC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;gBAClD,MAAM,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;gBAErG,MAAM,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAC5F,oBAAoB,CACrB,CAAA;gBACD,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { PasswordComplexityRule } from '../models/password-complexity-rule.js';
2
2
  /**
3
- * @param lowerCaseCount The minimum lower case characters length
4
- * @returns The created Password Policy object
3
+ * Builds a complexity rule that requires at least `lowerCaseCount` lowercase
4
+ * characters. Diacritics are stripped before counting.
5
5
  */
6
6
  export declare const createContainsLowercasePolicy: (lowerCaseCount: number) => PasswordComplexityRule;
7
7
  //# sourceMappingURL=contains-lowercase.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @param lowerCaseCount The minimum lower case characters length
3
- * @returns The created Password Policy object
2
+ * Builds a complexity rule that requires at least `lowerCaseCount` lowercase
3
+ * characters. Diacritics are stripped before counting.
4
4
  */
5
5
  export const createContainsLowercasePolicy = (lowerCaseCount) => ({
6
6
  name: 'containsLowercase',
@@ -1,7 +1,7 @@
1
1
  import type { PasswordComplexityRule } from '../models/password-complexity-rule.js';
2
2
  /**
3
- * @param upperCaseCount The minimum upper case characters length
4
- * @returns The created Password Policy object
3
+ * Builds a complexity rule that requires at least `upperCaseCount` uppercase
4
+ * characters. Diacritics are stripped before counting (`Á` counts as `A`).
5
5
  */
6
6
  export declare const createContainsUppercasePolicy: (upperCaseCount: number) => PasswordComplexityRule;
7
7
  //# sourceMappingURL=contains-uppercase.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @param upperCaseCount The minimum upper case characters length
3
- * @returns The created Password Policy object
2
+ * Builds a complexity rule that requires at least `upperCaseCount` uppercase
3
+ * characters. Diacritics are stripped before counting (`Á` counts as `A`).
4
4
  */
5
5
  export const createContainsUppercasePolicy = (upperCaseCount) => ({
6
6
  name: 'containsUppercase',
@@ -1,7 +1,4 @@
1
1
  import type { PasswordComplexityRule } from '../models/password-complexity-rule.js';
2
- /**
3
- * @param maxLength The maximum password length
4
- * @returns The created Password Policy object
5
- */
2
+ /** Builds a complexity rule that fails when the password is longer than `maxLength`. */
6
3
  export declare const createMaxLengthComplexityRule: (maxLength: number) => PasswordComplexityRule;
7
4
  //# sourceMappingURL=max-length.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"max-length.d.ts","sourceRoot":"","sources":["../../src/password-complexity-rules/max-length.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAEnF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,KAAG,sBAShE,CAAA"}
1
+ {"version":3,"file":"max-length.d.ts","sourceRoot":"","sources":["../../src/password-complexity-rules/max-length.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAEnF,wFAAwF;AACxF,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,KAAG,sBAShE,CAAA"}
@@ -1,7 +1,4 @@
1
- /**
2
- * @param maxLength The maximum password length
3
- * @returns The created Password Policy object
4
- */
1
+ /** Builds a complexity rule that fails when the password is longer than `maxLength`. */
5
2
  export const createMaxLengthComplexityRule = (maxLength) => ({
6
3
  name: 'maxLength',
7
4
  check: async (passwordString) => {
@@ -1 +1 @@
1
- {"version":3,"file":"max-length.js","sourceRoot":"","sources":["../../src/password-complexity-rules/max-length.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,SAAiB,EAA0B,EAAE,CAAC,CAAC;IAC3F,IAAI,EAAE,WAAoB;IAC1B,KAAK,EAAE,KAAK,EAAE,cAAsB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,IAAI,SAAS,CAAA;QAClD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,kCAAkC,SAAS,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;IAChH,CAAC;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"max-length.js","sourceRoot":"","sources":["../../src/password-complexity-rules/max-length.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,SAAiB,EAA0B,EAAE,CAAC,CAAC;IAC3F,IAAI,EAAE,WAAoB;IAC1B,KAAK,EAAE,KAAK,EAAE,cAAsB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,IAAI,SAAS,CAAA;QAClD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,kCAAkC,SAAS,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;IAChH,CAAC;CACF,CAAC,CAAA"}
@@ -1,7 +1,4 @@
1
1
  import type { PasswordComplexityRule } from '../models/password-complexity-rule.js';
2
- /**
3
- * @param minLength The minimum password length
4
- * @returns The created Password Policy object
5
- */
2
+ /** Builds a complexity rule that fails when the password is shorter than `minLength`. */
6
3
  export declare const createMinLengthComplexityRule: (minLength: number) => PasswordComplexityRule;
7
4
  //# sourceMappingURL=min-length.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"min-length.d.ts","sourceRoot":"","sources":["../../src/password-complexity-rules/min-length.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAEnF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,KAAG,sBAShE,CAAA"}
1
+ {"version":3,"file":"min-length.d.ts","sourceRoot":"","sources":["../../src/password-complexity-rules/min-length.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAEnF,yFAAyF;AACzF,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,KAAG,sBAShE,CAAA"}
@@ -1,7 +1,4 @@
1
- /**
2
- * @param minLength The minimum password length
3
- * @returns The created Password Policy object
4
- */
1
+ /** Builds a complexity rule that fails when the password is shorter than `minLength`. */
5
2
  export const createMinLengthComplexityRule = (minLength) => ({
6
3
  name: 'minLength',
7
4
  check: async (passwordString) => {
@@ -1 +1 @@
1
- {"version":3,"file":"min-length.js","sourceRoot":"","sources":["../../src/password-complexity-rules/min-length.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,SAAiB,EAA0B,EAAE,CAAC,CAAC;IAC3F,IAAI,EAAE,WAAoB;IAC1B,KAAK,EAAE,KAAK,EAAE,cAAsB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,IAAI,SAAS,CAAA;QAClD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAAmC,SAAS,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;IACjH,CAAC;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"min-length.js","sourceRoot":"","sources":["../../src/password-complexity-rules/min-length.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,SAAiB,EAA0B,EAAE,CAAC,CAAC;IAC3F,IAAI,EAAE,WAAoB;IAC1B,KAAK,EAAE,KAAK,EAAE,cAAsB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,IAAI,SAAS,CAAA;QAClD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAAmC,SAAS,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;IACjH,CAAC;CACF,CAAC,CAAA"}