@3sixty/api-auth-entity-storage-service 0.0.0-stage → 0.20.0-next.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 (133) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/entities/authenticationAuditEntry.js +121 -0
  4. package/dist/es/entities/authenticationAuditEntry.js.map +1 -0
  5. package/dist/es/entities/authenticationRateEntry.js +37 -0
  6. package/dist/es/entities/authenticationRateEntry.js.map +1 -0
  7. package/dist/es/entities/authenticationUser.js +69 -0
  8. package/dist/es/entities/authenticationUser.js.map +1 -0
  9. package/dist/es/index.js +29 -0
  10. package/dist/es/index.js.map +1 -0
  11. package/dist/es/models/IAuthHeaderProcessorConfig.js +4 -0
  12. package/dist/es/models/IAuthHeaderProcessorConfig.js.map +1 -0
  13. package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js +2 -0
  14. package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -0
  15. package/dist/es/models/IAuthTokenContext.js +4 -0
  16. package/dist/es/models/IAuthTokenContext.js.map +1 -0
  17. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js +4 -0
  18. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js.map +1 -0
  19. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js +2 -0
  20. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -0
  21. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +4 -0
  22. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +1 -0
  23. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +2 -0
  24. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +1 -0
  25. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +2 -0
  26. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +1 -0
  27. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +2 -0
  28. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +1 -0
  29. package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js +2 -0
  30. package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -0
  31. package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js +2 -0
  32. package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -0
  33. package/dist/es/processors/authHeaderProcessor.js +277 -0
  34. package/dist/es/processors/authHeaderProcessor.js.map +1 -0
  35. package/dist/es/restEntryPoints.js +27 -0
  36. package/dist/es/restEntryPoints.js.map +1 -0
  37. package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +367 -0
  38. package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -0
  39. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +343 -0
  40. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
  41. package/dist/es/routes/entityStorageAuthenticationRoutes.js +247 -0
  42. package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -0
  43. package/dist/es/schema.js +15 -0
  44. package/dist/es/schema.js.map +1 -0
  45. package/dist/es/services/entityStorageAuthenticationAdminService.js +323 -0
  46. package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -0
  47. package/dist/es/services/entityStorageAuthenticationAuditService.js +240 -0
  48. package/dist/es/services/entityStorageAuthenticationAuditService.js.map +1 -0
  49. package/dist/es/services/entityStorageAuthenticationRateService.js +213 -0
  50. package/dist/es/services/entityStorageAuthenticationRateService.js.map +1 -0
  51. package/dist/es/services/entityStorageAuthenticationService.js +326 -0
  52. package/dist/es/services/entityStorageAuthenticationService.js.map +1 -0
  53. package/dist/es/utils/passwordHelper.js +58 -0
  54. package/dist/es/utils/passwordHelper.js.map +1 -0
  55. package/dist/es/utils/tokenHelper.js +142 -0
  56. package/dist/es/utils/tokenHelper.js.map +1 -0
  57. package/dist/types/entities/authenticationAuditEntry.d.ts +49 -0
  58. package/dist/types/entities/authenticationRateEntry.d.ts +17 -0
  59. package/dist/types/entities/authenticationUser.d.ts +33 -0
  60. package/dist/types/index.d.ts +26 -0
  61. package/dist/types/models/IAuthHeaderProcessorConfig.d.ts +39 -0
  62. package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +25 -0
  63. package/dist/types/models/IAuthTokenContext.d.ts +34 -0
  64. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +14 -0
  65. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +20 -0
  66. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +9 -0
  67. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +15 -0
  68. package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +10 -0
  69. package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +25 -0
  70. package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +36 -0
  71. package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +35 -0
  72. package/dist/types/processors/authHeaderProcessor.d.ts +57 -0
  73. package/dist/types/restEntryPoints.d.ts +5 -0
  74. package/dist/types/routes/entityStorageAuthenticationAdminRoutes.d.ts +62 -0
  75. package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +54 -0
  76. package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +45 -0
  77. package/dist/types/schema.d.ts +4 -0
  78. package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +65 -0
  79. package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +72 -0
  80. package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
  81. package/dist/types/services/entityStorageAuthenticationService.d.ts +65 -0
  82. package/dist/types/utils/passwordHelper.d.ts +24 -0
  83. package/dist/types/utils/tokenHelper.d.ts +60 -0
  84. package/docs/changelog.md +0 -0
  85. package/docs/examples.md +178 -0
  86. package/docs/open-api/spec.json +2122 -0
  87. package/docs/reference/classes/AuthHeaderProcessor.md +193 -0
  88. package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
  89. package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
  90. package/docs/reference/classes/AuthenticationUser.md +69 -0
  91. package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +229 -0
  92. package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +241 -0
  93. package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
  94. package/docs/reference/classes/EntityStorageAuthenticationService.md +221 -0
  95. package/docs/reference/classes/PasswordHelper.md +74 -0
  96. package/docs/reference/classes/TokenHelper.md +205 -0
  97. package/docs/reference/functions/authenticationAdminCreateUser.md +37 -0
  98. package/docs/reference/functions/authenticationAdminGetUser.md +31 -0
  99. package/docs/reference/functions/authenticationAdminGetUserByIdentity.md +31 -0
  100. package/docs/reference/functions/authenticationAdminRemoveUser.md +31 -0
  101. package/docs/reference/functions/authenticationAdminUpdateUser.md +31 -0
  102. package/docs/reference/functions/authenticationAdminUpdateUserPassword.md +31 -0
  103. package/docs/reference/functions/authenticationAuditCreate.md +37 -0
  104. package/docs/reference/functions/authenticationAuditGet.md +31 -0
  105. package/docs/reference/functions/authenticationAuditQuery.md +31 -0
  106. package/docs/reference/functions/authenticationAuditRemove.md +31 -0
  107. package/docs/reference/functions/authenticationAuditUpdate.md +31 -0
  108. package/docs/reference/functions/authenticationLogin.md +31 -0
  109. package/docs/reference/functions/authenticationLogout.md +31 -0
  110. package/docs/reference/functions/authenticationRefreshToken.md +31 -0
  111. package/docs/reference/functions/authenticationUpdatePassword.md +31 -0
  112. package/docs/reference/functions/generateRestRoutesAuthentication.md +25 -0
  113. package/docs/reference/functions/generateRestRoutesAuthenticationAdmin.md +25 -0
  114. package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
  115. package/docs/reference/functions/initSchema.md +9 -0
  116. package/docs/reference/index.md +57 -0
  117. package/docs/reference/interfaces/IAuthHeaderProcessorConfig.md +86 -0
  118. package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +53 -0
  119. package/docs/reference/interfaces/IAuthTokenContext.md +60 -0
  120. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +25 -0
  121. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +39 -0
  122. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +11 -0
  123. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +25 -0
  124. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +17 -0
  125. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +53 -0
  126. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +87 -0
  127. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +81 -0
  128. package/docs/reference/variables/restEntryPoints.md +5 -0
  129. package/docs/reference/variables/tagsAuthentication.md +5 -0
  130. package/docs/reference/variables/tagsAuthenticationAdmin.md +5 -0
  131. package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
  132. package/locales/en.json +52 -0
  133. package/package.json +64 -5
