@twin.org/api-auth-entity-storage-service 0.0.1-next.9 → 0.0.2-next.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 (31) hide show
  1. package/dist/cjs/index.cjs +221 -19
  2. package/dist/esm/index.mjs +223 -23
  3. package/dist/types/index.d.ts +5 -0
  4. package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +15 -0
  5. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +10 -0
  6. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +15 -0
  7. package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +25 -0
  8. package/dist/types/processors/authHeaderProcessor.d.ts +10 -11
  9. package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +9 -1
  10. package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +42 -0
  11. package/dist/types/services/entityStorageAuthenticationService.d.ts +14 -9
  12. package/dist/types/utils/tokenHelper.d.ts +1 -1
  13. package/docs/changelog.md +115 -1
  14. package/docs/reference/classes/AuthHeaderProcessor.md +50 -28
  15. package/docs/reference/classes/AuthenticationUser.md +3 -3
  16. package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +149 -0
  17. package/docs/reference/classes/EntityStorageAuthenticationService.md +71 -39
  18. package/docs/reference/classes/PasswordHelper.md +9 -5
  19. package/docs/reference/classes/TokenHelper.md +36 -34
  20. package/docs/reference/functions/authenticationLogin.md +9 -3
  21. package/docs/reference/functions/authenticationLogout.md +9 -3
  22. package/docs/reference/functions/authenticationRefreshToken.md +9 -3
  23. package/docs/reference/functions/authenticationUpdatePassword.md +31 -0
  24. package/docs/reference/functions/generateRestRoutesAuthentication.md +8 -4
  25. package/docs/reference/index.md +6 -0
  26. package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +25 -0
  27. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +17 -0
  28. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +25 -0
  29. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +53 -0
  30. package/locales/en.json +10 -1
  31. package/package.json +6 -6
@@ -0,0 +1,25 @@
1
+ # Interface: IAuthHeaderProcessorConstructorOptions
2
+
3
+ Options for the AuthHeaderProcessor constructor.
4
+
5
+ ## Properties
6
+
7
+ ### vaultConnectorType?
8
+
9
+ > `optional` **vaultConnectorType**: `string`
10
+
11
+ The vault for the private keys.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ vault
17
+ ```
18
+
19
+ ***
20
+
21
+ ### config?
22
+
23
+ > `optional` **config**: [`IAuthHeaderProcessorConfig`](IAuthHeaderProcessorConfig.md)
24
+
25
+ The configuration for the processor.
@@ -0,0 +1,17 @@
1
+ # Interface: IEntityStorageAuthenticationAdminServiceConfig
2
+
3
+ Configuration for the entity storage authentication admin service.
4
+
5
+ ## Properties
6
+
7
+ ### minPasswordLength?
8
+
9
+ > `optional` **minPasswordLength**: `number`
10
+
11
+ The minimum password length.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ 8
17
+ ```
@@ -0,0 +1,25 @@
1
+ # Interface: IEntityStorageAuthenticationAdminServiceConstructorOptions
2
+
3
+ Options for the EntityStorageAuthenticationAdminService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### userEntityStorageType?
8
+
9
+ > `optional` **userEntityStorageType**: `string`
10
+
11
+ The entity storage for the users.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ authentication-user
17
+ ```
18
+
19
+ ***
20
+
21
+ ### config?
22
+
23
+ > `optional` **config**: [`IEntityStorageAuthenticationAdminServiceConfig`](IEntityStorageAuthenticationAdminServiceConfig.md)
24
+
25
+ The configuration for the authentication.
@@ -0,0 +1,53 @@
1
+ # Interface: IEntityStorageAuthenticationServiceConstructorOptions
2
+
3
+ Options for the EntityStorageAuthenticationService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### userEntityStorageType?
8
+
9
+ > `optional` **userEntityStorageType**: `string`
10
+
11
+ The entity storage for the users.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ authentication-user
17
+ ```
18
+
19
+ ***
20
+
21
+ ### vaultConnectorType?
22
+
23
+ > `optional` **vaultConnectorType**: `string`
24
+
25
+ The vault for the private keys.
26
+
27
+ #### Default
28
+
29
+ ```ts
30
+ vault
31
+ ```
32
+
33
+ ***
34
+
35
+ ### authenticationAdminServiceType?
36
+
37
+ > `optional` **authenticationAdminServiceType**: `string`
38
+
39
+ The admin service.
40
+
41
+ #### Default
42
+
43
+ ```ts
44
+ authentication-admin
45
+ ```
46
+
47
+ ***
48
+
49
+ ### config?
50
+
51
+ > `optional` **config**: [`IEntityStorageAuthenticationServiceConfig`](IEntityStorageAuthenticationServiceConfig.md)
52
+
53
+ The configuration for the authentication.
package/locales/en.json CHANGED
@@ -6,12 +6,21 @@
6
6
  "userNotFound": "The user with the specified e-mail could not be found",
7
7
  "passwordMismatch": "The password does not match the user's password"
8
8
  },
9
+ "entityStorageAuthenticationAdminService": {
10
+ "userExists": "The user with the specified e-mail already exists",
11
+ "createFailed": "Creating the user failed",
12
+ "removeFailed": "Removing the user failed",
13
+ "updatePasswordFailed": "Updating the user's password failed",
14
+ "passwordTooShort": "The password is too short, it must be at least {minLength} characters long",
15
+ "userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
16
+ "currentPasswordMismatch": "The current password is incorrect"
17
+ },
9
18
  "entityStorageAuthenticationProcessor": {
10
19
  "initializeFailed": "The JSON Web token authentication processor could not be initialized"
11
20
  },
12
21
  "tokenHelper": {
13
22
  "missing": "The JSON Web token could not be found in the authorization header",
14
- "invalid": "The JSON Web token signature could not be validated",
23
+ "payloadMissingSubject": "The JSON Web token payload does not contain a subject",
15
24
  "expired": "The JSON Web token has expired"
16
25
  }
17
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-auth-entity-storage-service",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "Auth Entity Storage contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,9 +14,9 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-auth-entity-storage-models": "0.0.1-next.9",
18
- "@twin.org/api-core": "0.0.1-next.9",
19
- "@twin.org/api-models": "0.0.1-next.9",
17
+ "@twin.org/api-auth-entity-storage-models": "0.0.2-next.1",
18
+ "@twin.org/api-core": "0.0.2-next.1",
19
+ "@twin.org/api-models": "0.0.2-next.1",
20
20
  "@twin.org/core": "next",
21
21
  "@twin.org/crypto": "next",
22
22
  "@twin.org/entity": "next",
@@ -31,9 +31,9 @@
31
31
  "types": "./dist/types/index.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
+ "types": "./dist/types/index.d.ts",
34
35
  "require": "./dist/cjs/index.cjs",
35
- "import": "./dist/esm/index.mjs",
36
- "types": "./dist/types/index.d.ts"
36
+ "import": "./dist/esm/index.mjs"
37
37
  }
38
38
  },
39
39
  "files": [