@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.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/entities/authenticationAuditEntry.js +121 -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/entities/authenticationUser.js +69 -0
- package/dist/es/entities/authenticationUser.js.map +1 -0
- package/dist/es/index.js +29 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IAuthHeaderProcessorConfig.js +4 -0
- package/dist/es/models/IAuthHeaderProcessorConfig.js.map +1 -0
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js +2 -0
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/IAuthTokenContext.js +4 -0
- package/dist/es/models/IAuthTokenContext.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js +4 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -0
- 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 +2 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -0
- package/dist/es/processors/authHeaderProcessor.js +277 -0
- package/dist/es/processors/authHeaderProcessor.js.map +1 -0
- package/dist/es/restEntryPoints.js +27 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +367 -0
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +343 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationRoutes.js +247 -0
- package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -0
- package/dist/es/schema.js +15 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationAdminService.js +323 -0
- package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationAuditService.js +240 -0
- package/dist/es/services/entityStorageAuthenticationAuditService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js +213 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationService.js +326 -0
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -0
- package/dist/es/utils/passwordHelper.js +58 -0
- package/dist/es/utils/passwordHelper.js.map +1 -0
- package/dist/es/utils/tokenHelper.js +142 -0
- package/dist/es/utils/tokenHelper.js.map +1 -0
- package/dist/types/entities/authenticationAuditEntry.d.ts +49 -0
- package/dist/types/entities/authenticationRateEntry.d.ts +17 -0
- package/dist/types/entities/authenticationUser.d.ts +33 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/models/IAuthHeaderProcessorConfig.d.ts +39 -0
- package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +25 -0
- package/dist/types/models/IAuthTokenContext.d.ts +34 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +14 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +20 -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 +25 -0
- package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +36 -0
- package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +35 -0
- package/dist/types/processors/authHeaderProcessor.d.ts +57 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/dist/types/routes/entityStorageAuthenticationAdminRoutes.d.ts +62 -0
- package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +54 -0
- package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +45 -0
- package/dist/types/schema.d.ts +4 -0
- package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +65 -0
- package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +72 -0
- package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
- package/dist/types/services/entityStorageAuthenticationService.d.ts +65 -0
- package/dist/types/utils/passwordHelper.d.ts +24 -0
- package/dist/types/utils/tokenHelper.d.ts +60 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +178 -0
- package/docs/open-api/spec.json +2122 -0
- package/docs/reference/classes/AuthHeaderProcessor.md +193 -0
- package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
- package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
- package/docs/reference/classes/AuthenticationUser.md +69 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +229 -0
- package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +241 -0
- package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
- package/docs/reference/classes/EntityStorageAuthenticationService.md +221 -0
- package/docs/reference/classes/PasswordHelper.md +74 -0
- package/docs/reference/classes/TokenHelper.md +205 -0
- package/docs/reference/functions/authenticationAdminCreateUser.md +37 -0
- package/docs/reference/functions/authenticationAdminGetUser.md +31 -0
- package/docs/reference/functions/authenticationAdminGetUserByIdentity.md +31 -0
- package/docs/reference/functions/authenticationAdminRemoveUser.md +31 -0
- package/docs/reference/functions/authenticationAdminUpdateUser.md +31 -0
- package/docs/reference/functions/authenticationAdminUpdateUserPassword.md +31 -0
- package/docs/reference/functions/authenticationAuditCreate.md +37 -0
- package/docs/reference/functions/authenticationAuditGet.md +31 -0
- package/docs/reference/functions/authenticationAuditQuery.md +31 -0
- package/docs/reference/functions/authenticationAuditRemove.md +31 -0
- package/docs/reference/functions/authenticationAuditUpdate.md +31 -0
- package/docs/reference/functions/authenticationLogin.md +31 -0
- package/docs/reference/functions/authenticationLogout.md +31 -0
- package/docs/reference/functions/authenticationRefreshToken.md +31 -0
- package/docs/reference/functions/authenticationUpdatePassword.md +31 -0
- package/docs/reference/functions/generateRestRoutesAuthentication.md +25 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAdmin.md +25 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
- package/docs/reference/functions/initSchema.md +9 -0
- package/docs/reference/index.md +57 -0
- package/docs/reference/interfaces/IAuthHeaderProcessorConfig.md +86 -0
- package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +53 -0
- package/docs/reference/interfaces/IAuthTokenContext.md +60 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +25 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +39 -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 +53 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +87 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +81 -0
- package/docs/reference/variables/restEntryPoints.md +5 -0
- package/docs/reference/variables/tagsAuthentication.md +5 -0
- package/docs/reference/variables/tagsAuthenticationAdmin.md +5 -0
- package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
- package/locales/en.json +52 -0
- package/package.json +64 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 IOTA Stiftung.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 3Sixty API Auth Entity Storage Service
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package provides an authentication service implementation and REST routes backed by entity storage.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @3sixty/api-auth-entity-storage-service
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
|
|
14
|
+
|
|
15
|
+
## Reference
|
|
16
|
+
|
|
17
|
+
Detailed reference documentation for the API can be found in [docs/reference/index.md](docs/reference/index.md)
|
|
18
|
+
|
|
19
|
+
## Changelog
|
|
20
|
+
|
|
21
|
+
The changes between each version can be found in [docs/changelog.md](docs/changelog.md)
|
|
22
|
+
|
|
23
|
+
## Origin
|
|
24
|
+
|
|
25
|
+
This package is derived from the original [iotaledger/twin-api](https://github.com/iotaledger/twin-api/tree/next/packages/api-auth-entity-storage-service) repository.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { SortDirection, entity, property } from "@3sixty/entity";
|
|
4
|
+
/**
|
|
5
|
+
* Class defining the storage for authentication audit entries.
|
|
6
|
+
*/
|
|
7
|
+
let AuthenticationAuditEntry = class AuthenticationAuditEntry {
|
|
8
|
+
/**
|
|
9
|
+
* The unique identifier for the audit entry.
|
|
10
|
+
*/
|
|
11
|
+
id;
|
|
12
|
+
/**
|
|
13
|
+
* The timestamp of the audit entry in ISO 8601 format.
|
|
14
|
+
*/
|
|
15
|
+
dateCreated;
|
|
16
|
+
/**
|
|
17
|
+
* The audit event that occurred.
|
|
18
|
+
*/
|
|
19
|
+
event;
|
|
20
|
+
/**
|
|
21
|
+
* The actor identifier, could be e-mail, username, or other unique identifier.
|
|
22
|
+
*/
|
|
23
|
+
actorId;
|
|
24
|
+
/**
|
|
25
|
+
* The node identifier associated with the audit entry, if applicable.
|
|
26
|
+
*/
|
|
27
|
+
nodeId;
|
|
28
|
+
/**
|
|
29
|
+
* The organization identifier associated with the audit entry, if applicable.
|
|
30
|
+
*/
|
|
31
|
+
organizationId;
|
|
32
|
+
/**
|
|
33
|
+
* The tenant identifier associated with the audit entry, if applicable.
|
|
34
|
+
*/
|
|
35
|
+
tenantId;
|
|
36
|
+
/**
|
|
37
|
+
* The hashed IP addresses of the client.
|
|
38
|
+
*/
|
|
39
|
+
ipAddressHashes;
|
|
40
|
+
/**
|
|
41
|
+
* The user agent string of the client.
|
|
42
|
+
*/
|
|
43
|
+
userAgent;
|
|
44
|
+
/**
|
|
45
|
+
* The correlation ID for request tracing.
|
|
46
|
+
*/
|
|
47
|
+
correlationId;
|
|
48
|
+
/**
|
|
49
|
+
* Additional data related to the audit entry, such as IP address, user agent, etc.
|
|
50
|
+
*/
|
|
51
|
+
data;
|
|
52
|
+
};
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ type: "string", isPrimary: true, maxLength: 255 }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AuthenticationAuditEntry.prototype, "id", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
property({
|
|
59
|
+
type: "string",
|
|
60
|
+
format: "date-time",
|
|
61
|
+
isSecondary: true,
|
|
62
|
+
indexGroup: [{ name: "actorDate", direction: SortDirection.Descending, index: 1 }]
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], AuthenticationAuditEntry.prototype, "dateCreated", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({
|
|
68
|
+
type: "string",
|
|
69
|
+
maxLength: 128,
|
|
70
|
+
isSecondary: true
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], AuthenticationAuditEntry.prototype, "event", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
property({
|
|
76
|
+
type: "string",
|
|
77
|
+
maxLength: 255,
|
|
78
|
+
isSecondary: true,
|
|
79
|
+
optional: true,
|
|
80
|
+
indexGroup: [{ name: "actorDate", direction: SortDirection.Ascending, index: 0 }]
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], AuthenticationAuditEntry.prototype, "actorId", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: "string", maxLength: 255, isSecondary: true, optional: true }),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], AuthenticationAuditEntry.prototype, "nodeId", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: "string", maxLength: 255, isSecondary: true, optional: true }),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], AuthenticationAuditEntry.prototype, "organizationId", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
property({
|
|
94
|
+
type: "string",
|
|
95
|
+
maxLength: 255,
|
|
96
|
+
isSecondary: true,
|
|
97
|
+
optional: true
|
|
98
|
+
}),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], AuthenticationAuditEntry.prototype, "tenantId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: "array", optional: true }),
|
|
103
|
+
__metadata("design:type", Array)
|
|
104
|
+
], AuthenticationAuditEntry.prototype, "ipAddressHashes", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
property({ type: "string", maxLength: 1024, optional: true }),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], AuthenticationAuditEntry.prototype, "userAgent", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: "string", maxLength: 255, optional: true }),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], AuthenticationAuditEntry.prototype, "correlationId", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: "object", optional: true }),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], AuthenticationAuditEntry.prototype, "data", void 0);
|
|
117
|
+
AuthenticationAuditEntry = __decorate([
|
|
118
|
+
entity()
|
|
119
|
+
], AuthenticationAuditEntry);
|
|
120
|
+
export { AuthenticationAuditEntry };
|
|
121
|
+
//# sourceMappingURL=authenticationAuditEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationAuditEntry.js","sourceRoot":"","sources":["../../../src/entities/authenticationAuditEntry.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;GAEG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACpC;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAOI,WAAW,CAAU;IAE5B;;OAEG;IAMI,KAAK,CAAU;IAEtB;;OAEG;IAQI,OAAO,CAAU;IAExB;;OAEG;IAEI,MAAM,CAAU;IAEvB;;OAEG;IAEI,cAAc,CAAU;IAE/B;;OAEG;IAOI,QAAQ,CAAU;IAEzB;;OAEG;IAEI,eAAe,CAAY;IAElC;;OAEG;IAEI,SAAS,CAAU;IAE1B;;OAEG;IAEI,aAAa,CAAU;IAE9B;;OAEG;IAEI,IAAI,CAAW;CACtB,CAAA;AAjFO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;oDAC3C;AAWZ;IANN,QAAQ,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAClF,CAAC;;6DAC0B;AAUrB;IALN,QAAQ,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;KACjB,CAAC;;uDACoB;AAYf;IAPN,QAAQ,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KACjF,CAAC;;yDACsB;AAMjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACzD;AAMhB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gEACjD;AAWxB;IANN,QAAQ,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;KACd,CAAC;;0DACuB;AAMlB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEACV;AAM3B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACpC;AAMnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DAC/B;AAMvB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACvB;AArFV,wBAAwB;IADpC,MAAM,EAAE;GACI,wBAAwB,CAsFpC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { SortDirection, entity, property } from \"@3sixty/entity\";\n\n/**\n * Class defining the storage for authentication audit entries.\n */\n@entity()\nexport class AuthenticationAuditEntry {\n\t/**\n\t * The unique identifier for the audit entry.\n\t */\n\t@property({ type: \"string\", isPrimary: true, maxLength: 255 })\n\tpublic id!: string;\n\n\t/**\n\t * The timestamp of the audit entry in ISO 8601 format.\n\t */\n\t@property({\n\t\ttype: \"string\",\n\t\tformat: \"date-time\",\n\t\tisSecondary: true,\n\t\tindexGroup: [{ name: \"actorDate\", direction: SortDirection.Descending, index: 1 }]\n\t})\n\tpublic dateCreated!: string;\n\n\t/**\n\t * The audit event that occurred.\n\t */\n\t@property({\n\t\ttype: \"string\",\n\t\tmaxLength: 128,\n\t\tisSecondary: true\n\t})\n\tpublic event!: string;\n\n\t/**\n\t * The actor identifier, could be e-mail, username, or other unique identifier.\n\t */\n\t@property({\n\t\ttype: \"string\",\n\t\tmaxLength: 255,\n\t\tisSecondary: true,\n\t\toptional: true,\n\t\tindexGroup: [{ name: \"actorDate\", direction: SortDirection.Ascending, index: 0 }]\n\t})\n\tpublic actorId?: string;\n\n\t/**\n\t * The node identifier associated with the audit entry, if applicable.\n\t */\n\t@property({ type: \"string\", maxLength: 255, isSecondary: true, optional: true })\n\tpublic nodeId?: string;\n\n\t/**\n\t * The organization identifier associated with the audit entry, if applicable.\n\t */\n\t@property({ type: \"string\", maxLength: 255, isSecondary: true, optional: true })\n\tpublic organizationId?: string;\n\n\t/**\n\t * The tenant identifier associated with the audit entry, if applicable.\n\t */\n\t@property({\n\t\ttype: \"string\",\n\t\tmaxLength: 255,\n\t\tisSecondary: true,\n\t\toptional: true\n\t})\n\tpublic tenantId?: string;\n\n\t/**\n\t * The hashed IP addresses of the client.\n\t */\n\t@property({ type: \"array\", optional: true })\n\tpublic ipAddressHashes?: string[];\n\n\t/**\n\t * The user agent string of the client.\n\t */\n\t@property({ type: \"string\", maxLength: 1024, optional: true })\n\tpublic userAgent?: string;\n\n\t/**\n\t * The correlation ID for request tracing.\n\t */\n\t@property({ type: \"string\", maxLength: 255, optional: true })\n\tpublic correlationId?: string;\n\n\t/**\n\t * Additional data related to the audit entry, such as IP address, user agent, etc.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic data?: unknown;\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { entity, property } from "@3sixty/entity";
|
|
4
|
+
/**
|
|
5
|
+
* Class defining the storage for authentication rate entries.
|
|
6
|
+
*/
|
|
7
|
+
let AuthenticationRateEntry = class AuthenticationRateEntry {
|
|
8
|
+
/**
|
|
9
|
+
* The id for the rate entry.
|
|
10
|
+
*/
|
|
11
|
+
id;
|
|
12
|
+
/**
|
|
13
|
+
* Array of ISO date strings representing timestamps of failed attempts.
|
|
14
|
+
*/
|
|
15
|
+
timestamps;
|
|
16
|
+
/**
|
|
17
|
+
* Last modification time in ISO date format.
|
|
18
|
+
*/
|
|
19
|
+
dateModified;
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
property({ type: "string", isPrimary: true, maxLength: 255 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], AuthenticationRateEntry.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
property({ type: "array", itemType: "string" }),
|
|
27
|
+
__metadata("design:type", Array)
|
|
28
|
+
], AuthenticationRateEntry.prototype, "timestamps", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
property({ type: "string", format: "date-time" }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AuthenticationRateEntry.prototype, "dateModified", void 0);
|
|
33
|
+
AuthenticationRateEntry = __decorate([
|
|
34
|
+
entity()
|
|
35
|
+
], AuthenticationRateEntry);
|
|
36
|
+
export { AuthenticationRateEntry };
|
|
37
|
+
//# sourceMappingURL=authenticationRateEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationRateEntry.js","sourceRoot":"","sources":["../../../src/entities/authenticationRateEntry.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACnC;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,UAAU,CAAY;IAE7B;;OAEG;IAEI,YAAY,CAAU;CAC7B,CAAA;AAbO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;mDAC3C;AAMZ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;;2DACnB;AAMtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;;6DACrB;AAjBjB,uBAAuB;IADnC,MAAM,EAAE;GACI,uBAAuB,CAkBnC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\n\n/**\n * Class defining the storage for authentication rate entries.\n */\n@entity()\nexport class AuthenticationRateEntry {\n\t/**\n\t * The id for the rate entry.\n\t */\n\t@property({ type: \"string\", isPrimary: true, maxLength: 255 })\n\tpublic id!: string;\n\n\t/**\n\t * Array of ISO date strings representing timestamps of failed attempts.\n\t */\n\t@property({ type: \"array\", itemType: \"string\" })\n\tpublic timestamps!: string[];\n\n\t/**\n\t * Last modification time in ISO date format.\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { entity, property } from "@3sixty/entity";
|
|
4
|
+
/**
|
|
5
|
+
* Class defining the storage for user login credentials.
|
|
6
|
+
*/
|
|
7
|
+
let AuthenticationUser = class AuthenticationUser {
|
|
8
|
+
/**
|
|
9
|
+
* The user e-mail address.
|
|
10
|
+
*/
|
|
11
|
+
email;
|
|
12
|
+
/**
|
|
13
|
+
* The encrypted password for the user.
|
|
14
|
+
*/
|
|
15
|
+
password;
|
|
16
|
+
/**
|
|
17
|
+
* The salt for the password.
|
|
18
|
+
*/
|
|
19
|
+
salt;
|
|
20
|
+
/**
|
|
21
|
+
* The user identity.
|
|
22
|
+
*/
|
|
23
|
+
identity;
|
|
24
|
+
/**
|
|
25
|
+
* The users organization.
|
|
26
|
+
*/
|
|
27
|
+
organization;
|
|
28
|
+
/**
|
|
29
|
+
* The scope assigned to the user, comma separated.
|
|
30
|
+
*/
|
|
31
|
+
scope;
|
|
32
|
+
/**
|
|
33
|
+
* The password version counter, incremented on every password change to invalidate existing tokens.
|
|
34
|
+
*/
|
|
35
|
+
passwordVersion;
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: "string", format: "email", isPrimary: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AuthenticationUser.prototype, "email", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ type: "string" }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AuthenticationUser.prototype, "password", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ type: "string" }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], AuthenticationUser.prototype, "salt", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
property({ type: "string", maxLength: 255, isSecondary: true }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AuthenticationUser.prototype, "identity", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ type: "string", maxLength: 255 }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AuthenticationUser.prototype, "organization", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
property({ type: "string", maxLength: 4096 }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], AuthenticationUser.prototype, "scope", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
property({ type: "integer", optional: true }),
|
|
63
|
+
__metadata("design:type", Number)
|
|
64
|
+
], AuthenticationUser.prototype, "passwordVersion", void 0);
|
|
65
|
+
AuthenticationUser = __decorate([
|
|
66
|
+
entity()
|
|
67
|
+
], AuthenticationUser);
|
|
68
|
+
export { AuthenticationUser };
|
|
69
|
+
//# sourceMappingURL=authenticationUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationUser.js","sourceRoot":"","sources":["../../../src/entities/authenticationUser.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC9B;;OAEG;IAEI,KAAK,CAAU;IAEtB;;OAEG;IAEI,QAAQ,CAAU;IAEzB;;OAEG;IAEI,IAAI,CAAU;IAErB;;OAEG;IAEI,QAAQ,CAAU;IAEzB;;OAEG;IAEI,YAAY,CAAU;IAE7B;;OAEG;IAEI,KAAK,CAAU;IAEtB;;OAEG;IAEI,eAAe,CAAU;CAChC,CAAA;AArCO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;iDACzC;AAMf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;oDACJ;AAMlB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;gDACR;AAMd;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;;oDACvC;AAMlB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;wDAChB;AAMtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;iDACxB;AAMf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACd;AAzCpB,kBAAkB;IAD9B,MAAM,EAAE;GACI,kBAAkB,CA0C9B","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\n\n/**\n * Class defining the storage for user login credentials.\n */\n@entity()\nexport class AuthenticationUser {\n\t/**\n\t * The user e-mail address.\n\t */\n\t@property({ type: \"string\", format: \"email\", isPrimary: true })\n\tpublic email!: string;\n\n\t/**\n\t * The encrypted password for the user.\n\t */\n\t@property({ type: \"string\" })\n\tpublic password!: string;\n\n\t/**\n\t * The salt for the password.\n\t */\n\t@property({ type: \"string\" })\n\tpublic salt!: string;\n\n\t/**\n\t * The user identity.\n\t */\n\t@property({ type: \"string\", maxLength: 255, isSecondary: true })\n\tpublic identity!: string;\n\n\t/**\n\t * The users organization.\n\t */\n\t@property({ type: \"string\", maxLength: 255 })\n\tpublic organization!: string;\n\n\t/**\n\t * The scope assigned to the user, comma separated.\n\t */\n\t@property({ type: \"string\", maxLength: 4096 })\n\tpublic scope!: string;\n\n\t/**\n\t * The password version counter, incremented on every password change to invalidate existing tokens.\n\t */\n\t@property({ type: \"integer\", optional: true })\n\tpublic passwordVersion?: number;\n}\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./entities/authenticationAuditEntry.js";
|
|
4
|
+
export * from "./entities/authenticationRateEntry.js";
|
|
5
|
+
export * from "./entities/authenticationUser.js";
|
|
6
|
+
export * from "./models/IAuthHeaderProcessorConfig.js";
|
|
7
|
+
export * from "./models/IAuthHeaderProcessorConstructorOptions.js";
|
|
8
|
+
export * from "./models/IAuthTokenContext.js";
|
|
9
|
+
export * from "./models/IEntityStorageAuthenticationAdminServiceConfig.js";
|
|
10
|
+
export * from "./models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js";
|
|
11
|
+
export * from "./models/IEntityStorageAuthenticationAuditServiceConfig.js";
|
|
12
|
+
export * from "./models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js";
|
|
13
|
+
export * from "./models/IEntityStorageAuthenticationRateServiceConfig.js";
|
|
14
|
+
export * from "./models/IEntityStorageAuthenticationRateServiceConstructorOptions.js";
|
|
15
|
+
export * from "./models/IEntityStorageAuthenticationServiceConfig.js";
|
|
16
|
+
export * from "./models/IEntityStorageAuthenticationServiceConstructorOptions.js";
|
|
17
|
+
export * from "./processors/authHeaderProcessor.js";
|
|
18
|
+
export * from "./restEntryPoints.js";
|
|
19
|
+
export * from "./routes/entityStorageAuthenticationAdminRoutes.js";
|
|
20
|
+
export * from "./routes/entityStorageAuthenticationAuditRoutes.js";
|
|
21
|
+
export * from "./routes/entityStorageAuthenticationRoutes.js";
|
|
22
|
+
export * from "./schema.js";
|
|
23
|
+
export * from "./services/entityStorageAuthenticationAdminService.js";
|
|
24
|
+
export * from "./services/entityStorageAuthenticationAuditService.js";
|
|
25
|
+
export * from "./services/entityStorageAuthenticationRateService.js";
|
|
26
|
+
export * from "./services/entityStorageAuthenticationService.js";
|
|
27
|
+
export * from "./utils/tokenHelper.js";
|
|
28
|
+
export * from "./utils/passwordHelper.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4DAA4D,CAAC;AAC3E,cAAc,wEAAwE,CAAC;AACvF,cAAc,4DAA4D,CAAC;AAC3E,cAAc,wEAAwE,CAAC;AACvF,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uEAAuE,CAAC;AACtF,cAAc,uDAAuD,CAAC;AACtE,cAAc,mEAAmE,CAAC;AAClF,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,aAAa,CAAC;AAC5B,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entities/authenticationAuditEntry.js\";\nexport * from \"./entities/authenticationRateEntry.js\";\nexport * from \"./entities/authenticationUser.js\";\nexport * from \"./models/IAuthHeaderProcessorConfig.js\";\nexport * from \"./models/IAuthHeaderProcessorConstructorOptions.js\";\nexport * from \"./models/IAuthTokenContext.js\";\nexport * from \"./models/IEntityStorageAuthenticationAdminServiceConfig.js\";\nexport * from \"./models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js\";\nexport * from \"./models/IEntityStorageAuthenticationAuditServiceConfig.js\";\nexport * from \"./models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js\";\nexport * from \"./models/IEntityStorageAuthenticationRateServiceConfig.js\";\nexport * from \"./models/IEntityStorageAuthenticationRateServiceConstructorOptions.js\";\nexport * from \"./models/IEntityStorageAuthenticationServiceConfig.js\";\nexport * from \"./models/IEntityStorageAuthenticationServiceConstructorOptions.js\";\nexport * from \"./processors/authHeaderProcessor.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./routes/entityStorageAuthenticationAdminRoutes.js\";\nexport * from \"./routes/entityStorageAuthenticationAuditRoutes.js\";\nexport * from \"./routes/entityStorageAuthenticationRoutes.js\";\nexport * from \"./schema.js\";\nexport * from \"./services/entityStorageAuthenticationAdminService.js\";\nexport * from \"./services/entityStorageAuthenticationAuditService.js\";\nexport * from \"./services/entityStorageAuthenticationRateService.js\";\nexport * from \"./services/entityStorageAuthenticationService.js\";\nexport * from \"./utils/tokenHelper.js\";\nexport * from \"./utils/passwordHelper.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthHeaderProcessorConfig.js","sourceRoot":"","sources":["../../../src/models/IAuthHeaderProcessorConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the authentication header processor\n */\nexport interface IAuthHeaderProcessorConfig {\n\t/**\n\t * The name of the key to retrieve from the vault for signing JWT.\n\t * @default auth-signing\n\t */\n\tsigningKeyName?: string;\n\n\t/**\n\t * The name of the cookie to use for the token.\n\t * @default access_token\n\t */\n\tcookieName?: string;\n\n\t/**\n\t * Include the stack with errors.\n\t */\n\tincludeErrorStack?: boolean;\n\n\t/**\n\t * The time in milliseconds a verified token is kept in the in-memory cache, counted from when it\n\t * was verified and not extended by use, set to 0 to disable caching. A hit skips the vault\n\t * signature check, the tenant lookup and the user lookup, so this is also the longest a password\n\t * change, a user removal or a signing key rotation can go unnoticed. An entry never outlives the\n\t * expiry claim of its own token either. The scopes a route requires are still checked for every\n\t * request.\n\t * @default 30000\n\t */\n\ttokenCacheTtlMs?: number;\n\n\t/**\n\t * The maximum number of verified tokens to hold in the in-memory cache.\n\t * @default undefined (LfuCache default)\n\t */\n\ttokenCacheCapacity?: number;\n\n\t/**\n\t * Maximum time in milliseconds to wait for the token cache mutex during a cache population.\n\t * @default undefined (LfuCache default)\n\t */\n\ttokenCacheMutexTimeoutMs?: number;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthHeaderProcessorConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IAuthHeaderProcessorConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConfig } from \"./IAuthHeaderProcessorConfig.js\";\n\n/**\n * Options for the AuthHeaderProcessor constructor.\n */\nexport interface IAuthHeaderProcessorConstructorOptions {\n\t/**\n\t * The entity storage for users.\n\t * @default authentication-user\n\t */\n\tuserEntityStorageType?: string;\n\n\t/**\n\t * The vault for the private keys.\n\t * @default vault\n\t */\n\tvaultConnectorType?: string;\n\n\t/**\n\t * The component to retrieve tenant information.\n\t * @default tenant-admin\n\t */\n\ttenantAdminComponentType?: string;\n\n\t/**\n\t * The configuration for the processor.\n\t */\n\tconfig?: IAuthHeaderProcessorConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthTokenContext.js","sourceRoot":"","sources":["../../../src/models/IAuthTokenContext.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The context resolved from an access token, everything a request needs that does not depend on\n * the route being called.\n */\nexport interface IAuthTokenContext {\n\t/**\n\t * The tenant id from the token, if it carried one.\n\t */\n\ttenantId?: string;\n\n\t/**\n\t * The organization id of the tenant the token belongs to.\n\t */\n\ttenantOrganizationId?: string;\n\n\t/**\n\t * The public origin of the tenant the token belongs to.\n\t */\n\ttenantPublicOrigin?: string;\n\n\t/**\n\t * The identity of the verified user.\n\t */\n\tuserIdentity?: string;\n\n\t/**\n\t * The organization of the verified user.\n\t */\n\tuserOrganization?: string;\n\n\t/**\n\t * The comma separated scopes carried by the token.\n\t */\n\tscope?: string;\n\n\t/**\n\t * The expiry of the token in milliseconds since the epoch, if it carried one.\n\t */\n\texpires?: number;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationAdminServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationAdminServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the entity storage authentication admin service.\n */\nexport interface IEntityStorageAuthenticationAdminServiceConfig {\n\t/**\n\t * The minimum password length.\n\t * @default 8\n\t */\n\tminPasswordLength?: number;\n\n\t/**\n\t * The scope value that grants escalated privilege to assign privileged roles. Defaults to \"global-admin\".\n\t */\n\tescalatedPrivilegeScope?: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationAdminServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationAdminServiceConfig } from \"./IEntityStorageAuthenticationAdminServiceConfig.js\";\n\n/**\n * Options for the EntityStorageAuthenticationAdminService constructor.\n */\nexport interface IEntityStorageAuthenticationAdminServiceConstructorOptions {\n\t/**\n\t * The entity storage for the users.\n\t * @default authentication-user\n\t */\n\tuserEntityStorageType?: string;\n\n\t/**\n\t * The audit service.\n\t * @default authentication-audit\n\t */\n\tauthenticationAuditServiceType?: string;\n\n\t/**\n\t * The configuration for the authentication.\n\t */\n\tconfig?: IEntityStorageAuthenticationAdminServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationAuditServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationAuditServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Config for the EntityStorageAuthenticationAuditService constructor.\n */\nexport interface IEntityStorageAuthenticationAuditServiceConfig {\n\t/**\n\t * The server-side salt for hashing IP addresses in audit logs, if configured.\n\t */\n\tipHashSalt?: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationAuditServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationAuditServiceConfig } from \"./IEntityStorageAuthenticationAuditServiceConfig.js\";\n\n/**\n * Options for the EntityStorageAuthenticationAuditService constructor.\n */\nexport interface IEntityStorageAuthenticationAuditServiceConstructorOptions {\n\t/**\n\t * The entity storage for the audit entries.\n\t * @default authentication-audit-entry\n\t */\n\tauthenticationAuditEntryStorageType?: string;\n\n\t/**\n\t * The configuration for the authentication audit service.\n\t */\n\tconfig?: IEntityStorageAuthenticationAuditServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationRateServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationRateServiceConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n/**\n * Configuration for the entity storage authentication rate service.\n */\nexport interface IEntityStorageAuthenticationRateServiceConfig {\n\t/**\n\t * Interval between cleanup runs in minutes.\n\t * @default 5\n\t */\n\tcleanupIntervalMinutes?: number;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationRateServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationRateServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationRateServiceConfig } from \"./IEntityStorageAuthenticationRateServiceConfig.js\";\n\n/**\n * Options for the EntityStorageAuthenticationRateService constructor.\n */\nexport interface IEntityStorageAuthenticationRateServiceConstructorOptions {\n\t/**\n\t * The entity storage for authentication rate entries.\n\t * @default authentication-rate-entry\n\t */\n\tauthenticationRateEntryStorageType?: string;\n\n\t/**\n\t * The task scheduler component type.\n\t * @default task-scheduler\n\t */\n\ttaskSchedulerComponentType?: string;\n\n\t/**\n\t * The platform component type, used to run the periodic cleanup per tenant.\n\t * @default platform\n\t */\n\tplatformComponentType?: string;\n\n\t/**\n\t * The configuration for the authentication rate service.\n\t */\n\tconfig?: IEntityStorageAuthenticationRateServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationServiceConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationRateActionConfig } from \"@3sixty/api-auth-entity-storage-models\";\n\n/**\n * Configuration for the entity storage authentication service.\n */\nexport interface IEntityStorageAuthenticationServiceConfig {\n\t/**\n\t * The name of the key to retrieve from the vault for signing JWT.\n\t * @default auth-signing\n\t */\n\tsigningKeyName?: string;\n\n\t/**\n\t * The default time to live for the JWT.\n\t * @default 60\n\t */\n\tdefaultTtlMinutes?: number;\n\n\t/**\n\t * The minimum password length for new password validation.\n\t * @default 8\n\t */\n\tminPasswordLength?: number;\n\n\t/**\n\t * Optional override for login failure rate limit.\n\t * @default { maxAttempts: 5, windowMinutes: 15 }\n\t */\n\tloginRateLimit?: IAuthenticationRateActionConfig;\n\n\t/**\n\t * Optional override for password change rate limit.\n\t * @default { maxAttempts: 5, windowMinutes: 15 }\n\t */\n\tpasswordChangeRateLimit?: IAuthenticationRateActionConfig;\n\n\t/**\n\t * Optional override for token refresh rate limit.\n\t * @default { maxAttempts: 30, windowMinutes: 60 }\n\t */\n\ttokenRefreshRateLimit?: IAuthenticationRateActionConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityStorageAuthenticationServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageAuthenticationServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationServiceConfig } from \"./IEntityStorageAuthenticationServiceConfig.js\";\n\n/**\n * Options for the EntityStorageAuthenticationService constructor.\n */\nexport interface IEntityStorageAuthenticationServiceConstructorOptions {\n\t/**\n\t * The entity storage for the users.\n\t * @default authentication-user\n\t */\n\tuserEntityStorageType?: string;\n\n\t/**\n\t * The vault for the private keys.\n\t * @default vault\n\t */\n\tvaultConnectorType?: string;\n\n\t/**\n\t * The audit service.\n\t * @default authentication-audit\n\t */\n\tauthenticationAuditServiceType?: string;\n\n\t/**\n\t * The rate service.\n\t * @default authentication-rate\n\t */\n\tauthenticationRateServiceType?: string;\n\n\t/**\n\t * The component to retrieve tenant information.\n\t * @default tenant-admin\n\t */\n\ttenantAdminComponentType?: string;\n\n\t/**\n\t * The configuration for the authentication.\n\t */\n\tconfig?: IEntityStorageAuthenticationServiceConfig;\n}\n"]}
|