@furystack/security 6.0.31 → 6.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -3
- package/README.md +19 -9
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
## [6.0.33] - 2026-01-26
|
|
4
|
+
|
|
5
|
+
### ⬆️ Dependencies
|
|
6
|
+
|
|
7
|
+
- Updated `@furystack/inject` with fix for singleton injector reference being overwritten by child injectors
|
|
8
|
+
|
|
9
|
+
## [6.0.32] - 2026-01-22
|
|
10
|
+
|
|
11
|
+
### ⬆️ Dependencies
|
|
12
|
+
|
|
13
|
+
- Dependency updates
|
|
14
|
+
|
|
15
|
+
### 📚 Documentation
|
|
16
|
+
|
|
17
|
+
- Improved README with clearer examples and better structure
|
|
18
|
+
|
|
19
|
+
### 🔧 Chores
|
|
20
|
+
|
|
21
|
+
- Migrated to centralized changelog management system
|
package/README.md
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
# @furystack/security
|
|
2
2
|
|
|
3
|
-
Password management, authentication, and authorization utilities for FuryStack
|
|
3
|
+
Password management, authentication, and authorization utilities for FuryStack.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @furystack/security
|
|
9
|
+
# or
|
|
10
|
+
yarn add @furystack/security
|
|
11
|
+
```
|
|
4
12
|
|
|
5
13
|
## Usage Examples
|
|
6
14
|
|
|
7
15
|
### Setup a password policy
|
|
8
16
|
|
|
9
17
|
```ts
|
|
10
|
-
import {
|
|
18
|
+
import { Injector } from '@furystack/inject'
|
|
19
|
+
import { usePasswordPolicy, createMinLengthComplexityRule, createMaxLengthComplexityRule } from '@furystack/security'
|
|
11
20
|
|
|
21
|
+
const injector = new Injector()
|
|
12
22
|
usePasswordPolicy(injector, {
|
|
13
23
|
passwordComplexityRules: [createMinLengthComplexityRule(8), createMaxLengthComplexityRule(64)],
|
|
14
24
|
passwordExpirationDays: 90,
|
|
@@ -19,6 +29,8 @@ usePasswordPolicy(injector, {
|
|
|
19
29
|
### Check if a user's password is valid
|
|
20
30
|
|
|
21
31
|
```ts
|
|
32
|
+
import { PasswordAuthenticator } from '@furystack/security'
|
|
33
|
+
|
|
22
34
|
const authenticator = injector.getInstance(PasswordAuthenticator)
|
|
23
35
|
|
|
24
36
|
const userName = 'john_doe'
|
|
@@ -27,12 +39,10 @@ const plainPassword = 'SecureP@ssw0rd!'
|
|
|
27
39
|
const checkResult = await authenticator.checkPasswordForUser(userName, plainPassword)
|
|
28
40
|
|
|
29
41
|
if (checkResult.isValid) {
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (checkResult.reason === 'passwordExpired') {
|
|
36
|
-
return 'Password has expired. Please reset it.'
|
|
42
|
+
console.log('Hooray! Password is valid.')
|
|
43
|
+
} else if (checkResult.reason === 'badUsernameOrPassword') {
|
|
44
|
+
console.log('Invalid username or password.')
|
|
45
|
+
} else if (checkResult.reason === 'passwordExpired') {
|
|
46
|
+
console.log('Password has expired. Please reset it.')
|
|
37
47
|
}
|
|
38
48
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/security",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.33",
|
|
4
4
|
"description": "Security, password management and authorization related stuff for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"url": "https://github.com/furystack/furystack/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@furystack/core": "^15.0.
|
|
39
|
-
"@furystack/inject": "^12.0.
|
|
38
|
+
"@furystack/core": "^15.0.33",
|
|
39
|
+
"@furystack/inject": "^12.0.27"
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/furystack/furystack",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@furystack/utils": "^8.1.
|
|
44
|
-
"@types/node": "^25.0.
|
|
43
|
+
"@furystack/utils": "^8.1.8",
|
|
44
|
+
"@types/node": "^25.0.10",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
|
-
"vitest": "^4.0.
|
|
46
|
+
"vitest": "^4.0.17"
|
|
47
47
|
}
|
|
48
48
|
}
|