@3sixty/api-auth-models 0.20.0-next.0 → 0.20.0-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.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/index.js +15 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IAuthenticationAuditComponent.js +2 -0
- package/dist/es/models/IAuthenticationAuditComponent.js.map +1 -0
- package/dist/es/models/IAuthenticationAuditEntry.js +2 -0
- package/dist/es/models/IAuthenticationAuditEntry.js.map +1 -0
- package/dist/es/models/IAuthenticationRateActionConfig.js +4 -0
- package/dist/es/models/IAuthenticationRateActionConfig.js.map +1 -0
- package/dist/es/models/IAuthenticationRateComponent.js +2 -0
- package/dist/es/models/IAuthenticationRateComponent.js.map +1 -0
- package/dist/es/models/api/IAuditCreateRequest.js +2 -0
- package/dist/es/models/api/IAuditCreateRequest.js.map +1 -0
- package/dist/es/models/api/IAuditGetRequest.js +4 -0
- package/dist/es/models/api/IAuditGetRequest.js.map +1 -0
- package/dist/es/models/api/IAuditGetResponse.js +2 -0
- package/dist/es/models/api/IAuditGetResponse.js.map +1 -0
- package/dist/es/models/api/IAuditQueryRequest.js +2 -0
- package/dist/es/models/api/IAuditQueryRequest.js.map +1 -0
- package/dist/es/models/api/IAuditQueryResponse.js +2 -0
- package/dist/es/models/api/IAuditQueryResponse.js.map +1 -0
- package/dist/es/models/api/IAuditRemoveRequest.js +4 -0
- package/dist/es/models/api/IAuditRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IAuditUpdateRequest.js +2 -0
- package/dist/es/models/api/IAuditUpdateRequest.js.map +1 -0
- package/dist/es/models/authAuditEvent.js +49 -0
- package/dist/es/models/authAuditEvent.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/models/IAuthenticationAuditComponent.d.ts +59 -0
- package/dist/types/models/IAuthenticationAuditEntry.d.ts +50 -0
- package/dist/types/models/IAuthenticationRateActionConfig.d.ts +13 -0
- package/dist/types/models/IAuthenticationRateComponent.d.ts +46 -0
- package/dist/types/models/api/IAuditCreateRequest.d.ts +10 -0
- package/dist/types/models/api/IAuditGetRequest.d.ts +14 -0
- package/dist/types/models/api/IAuditGetResponse.d.ts +10 -0
- package/dist/types/models/api/IAuditQueryRequest.d.ts +47 -0
- package/dist/types/models/api/IAuditQueryResponse.d.ts +19 -0
- package/dist/types/models/api/IAuditRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/IAuditUpdateRequest.d.ts +19 -0
- package/dist/types/models/authAuditEvent.d.ts +49 -0
- package/docs/changelog.md +10 -0
- package/docs/examples.md +60 -0
- package/docs/reference/index.md +23 -0
- package/docs/reference/interfaces/IAuditCreateRequest.md +11 -0
- package/docs/reference/interfaces/IAuditGetRequest.md +17 -0
- package/docs/reference/interfaces/IAuditGetResponse.md +11 -0
- package/docs/reference/interfaces/IAuditQueryRequest.md +65 -0
- package/docs/reference/interfaces/IAuditQueryResponse.md +23 -0
- package/docs/reference/interfaces/IAuditRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IAuditUpdateRequest.md +25 -0
- package/docs/reference/interfaces/IAuthenticationAuditComponent.md +175 -0
- package/docs/reference/interfaces/IAuthenticationAuditEntry.md +91 -0
- package/docs/reference/interfaces/IAuthenticationRateActionConfig.md +19 -0
- package/docs/reference/interfaces/IAuthenticationRateComponent.md +165 -0
- package/docs/reference/type-aliases/AuthAuditEvent.md +5 -0
- package/docs/reference/variables/AuthAuditEvent.md +67 -0
- package/locales/en.json +1 -0
- package/package.json +53 -6
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 Models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides contracts for authentication audit and rate limiting.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @3sixty/api-auth-models
|
|
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-auth](https://github.com/iotaledger/twin-api-auth/tree/feature/authorization/packages/api-auth-models) repository.
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./models/api/IAuditCreateRequest.js";
|
|
4
|
+
export * from "./models/api/IAuditGetRequest.js";
|
|
5
|
+
export * from "./models/api/IAuditGetResponse.js";
|
|
6
|
+
export * from "./models/api/IAuditQueryRequest.js";
|
|
7
|
+
export * from "./models/api/IAuditQueryResponse.js";
|
|
8
|
+
export * from "./models/api/IAuditRemoveRequest.js";
|
|
9
|
+
export * from "./models/api/IAuditUpdateRequest.js";
|
|
10
|
+
export * from "./models/authAuditEvent.js";
|
|
11
|
+
export * from "./models/IAuthenticationAuditComponent.js";
|
|
12
|
+
export * from "./models/IAuthenticationAuditEntry.js";
|
|
13
|
+
export * from "./models/IAuthenticationRateActionConfig.js";
|
|
14
|
+
export * from "./models/IAuthenticationRateComponent.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./models/api/IAuditCreateRequest.js\";\nexport * from \"./models/api/IAuditGetRequest.js\";\nexport * from \"./models/api/IAuditGetResponse.js\";\nexport * from \"./models/api/IAuditQueryRequest.js\";\nexport * from \"./models/api/IAuditQueryResponse.js\";\nexport * from \"./models/api/IAuditRemoveRequest.js\";\nexport * from \"./models/api/IAuditUpdateRequest.js\";\nexport * from \"./models/authAuditEvent.js\";\nexport * from \"./models/IAuthenticationAuditComponent.js\";\nexport * from \"./models/IAuthenticationAuditEntry.js\";\nexport * from \"./models/IAuthenticationRateActionConfig.js\";\nexport * from \"./models/IAuthenticationRateComponent.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthenticationAuditComponent.js","sources":["../../../src/models/IAuthenticationAuditComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { AuthAuditEvent } from \"./authAuditEvent.js\";\nimport type { IAuthenticationAuditEntry } from \"./IAuthenticationAuditEntry.js\";\n\n/**\n * Contract definition for authentication audit component.\n */\nexport interface IAuthenticationAuditComponent extends IComponent {\n\t/**\n\t * Create a new audit entry.\n\t * @param entry The audit entry to be logged.\n\t * @returns The unique identifier of the created audit entry.\n\t */\n\tcreate(entry: Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">): Promise<string>;\n\n\t/**\n\t * Get an audit entry by id.\n\t * @param id The unique identifier of the audit entry.\n\t * @returns The audit entry.\n\t */\n\tget(id: string): Promise<IAuthenticationAuditEntry>;\n\n\t/**\n\t * Update an audit entry.\n\t * @param id The unique identifier of the audit entry to update.\n\t * @param entry The fields to update on the audit entry.\n\t * @returns A promise that resolves when the audit entry has been updated.\n\t */\n\tupdate(\n\t\tid: string,\n\t\tentry: Partial<Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">>\n\t): Promise<void>;\n\n\t/**\n\t * Remove an audit entry.\n\t * @param id The unique identifier of the audit entry to remove.\n\t * @returns A promise that resolves when the audit entry has been removed.\n\t */\n\tremove(id: string): Promise<void>;\n\n\t/**\n\t * Query the audit entries.\n\t * @param options The query options.\n\t * @param options.actorId The actor identifier to filter the audit entries, optional.\n\t * @param options.organizationId The organisation identifier to filter the audit entries, optional.\n\t * @param options.tenantId The tenant identifier to filter the audit entries, optional.\n\t * @param options.nodeId The node identifier to filter the audit entries, optional.\n\t * @param options.event The audit event to filter the audit entries, optional.\n\t * @param options.startDate The start date to filter the audit entries, optional.\n\t * @param options.endDate The end date to filter the audit entries, optional.\n\t * @param cursor The cursor for pagination.\n\t * @param limit The maximum number of entries to return.\n\t * @returns The audit entries.\n\t */\n\tquery(\n\t\toptions?: {\n\t\t\tactorId?: string;\n\t\t\torganizationId?: string;\n\t\t\ttenantId?: string;\n\t\t\tnodeId?: string;\n\t\t\tevent?: AuthAuditEvent | string;\n\t\t\tstartDate?: string;\n\t\t\tendDate?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuthenticationAuditEntry[];\n\t\tcursor?: string;\n\t}>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthenticationAuditEntry.js","sources":["../../../src/models/IAuthenticationAuditEntry.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AuthAuditEvent } from \"./authAuditEvent.js\";\n\n/**\n * Contract definition for authentication audit entry.\n */\nexport interface IAuthenticationAuditEntry {\n\t/**\n\t * The unique identifier for the audit entry.\n\t */\n\tid: string;\n\n\t/**\n\t * The audit event that occurred.\n\t */\n\tevent: AuthAuditEvent | string;\n\n\t/**\n\t * The timestamp of the audit entry in ISO 8601 format.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The actor identifier, could be e-mail, username, or other unique identifier.\n\t */\n\tactorId?: string;\n\n\t/**\n\t * The node identifier associated with the audit entry, if applicable.\n\t */\n\tnodeId?: string;\n\n\t/**\n\t * The organization identifier associated with the audit entry, if applicable.\n\t */\n\torganizationId?: string;\n\n\t/**\n\t * The tenant identifier associated with the audit entry, if applicable.\n\t */\n\ttenantId?: string;\n\n\t/**\n\t * The hashed IP addresses of the client.\n\t */\n\tipAddressHashes?: string[];\n\n\t/**\n\t * The user agent string of the client.\n\t */\n\tuserAgent?: string;\n\n\t/**\n\t * The correlation ID for request tracing.\n\t */\n\tcorrelationId?: string;\n\n\t/**\n\t * Additional data related to the audit entry, such as IP address, user agent, etc.\n\t */\n\tdata?: unknown;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthenticationRateActionConfig.js","sources":["../../../src/models/IAuthenticationRateActionConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for an authentication rate limited action.\n */\nexport interface IAuthenticationRateActionConfig {\n\t/**\n\t * Maximum number of failed attempts allowed per window.\n\t */\n\tmaxAttempts: number;\n\n\t/**\n\t * Rate limit window duration in minutes.\n\t */\n\twindowMinutes: number;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthenticationRateComponent.js","sources":["../../../src/models/IAuthenticationRateComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IAuthenticationRateActionConfig } from \"./IAuthenticationRateActionConfig.js\";\n\n/**\n * Contract definition for authentication rate component.\n */\nexport interface IAuthenticationRateComponent extends IComponent {\n\t/**\n\t * The service needs to be started when the application is initialized.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns A promise that resolves when the service has been started.\n\t */\n\tstart(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * The component needs to be stopped when the node is closed.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns A promise that resolves when the service has been stopped.\n\t */\n\tstop(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * Register or update rate-limit configuration for an action.\n\t * @param action The action name.\n\t * @param config The action configuration.\n\t * @returns A promise that resolves when the action configuration has been stored.\n\t */\n\tregisterAction(action: string, config: IAuthenticationRateActionConfig): Promise<void>;\n\n\t/**\n\t * Unregister rate-limit configuration for an action.\n\t * @param action The action name.\n\t * @returns A promise that resolves when the action configuration has been removed.\n\t */\n\tunregisterAction(action: string): Promise<void>;\n\n\t/**\n\t * Check the authentication rate for a given action and identifier.\n\t * @param action The action to be checked.\n\t * @param identifier The identifier to be checked.\n\t * @returns The result of the rate check.\n\t */\n\tcheck(action: string, identifier: string): Promise<string>;\n\n\t/**\n\t * Clear the authentication rate entry for the given action and identifier.\n\t * @param action The action to clear.\n\t * @param identifier The identifier to clear.\n\t * @returns A promise that resolves when the rate entry has been removed.\n\t */\n\tclear(action: string, identifier: string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditCreateRequest.js","sources":["../../../../src/models/api/IAuditCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Create an authentication audit entry.\n */\nexport interface IAuditCreateRequest {\n\t/**\n\t * The body of the request.\n\t */\n\tbody: Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditGetRequest.js","sources":["../../../../src/models/api/IAuditGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get an authentication audit entry by id.\n */\nexport interface IAuditGetRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The audit entry id.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditGetResponse.js","sources":["../../../../src/models/api/IAuditGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Response from getting an authentication audit entry.\n */\nexport interface IAuditGetResponse {\n\t/**\n\t * The response body.\n\t */\n\tbody: IAuthenticationAuditEntry;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditQueryRequest.js","sources":["../../../../src/models/api/IAuditQueryRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AuthAuditEvent } from \"../authAuditEvent.js\";\n\n/**\n * Query authentication audit entries.\n */\nexport interface IAuditQueryRequest {\n\t/**\n\t * The query parameters for the request.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The actor identifier to filter by.\n\t\t */\n\t\tactorId?: string;\n\n\t\t/**\n\t\t * The organisation identifier to filter by.\n\t\t */\n\t\torganizationId?: string;\n\n\t\t/**\n\t\t * The tenant identifier to filter by.\n\t\t */\n\t\ttenantId?: string;\n\n\t\t/**\n\t\t * The node identifier to filter by.\n\t\t */\n\t\tnodeId?: string;\n\n\t\t/**\n\t\t * The event to filter by.\n\t\t */\n\t\tevent?: AuthAuditEvent | string;\n\n\t\t/**\n\t\t * The inclusive start date for filtering, in ISO 8601 format.\n\t\t */\n\t\tstartDate?: string;\n\n\t\t/**\n\t\t * The inclusive end date for filtering, in ISO 8601 format.\n\t\t */\n\t\tendDate?: string;\n\n\t\t/**\n\t\t * The pagination cursor.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * The maximum number of results to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditQueryResponse.js","sources":["../../../../src/models/api/IAuditQueryResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Response from querying authentication audit entries.\n */\nexport interface IAuditQueryResponse {\n\t/**\n\t * The response body.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The returned audit entries.\n\t\t */\n\t\tentries: IAuthenticationAuditEntry[];\n\n\t\t/**\n\t\t * The cursor to retrieve the next page, if any.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditRemoveRequest.js","sources":["../../../../src/models/api/IAuditRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove an authentication audit entry.\n */\nexport interface IAuditRemoveRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The audit entry id.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuditUpdateRequest.js","sources":["../../../../src/models/api/IAuditUpdateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Update an authentication audit entry.\n */\nexport interface IAuditUpdateRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The audit entry id.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The body of the request.\n\t */\n\tbody: Partial<Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">>;\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Supported authentication audit events.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const AuthAuditEvent = {
|
|
8
|
+
/**
|
|
9
|
+
* Login success.
|
|
10
|
+
*/
|
|
11
|
+
LoginSuccess: "login-success",
|
|
12
|
+
/**
|
|
13
|
+
* Login failure.
|
|
14
|
+
*/
|
|
15
|
+
LoginFailure: "login-failure",
|
|
16
|
+
/**
|
|
17
|
+
* Logout.
|
|
18
|
+
*/
|
|
19
|
+
Logout: "logout",
|
|
20
|
+
/**
|
|
21
|
+
* Token refreshed.
|
|
22
|
+
*/
|
|
23
|
+
TokenRefreshed: "token-refreshed",
|
|
24
|
+
/**
|
|
25
|
+
* Account created.
|
|
26
|
+
*/
|
|
27
|
+
AccountCreated: "account-created",
|
|
28
|
+
/**
|
|
29
|
+
* Account deleted.
|
|
30
|
+
*/
|
|
31
|
+
AccountDeleted: "account-deleted",
|
|
32
|
+
/**
|
|
33
|
+
* Account updated.
|
|
34
|
+
*/
|
|
35
|
+
AccountUpdated: "account-updated",
|
|
36
|
+
/**
|
|
37
|
+
* Account locked.
|
|
38
|
+
*/
|
|
39
|
+
AccountLocked: "account-locked",
|
|
40
|
+
/**
|
|
41
|
+
* Account unlocked.
|
|
42
|
+
*/
|
|
43
|
+
AccountUnlocked: "account-unlocked",
|
|
44
|
+
/**
|
|
45
|
+
* Password changed.
|
|
46
|
+
*/
|
|
47
|
+
PasswordChanged: "password-changed"
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=authAuditEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authAuditEvent.js","sources":["../../../src/models/authAuditEvent.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAE/B;;OAEG;IACH,eAAe,EAAE,kBAAkB;IAEnC;;OAEG;IACH,eAAe,EAAE,kBAAkB;CAC1B,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Supported authentication audit events.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthAuditEvent = {\n\t/**\n\t * Login success.\n\t */\n\tLoginSuccess: \"login-success\",\n\n\t/**\n\t * Login failure.\n\t */\n\tLoginFailure: \"login-failure\",\n\n\t/**\n\t * Logout.\n\t */\n\tLogout: \"logout\",\n\n\t/**\n\t * Token refreshed.\n\t */\n\tTokenRefreshed: \"token-refreshed\",\n\n\t/**\n\t * Account created.\n\t */\n\tAccountCreated: \"account-created\",\n\n\t/**\n\t * Account deleted.\n\t */\n\tAccountDeleted: \"account-deleted\",\n\n\t/**\n\t * Account updated.\n\t */\n\tAccountUpdated: \"account-updated\",\n\n\t/**\n\t * Account locked.\n\t */\n\tAccountLocked: \"account-locked\",\n\n\t/**\n\t * Account unlocked.\n\t */\n\tAccountUnlocked: \"account-unlocked\",\n\n\t/**\n\t * Password changed.\n\t */\n\tPasswordChanged: \"password-changed\"\n} as const;\n\n/**\n * Supported authentication audit event values.\n */\nexport type AuthAuditEvent = (typeof AuthAuditEvent)[keyof typeof AuthAuditEvent];\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./models/api/IAuditCreateRequest.js";
|
|
2
|
+
export * from "./models/api/IAuditGetRequest.js";
|
|
3
|
+
export * from "./models/api/IAuditGetResponse.js";
|
|
4
|
+
export * from "./models/api/IAuditQueryRequest.js";
|
|
5
|
+
export * from "./models/api/IAuditQueryResponse.js";
|
|
6
|
+
export * from "./models/api/IAuditRemoveRequest.js";
|
|
7
|
+
export * from "./models/api/IAuditUpdateRequest.js";
|
|
8
|
+
export * from "./models/authAuditEvent.js";
|
|
9
|
+
export * from "./models/IAuthenticationAuditComponent.js";
|
|
10
|
+
export * from "./models/IAuthenticationAuditEntry.js";
|
|
11
|
+
export * from "./models/IAuthenticationRateActionConfig.js";
|
|
12
|
+
export * from "./models/IAuthenticationRateComponent.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { IComponent } from "@3sixty/core";
|
|
2
|
+
import type { AuthAuditEvent } from "./authAuditEvent.js";
|
|
3
|
+
import type { IAuthenticationAuditEntry } from "./IAuthenticationAuditEntry.js";
|
|
4
|
+
/**
|
|
5
|
+
* Contract definition for authentication audit component.
|
|
6
|
+
*/
|
|
7
|
+
export interface IAuthenticationAuditComponent extends IComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new audit entry.
|
|
10
|
+
* @param entry The audit entry to be logged.
|
|
11
|
+
* @returns The unique identifier of the created audit entry.
|
|
12
|
+
*/
|
|
13
|
+
create(entry: Omit<IAuthenticationAuditEntry, "id" | "dateCreated">): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Get an audit entry by id.
|
|
16
|
+
* @param id The unique identifier of the audit entry.
|
|
17
|
+
* @returns The audit entry.
|
|
18
|
+
*/
|
|
19
|
+
get(id: string): Promise<IAuthenticationAuditEntry>;
|
|
20
|
+
/**
|
|
21
|
+
* Update an audit entry.
|
|
22
|
+
* @param id The unique identifier of the audit entry to update.
|
|
23
|
+
* @param entry The fields to update on the audit entry.
|
|
24
|
+
* @returns A promise that resolves when the audit entry has been updated.
|
|
25
|
+
*/
|
|
26
|
+
update(id: string, entry: Partial<Omit<IAuthenticationAuditEntry, "id" | "dateCreated">>): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Remove an audit entry.
|
|
29
|
+
* @param id The unique identifier of the audit entry to remove.
|
|
30
|
+
* @returns A promise that resolves when the audit entry has been removed.
|
|
31
|
+
*/
|
|
32
|
+
remove(id: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Query the audit entries.
|
|
35
|
+
* @param options The query options.
|
|
36
|
+
* @param options.actorId The actor identifier to filter the audit entries, optional.
|
|
37
|
+
* @param options.organizationId The organisation identifier to filter the audit entries, optional.
|
|
38
|
+
* @param options.tenantId The tenant identifier to filter the audit entries, optional.
|
|
39
|
+
* @param options.nodeId The node identifier to filter the audit entries, optional.
|
|
40
|
+
* @param options.event The audit event to filter the audit entries, optional.
|
|
41
|
+
* @param options.startDate The start date to filter the audit entries, optional.
|
|
42
|
+
* @param options.endDate The end date to filter the audit entries, optional.
|
|
43
|
+
* @param cursor The cursor for pagination.
|
|
44
|
+
* @param limit The maximum number of entries to return.
|
|
45
|
+
* @returns The audit entries.
|
|
46
|
+
*/
|
|
47
|
+
query(options?: {
|
|
48
|
+
actorId?: string;
|
|
49
|
+
organizationId?: string;
|
|
50
|
+
tenantId?: string;
|
|
51
|
+
nodeId?: string;
|
|
52
|
+
event?: AuthAuditEvent | string;
|
|
53
|
+
startDate?: string;
|
|
54
|
+
endDate?: string;
|
|
55
|
+
}, cursor?: string, limit?: number): Promise<{
|
|
56
|
+
entries: IAuthenticationAuditEntry[];
|
|
57
|
+
cursor?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { AuthAuditEvent } from "./authAuditEvent.js";
|
|
2
|
+
/**
|
|
3
|
+
* Contract definition for authentication audit entry.
|
|
4
|
+
*/
|
|
5
|
+
export interface IAuthenticationAuditEntry {
|
|
6
|
+
/**
|
|
7
|
+
* The unique identifier for the audit entry.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The audit event that occurred.
|
|
12
|
+
*/
|
|
13
|
+
event: AuthAuditEvent | string;
|
|
14
|
+
/**
|
|
15
|
+
* The timestamp of the audit entry in ISO 8601 format.
|
|
16
|
+
*/
|
|
17
|
+
dateCreated: string;
|
|
18
|
+
/**
|
|
19
|
+
* The actor identifier, could be e-mail, username, or other unique identifier.
|
|
20
|
+
*/
|
|
21
|
+
actorId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The node identifier associated with the audit entry, if applicable.
|
|
24
|
+
*/
|
|
25
|
+
nodeId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The organization identifier associated with the audit entry, if applicable.
|
|
28
|
+
*/
|
|
29
|
+
organizationId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The tenant identifier associated with the audit entry, if applicable.
|
|
32
|
+
*/
|
|
33
|
+
tenantId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The hashed IP addresses of the client.
|
|
36
|
+
*/
|
|
37
|
+
ipAddressHashes?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* The user agent string of the client.
|
|
40
|
+
*/
|
|
41
|
+
userAgent?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The correlation ID for request tracing.
|
|
44
|
+
*/
|
|
45
|
+
correlationId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Additional data related to the audit entry, such as IP address, user agent, etc.
|
|
48
|
+
*/
|
|
49
|
+
data?: unknown;
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for an authentication rate limited action.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAuthenticationRateActionConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Maximum number of failed attempts allowed per window.
|
|
7
|
+
*/
|
|
8
|
+
maxAttempts: number;
|
|
9
|
+
/**
|
|
10
|
+
* Rate limit window duration in minutes.
|
|
11
|
+
*/
|
|
12
|
+
windowMinutes: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { IComponent } from "@3sixty/core";
|
|
2
|
+
import type { IAuthenticationRateActionConfig } from "./IAuthenticationRateActionConfig.js";
|
|
3
|
+
/**
|
|
4
|
+
* Contract definition for authentication rate component.
|
|
5
|
+
*/
|
|
6
|
+
export interface IAuthenticationRateComponent extends IComponent {
|
|
7
|
+
/**
|
|
8
|
+
* The service needs to be started when the application is initialized.
|
|
9
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
10
|
+
* @returns A promise that resolves when the service has been started.
|
|
11
|
+
*/
|
|
12
|
+
start(nodeLoggingComponentType?: string): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The component needs to be stopped when the node is closed.
|
|
15
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
16
|
+
* @returns A promise that resolves when the service has been stopped.
|
|
17
|
+
*/
|
|
18
|
+
stop(nodeLoggingComponentType?: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Register or update rate-limit configuration for an action.
|
|
21
|
+
* @param action The action name.
|
|
22
|
+
* @param config The action configuration.
|
|
23
|
+
* @returns A promise that resolves when the action configuration has been stored.
|
|
24
|
+
*/
|
|
25
|
+
registerAction(action: string, config: IAuthenticationRateActionConfig): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Unregister rate-limit configuration for an action.
|
|
28
|
+
* @param action The action name.
|
|
29
|
+
* @returns A promise that resolves when the action configuration has been removed.
|
|
30
|
+
*/
|
|
31
|
+
unregisterAction(action: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Check the authentication rate for a given action and identifier.
|
|
34
|
+
* @param action The action to be checked.
|
|
35
|
+
* @param identifier The identifier to be checked.
|
|
36
|
+
* @returns The result of the rate check.
|
|
37
|
+
*/
|
|
38
|
+
check(action: string, identifier: string): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Clear the authentication rate entry for the given action and identifier.
|
|
41
|
+
* @param action The action to clear.
|
|
42
|
+
* @param identifier The identifier to clear.
|
|
43
|
+
* @returns A promise that resolves when the rate entry has been removed.
|
|
44
|
+
*/
|
|
45
|
+
clear(action: string, identifier: string): Promise<void>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticationAuditEntry } from "../IAuthenticationAuditEntry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create an authentication audit entry.
|
|
4
|
+
*/
|
|
5
|
+
export interface IAuditCreateRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The body of the request.
|
|
8
|
+
*/
|
|
9
|
+
body: Omit<IAuthenticationAuditEntry, "id" | "dateCreated">;
|
|
10
|
+
}
|