@@ -0,0 +1,81 @@
1
+ # Interface: IEntityStorageAuthenticationServiceConstructorOptions
2
+
3
+ Options for the EntityStorageAuthenticationService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### userEntityStorageType? {#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? {#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
+ ### authenticationAuditServiceType? {#authenticationauditservicetype}
36
+
37
+ > `optional` **authenticationAuditServiceType?**: `string`
38
+
39
+ The audit service.
40
+
41
+ #### Default
42
+
43
+ ```ts
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
59
+ ```
60
+
61
+ ***
62
+
63
+ ### tenantAdminComponentType? {#tenantadmincomponenttype}
64
+
65
+ > `optional` **tenantAdminComponentType?**: `string`
66
+
67
+ The component to retrieve tenant information.
68
+
69
+ #### Default
70
+
71
+ ```ts
72
+ tenant-admin
73
+ ```
74
+
75
+ ***
76
+
77
+ ### config? {#config}
78
+
79
+ > `optional` **config?**: [`IEntityStorageAuthenticationServiceConfig`](IEntityStorageAuthenticationServiceConfig.md)
80
+
81
+ The configuration for the authentication.
@@ -0,0 +1,5 @@
1
+ # Variable: restEntryPoints
2
+
3
+ > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
4
+
5
+ REST entry points for the authentication, authentication admin, and authentication audit services.
@@ -0,0 +1,5 @@
1
+ # Variable: tagsAuthentication
2
+
3
+ > `const` **tagsAuthentication**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,5 @@
1
+ # Variable: tagsAuthenticationAdmin
2
+
3
+ > `const` **tagsAuthenticationAdmin**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,5 @@
1
+ # Variable: tagsAuthenticationAudit
2
+
3
+ > `const` **tagsAuthenticationAudit**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,52 @@
1
+ {
2
+ "error": {
3
+ "entityStorageAuthenticationService": {
4
+ "loginFailed": "Login failed",
5
+ "userNotFound": "The user with the specified e-mail could not be found",
6
+ "passwordMismatch": "The password does not match the user's password",
7
+ "nodeIdNotSet": "The node ID has not been set"
8
+ },
9
+ "entityStorageAuthenticationAdminService": {
10
+ "userExists": "The user with the specified e-mail already exists",
11
+ "createUserFailed": "Creating the user failed",
12
+ "getUserFailed": "Getting the user failed",
13
+ "updateUserFailed": "Updating the user failed",
14
+ "removeUserFailed": "Removing the user failed",
15
+ "updatePasswordFailed": "Updating the user's password failed",
16
+ "userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
17
+ "insufficientScopeForEscalatedPrivilege": "Caller does not hold the required scope \"{scopeName}\" to assign a role with escalated privilege.",
18
+ "insufficientScopeForEscalatedTarget": "Caller does not hold the required scope \"{scopeName}\" to modify an account with escalated privilege."
19
+ },
20
+ "authHeaderProcessor": {
21
+ "nodeIdNotSet": "The node ID has not been set"
22
+ },
23
+ "passwordHelper": {
24
+ "currentPasswordMismatch": "The current password is incorrect"
25
+ },
26
+ "entityStorageAuthenticationAuditService": {
27
+ "auditEntryNotFound": "The audit entry with the specified identifier could not be found \"{notFoundId}\"",
28
+ "getAuditEntryFailed": "Getting the audit entry failed",
29
+ "updateAuditEntryFailed": "Updating the audit entry failed",
30
+ "removeAuditEntryFailed": "Removing the audit entry failed"
31
+ },
32
+ "entityStorageAuthenticationRateService": {
33
+ "actionConfigMissing": "No rate-limit configuration exists for action \"{action}\".",
34
+ "rateLimitExceeded": "The rate limit for action \"{action}\" has been exceeded. Retry after {retryAfterSeconds} seconds."
35
+ },
36
+ "tokenHelper": {
37
+ "missing": "The JSON Web token could not be found in the authorization header",
38
+ "headerKeyIdMismatch": "The JSON Web token key identifier does not match the expected signing key",
39
+ "payloadIssuerMismatch": "The JSON Web token issuer does not match the expected signing key",
40
+ "payloadMissingSubject": "The JSON Web token payload does not contain a subject",
41
+ "payloadMissingOrganization": "The JSON Web token payload does not contain an organization",
42
+ "expired": "The JSON Web token has expired",
43
+ "insufficientScopes": "The JSON Web token does not have the required scopes to access this resource",
44
+ "userNotVerified": "The user associated with the JSON Web token could not be verified",
45
+ "organizationNotVerified": "The organization associated with the JSON Web token could not be verified",
46
+ "tenantNotVerified": "The tenant associated with the JSON Web token could not be verified"
47
+ },
48
+ "validation": {
49
+ "saltEntropyTooLow": "Salt must have at least 8 unique characters for sufficient entropy."
50
+ }
51
+ }
52
+ }
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
- "name": "@3sixty/api-auth-entity-storage-service",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@3sixty/api-auth-entity-storage-service",
3
+ "version": "0.20.0-next.0",
4
+ "description": "Authentication service implementation and REST routes backed by entity storage.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/3sixtyglobal/api.git",
8
+ "directory": "packages/api-auth-entity-storage-service"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=24.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@3sixty/api-auth-entity-storage-models": "0.20.0-next.0",
18
+ "@3sixty/api-core": "0.20.0-next.0",
19
+ "@3sixty/api-models": "0.20.0-next.0",
20
+ "@3sixty/background-task-models": "next",
21
+ "@3sixty/context": "next",
22
+ "@3sixty/core": "next",
23
+ "@3sixty/crypto": "next",
24
+ "@3sixty/entity": "next",
25
+ "@3sixty/entity-storage-models": "next",
26
+ "@3sixty/logging-models": "next",
27
+ "@3sixty/nameof": "next",
28
+ "@3sixty/vault-models": "next",
29
+ "@3sixty/web": "next"
30
+ },
31
+ "main": "./dist/es/index.js",
32
+ "types": "./dist/types/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/types/index.d.ts",
36
+ "import": "./dist/es/index.js",
37
+ "default": "./dist/es/index.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "dist/es",
42
+ "dist/types",
43
+ "locales",
44
+ "docs"
45
+ ],
46
+ "keywords": [
47
+ "twin",
48
+ "trade",
49
+ "iota",
50
+ "framework",
51
+ "blockchain",
52
+ "api",
53
+ "entity",
54
+ "storage",
55
+ "persistence",
56
+ "database",
57
+ "service",
58
+ "microservice",
59
+ "business-logic"
60
+ ],
61
+ "bugs": {
62
+ "url": "git+https://github.com/3sixtyglobal/api/issues"
63
+ },
64
+ "homepage": "https://3sixty.global"
65
+ }