@twin.org/api-auth-entity-storage-service 0.0.3-next.22 → 0.0.3-next.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/entities/authenticationAuditEntry.js +101 -0
- package/dist/es/entities/authenticationAuditEntry.js.map +1 -0
- package/dist/es/entities/authenticationRateEntry.js +37 -0
- package/dist/es/entities/authenticationRateEntry.js.map +1 -0
- package/dist/es/index.js +10 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +4 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js +0 -2
- package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -1
- package/dist/es/processors/authHeaderProcessor.js +18 -4
- package/dist/es/processors/authHeaderProcessor.js.map +1 -1
- package/dist/es/restEntryPoints.js +7 -0
- package/dist/es/restEntryPoints.js.map +1 -1
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +174 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
- package/dist/es/schema.js +4 -0
- package/dist/es/schema.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationAdminService.js +53 -27
- package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationAuditService.js +178 -0
- package/dist/es/services/entityStorageAuthenticationAuditService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js +202 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationService.js +156 -11
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
- package/dist/es/utils/passwordHelper.js +57 -0
- package/dist/es/utils/passwordHelper.js.map +1 -0
- package/dist/es/utils/tokenHelper.js +11 -1
- package/dist/es/utils/tokenHelper.js.map +1 -1
- package/dist/types/entities/authenticationAuditEntry.d.ts +49 -0
- package/dist/types/entities/authenticationRateEntry.d.ts +17 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +5 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +5 -0
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +9 -0
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +10 -0
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +20 -0
- package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +22 -1
- package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +8 -3
- package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +29 -0
- package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +59 -0
- package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
- package/dist/types/services/entityStorageAuthenticationService.d.ts +6 -0
- package/dist/types/utils/passwordHelper.d.ts +24 -0
- package/dist/types/utils/tokenHelper.d.ts +2 -1
- package/docs/changelog.md +32 -0
- package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
- package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +4 -4
- package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +157 -0
- package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
- package/docs/reference/classes/EntityStorageAuthenticationService.md +26 -0
- package/docs/reference/classes/PasswordHelper.md +74 -0
- package/docs/reference/classes/TokenHelper.md +7 -1
- package/docs/reference/functions/authenticationAuditCreate.md +31 -0
- package/docs/reference/functions/authenticationAuditQuery.md +31 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
- package/docs/reference/index.md +13 -0
- package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +14 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +14 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +11 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +17 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +39 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +57 -1
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +18 -4
- package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
- package/locales/en.json +13 -2
- package/package.json +5 -4
|
@@ -4,6 +4,20 @@ Options for the AuthHeaderProcessor constructor.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
+
### authenticationAdminServiceType? {#authenticationadminservicetype}
|
|
8
|
+
|
|
9
|
+
> `optional` **authenticationAdminServiceType?**: `string`
|
|
10
|
+
|
|
11
|
+
The admin service.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
authentication-admin
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
7
21
|
### vaultConnectorType? {#vaultconnectortype}
|
|
8
22
|
|
|
9
23
|
> `optional` **vaultConnectorType?**: `string`
|
package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md
CHANGED
|
@@ -18,6 +18,20 @@ authentication-user
|
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
+
### authenticationAuditServiceType? {#authenticationauditservicetype}
|
|
22
|
+
|
|
23
|
+
> `optional` **authenticationAuditServiceType?**: `string`
|
|
24
|
+
|
|
25
|
+
The audit service.
|
|
26
|
+
|
|
27
|
+
#### Default
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
authentication-audit
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
21
35
|
### config? {#config}
|
|
22
36
|
|
|
23
37
|
> `optional` **config?**: [`IEntityStorageAuthenticationAdminServiceConfig`](IEntityStorageAuthenticationAdminServiceConfig.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationAuditServiceConfig
|
|
2
|
+
|
|
3
|
+
Config for the EntityStorageAuthenticationAuditService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### ipHashSalt? {#iphashsalt}
|
|
8
|
+
|
|
9
|
+
> `optional` **ipHashSalt?**: `string`
|
|
10
|
+
|
|
11
|
+
The server-side salt for hashing IP addresses in audit logs, if configured.
|
package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationAuditServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the EntityStorageAuthenticationAuditService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### authenticationAuditEntryStorageType? {#authenticationauditentrystoragetype}
|
|
8
|
+
|
|
9
|
+
> `optional` **authenticationAuditEntryStorageType?**: `string`
|
|
10
|
+
|
|
11
|
+
The entity storage for the audit entries.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
authentication-audit-entry
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### config? {#config}
|
|
22
|
+
|
|
23
|
+
> `optional` **config?**: [`IEntityStorageAuthenticationAuditServiceConfig`](IEntityStorageAuthenticationAuditServiceConfig.md)
|
|
24
|
+
|
|
25
|
+
The configuration for the authentication audit service.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationRateServiceConfig
|
|
2
|
+
|
|
3
|
+
Configuration for the entity storage authentication rate service.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### cleanupIntervalMinutes? {#cleanupintervalminutes}
|
|
8
|
+
|
|
9
|
+
> `optional` **cleanupIntervalMinutes?**: `number`
|
|
10
|
+
|
|
11
|
+
Interval between cleanup runs in minutes.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
5
|
|
17
|
+
```
|
package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationRateServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the EntityStorageAuthenticationRateService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### authenticationRateEntryStorageType? {#authenticationrateentrystoragetype}
|
|
8
|
+
|
|
9
|
+
> `optional` **authenticationRateEntryStorageType?**: `string`
|
|
10
|
+
|
|
11
|
+
The entity storage for authentication rate entries.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
authentication-rate-entry
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### taskSchedulerComponentType? {#taskschedulercomponenttype}
|
|
22
|
+
|
|
23
|
+
> `optional` **taskSchedulerComponentType?**: `string`
|
|
24
|
+
|
|
25
|
+
The task scheduler component type.
|
|
26
|
+
|
|
27
|
+
#### Default
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
task-scheduler
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### config? {#config}
|
|
36
|
+
|
|
37
|
+
> `optional` **config?**: [`IEntityStorageAuthenticationRateServiceConfig`](IEntityStorageAuthenticationRateServiceConfig.md)
|
|
38
|
+
|
|
39
|
+
The configuration for the authentication rate service.
|
|
@@ -27,5 +27,61 @@ The default time to live for the JWT.
|
|
|
27
27
|
#### Default
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
|
-
|
|
30
|
+
60
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### minPasswordLength? {#minpasswordlength}
|
|
36
|
+
|
|
37
|
+
> `optional` **minPasswordLength?**: `number`
|
|
38
|
+
|
|
39
|
+
The minimum password length for new password validation.
|
|
40
|
+
|
|
41
|
+
#### Default
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
8
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### loginRateLimit? {#loginratelimit}
|
|
50
|
+
|
|
51
|
+
> `optional` **loginRateLimit?**: `IAuthenticationRateActionConfig`
|
|
52
|
+
|
|
53
|
+
Optional override for login failure rate limit.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
{ maxAttempts: 5, windowMinutes: 15 }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### passwordChangeRateLimit? {#passwordchangeratelimit}
|
|
64
|
+
|
|
65
|
+
> `optional` **passwordChangeRateLimit?**: `IAuthenticationRateActionConfig`
|
|
66
|
+
|
|
67
|
+
Optional override for password change rate limit.
|
|
68
|
+
|
|
69
|
+
#### Default
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
{ maxAttempts: 5, windowMinutes: 15 }
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### tokenRefreshRateLimit? {#tokenrefreshratelimit}
|
|
78
|
+
|
|
79
|
+
> `optional` **tokenRefreshRateLimit?**: `IAuthenticationRateActionConfig`
|
|
80
|
+
|
|
81
|
+
Optional override for token refresh rate limit.
|
|
82
|
+
|
|
83
|
+
#### Default
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
{ maxAttempts: 30, windowMinutes: 60 }
|
|
31
87
|
```
|
|
@@ -32,16 +32,30 @@ vault
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### authenticationAuditServiceType? {#authenticationauditservicetype}
|
|
36
36
|
|
|
37
|
-
> `optional` **
|
|
37
|
+
> `optional` **authenticationAuditServiceType?**: `string`
|
|
38
38
|
|
|
39
|
-
The
|
|
39
|
+
The audit service.
|
|
40
40
|
|
|
41
41
|
#### Default
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
authentication-
|
|
44
|
+
authentication-audit
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### authenticationRateServiceType? {#authenticationrateservicetype}
|
|
50
|
+
|
|
51
|
+
> `optional` **authenticationRateServiceType?**: `string`
|
|
52
|
+
|
|
53
|
+
The rate service.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
authentication-rate
|
|
45
59
|
```
|
|
46
60
|
|
|
47
61
|
***
|
package/locales/en.json
CHANGED
|
@@ -12,18 +12,29 @@
|
|
|
12
12
|
"updateUserFailed": "Updating the user failed",
|
|
13
13
|
"removeUserFailed": "Removing the user failed",
|
|
14
14
|
"updatePasswordFailed": "Updating the user's password failed",
|
|
15
|
-
"userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\""
|
|
15
|
+
"userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\""
|
|
16
|
+
},
|
|
17
|
+
"passwordHelper": {
|
|
16
18
|
"currentPasswordMismatch": "The current password is incorrect"
|
|
17
19
|
},
|
|
20
|
+
"entityStorageAuthenticationRateService": {
|
|
21
|
+
"actionConfigMissing": "No rate-limit configuration exists for action \"{action}\".",
|
|
22
|
+
"rateLimitExceeded": "The rate limit for action \"{action}\" has been exceeded. Retry after {retryAfterSeconds} seconds."
|
|
23
|
+
},
|
|
18
24
|
"tokenHelper": {
|
|
19
25
|
"missing": "The JSON Web token could not be found in the authorization header",
|
|
20
26
|
"payloadMissingSubject": "The JSON Web token payload does not contain a subject",
|
|
21
27
|
"payloadMissingOrganization": "The JSON Web token payload does not contain an organization",
|
|
22
28
|
"expired": "The JSON Web token has expired",
|
|
23
|
-
"insufficientScopes": "The JSON Web token does not have the required scopes to access this resource"
|
|
29
|
+
"insufficientScopes": "The JSON Web token does not have the required scopes to access this resource",
|
|
30
|
+
"userNotVerified": "The user associated with the JSON Web token could not be verified",
|
|
31
|
+
"organizationNotVerified": "The organization associated with the JSON Web token could not be verified"
|
|
24
32
|
},
|
|
25
33
|
"authHeaderProcessor": {
|
|
26
34
|
"tenantIdMismatch": "The tenant ID in the token does not match the tenant ID in the context"
|
|
35
|
+
},
|
|
36
|
+
"validation": {
|
|
37
|
+
"saltEntropyTooLow": "Salt must have at least 8 unique characters for sufficient entropy."
|
|
27
38
|
}
|
|
28
39
|
}
|
|
29
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-auth-entity-storage-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.24",
|
|
4
4
|
"description": "Authentication service implementation and REST routes backed by entity storage.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-auth-entity-storage-models": "0.0.3-next.
|
|
18
|
-
"@twin.org/api-core": "0.0.3-next.
|
|
19
|
-
"@twin.org/api-models": "0.0.3-next.
|
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.3-next.24",
|
|
18
|
+
"@twin.org/api-core": "0.0.3-next.24",
|
|
19
|
+
"@twin.org/api-models": "0.0.3-next.24",
|
|
20
|
+
"@twin.org/background-task-models": "next",
|
|
20
21
|
"@twin.org/context": "next",
|
|
21
22
|
"@twin.org/core": "next",
|
|
22
23
|
"@twin.org/crypto": "next",
|