@crossauth/backend 0.0.2
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 +203 -0
- package/README.md +14 -0
- package/dist/apikey.d.ts +100 -0
- package/dist/apikey.d.ts.map +1 -0
- package/dist/auth.d.ts +131 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/authenticators/dummyfactor2.d.ts +129 -0
- package/dist/authenticators/dummyfactor2.d.ts.map +1 -0
- package/dist/authenticators/emailauth.d.ts +176 -0
- package/dist/authenticators/emailauth.d.ts.map +1 -0
- package/dist/authenticators/ldapauth.d.ts +89 -0
- package/dist/authenticators/ldapauth.d.ts.map +1 -0
- package/dist/authenticators/passwordauth.d.ts +159 -0
- package/dist/authenticators/passwordauth.d.ts.map +1 -0
- package/dist/authenticators/smsauth.d.ts +160 -0
- package/dist/authenticators/smsauth.d.ts.map +1 -0
- package/dist/authenticators/tests/ldapauth.test.d.ts +2 -0
- package/dist/authenticators/tests/ldapauth.test.d.ts.map +1 -0
- package/dist/authenticators/totpauth.d.ts +117 -0
- package/dist/authenticators/totpauth.d.ts.map +1 -0
- package/dist/authenticators/twilioauth.d.ts +29 -0
- package/dist/authenticators/twilioauth.d.ts.map +1 -0
- package/dist/cookieauth.d.ts +269 -0
- package/dist/cookieauth.d.ts.map +1 -0
- package/dist/crypto.d.ts +196 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/emailtokens.d.ts +178 -0
- package/dist/emailtokens.d.ts.map +1 -0
- package/dist/index.cjs +9107 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9090 -0
- package/dist/oauth/authserver.d.ts +490 -0
- package/dist/oauth/authserver.d.ts.map +1 -0
- package/dist/oauth/client.d.ts +72 -0
- package/dist/oauth/client.d.ts.map +1 -0
- package/dist/oauth/clientmanager.d.ts +73 -0
- package/dist/oauth/clientmanager.d.ts.map +1 -0
- package/dist/oauth/resserver.d.ts +43 -0
- package/dist/oauth/resserver.d.ts.map +1 -0
- package/dist/oauth/tests/common.d.ts +58 -0
- package/dist/oauth/tests/common.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_authzcode.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_authzcode.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_clientcred.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_clientcred.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_device.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_device.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_mfa.test.d.ts +5 -0
- package/dist/oauth/tests/oauthauthserver_mfa.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_password.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_password.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthclient.test.d.ts +2 -0
- package/dist/oauth/tests/oauthclient.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthresserver.test.d.ts +2 -0
- package/dist/oauth/tests/oauthresserver.test.d.ts.map +1 -0
- package/dist/oauth/tokenconsumer.d.ts +80 -0
- package/dist/oauth/tokenconsumer.d.ts.map +1 -0
- package/dist/session.d.ts +491 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/storage/dbconnection.d.ts +19 -0
- package/dist/storage/dbconnection.d.ts.map +1 -0
- package/dist/storage/dbstorage.d.ts +319 -0
- package/dist/storage/dbstorage.d.ts.map +1 -0
- package/dist/storage/inmemorystorage.d.ts +225 -0
- package/dist/storage/inmemorystorage.d.ts.map +1 -0
- package/dist/storage/ldapstorage.d.ts +143 -0
- package/dist/storage/ldapstorage.d.ts.map +1 -0
- package/dist/storage/postgresconnection.d.ts +27 -0
- package/dist/storage/postgresconnection.d.ts.map +1 -0
- package/dist/storage/postgresstorage.d.ts +83 -0
- package/dist/storage/postgresstorage.d.ts.map +1 -0
- package/dist/storage/prismastorage.d.ts +361 -0
- package/dist/storage/prismastorage.d.ts.map +1 -0
- package/dist/storage/sqliteconnection.d.ts +35 -0
- package/dist/storage/sqliteconnection.d.ts.map +1 -0
- package/dist/storage/sqlitestorage.d.ts +83 -0
- package/dist/storage/sqlitestorage.d.ts.map +1 -0
- package/dist/storage/tests/dbtests.d.ts +5 -0
- package/dist/storage/tests/dbtests.d.ts.map +1 -0
- package/dist/storage/tests/inmemorystorage.test.d.ts +5 -0
- package/dist/storage/tests/inmemorystorage.test.d.ts.map +1 -0
- package/dist/storage/tests/inmemorytestdata.d.ts +4 -0
- package/dist/storage/tests/inmemorytestdata.d.ts.map +1 -0
- package/dist/storage/tests/ldapstorage.test.d.ts +2 -0
- package/dist/storage/tests/ldapstorage.test.d.ts.map +1 -0
- package/dist/storage/tests/postgresstorage.test.d.ts +2 -0
- package/dist/storage/tests/postgresstorage.test.d.ts.map +1 -0
- package/dist/storage/tests/prismastorage.test.d.ts +4 -0
- package/dist/storage/tests/prismastorage.test.d.ts.map +1 -0
- package/dist/storage/tests/sqlitestorage.test.d.ts +2 -0
- package/dist/storage/tests/sqlitestorage.test.d.ts.map +1 -0
- package/dist/storage.d.ts +411 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/tests/cookieauth.test.d.ts +4 -0
- package/dist/tests/cookieauth.test.d.ts.map +1 -0
- package/dist/tests/crypto.test.d.ts +2 -0
- package/dist/tests/crypto.test.d.ts.map +1 -0
- package/dist/tests/email.test.d.ts +4 -0
- package/dist/tests/email.test.d.ts.map +1 -0
- package/dist/tests/password.test.d.ts +5 -0
- package/dist/tests/password.test.d.ts.map +1 -0
- package/dist/tests/tmp.test.d.ts +2 -0
- package/dist/tests/tmp.test.d.ts.map +1 -0
- package/dist/tests/utils.test.d.ts +2 -0
- package/dist/tests/utils.test.d.ts.map +1 -0
- package/dist/utils.d.ts +41 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Crossauth common
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2024 Matthew Baker
|
|
5
|
+
|
|
6
|
+
Crossauth is a cross platform package for authentication.
|
|
7
|
+
It has a Typescript version and soon also a Python and
|
|
8
|
+
Scala/Java version. At the moment it is not ready for
|
|
9
|
+
public use, though the Typescript version is ready to
|
|
10
|
+
be used by authorized developers.
|
|
11
|
+
|
|
12
|
+
This is the backend package on which the framework-specific
|
|
13
|
+
packages depend.
|
|
14
|
+
|
package/dist/apikey.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ApiKey } from '@crossauth/common';
|
|
2
|
+
import { KeyStorage } from './storage.ts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Options for {@link ApiKeyManager}.
|
|
6
|
+
*/
|
|
7
|
+
export interface ApiKeyManagerOptions {
|
|
8
|
+
/** Length in bytes of the randomly-created key (before Base64 encoding and signature) */
|
|
9
|
+
keyLength?: number;
|
|
10
|
+
/** Server secret. Needed for emailing tokens and for csrf tokens */
|
|
11
|
+
secret?: string;
|
|
12
|
+
/** The prefix to add to the hashed key in storage. Defaults to
|
|
13
|
+
* {@link @crossauth/common!KeyPrefix}.apiKey
|
|
14
|
+
*/
|
|
15
|
+
prefix?: string;
|
|
16
|
+
/** The token type in the Authorization header. Defaults to "ApiKey" */
|
|
17
|
+
authScheme?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Manager API keys.
|
|
21
|
+
*
|
|
22
|
+
* The caller must pass a {@link KeyStorage} object. This must provide a
|
|
23
|
+
* string field called `name` in the returned {@link @crossauth/common!Key}
|
|
24
|
+
* objects (in other words, the databsae table behind it must have a `name` field).
|
|
25
|
+
*
|
|
26
|
+
* Api keys have three forms in their value. The {@link @crossauth/common!Key}
|
|
27
|
+
* object's `value` field is a base64-url-encoded random number.
|
|
28
|
+
* When the key is in a header, it is expected to be folled by a dot and a
|
|
29
|
+
* signature to protect against injection attacks.
|
|
30
|
+
* When stored in the key storage, only the unsigned part is used (before the
|
|
31
|
+
* dot), it is hashed and preceded by
|
|
32
|
+
* `prefix`. The signature part is dropped for storage economy. This does
|
|
33
|
+
* not compromise security so long as the
|
|
34
|
+
* signature is always validated before comparing with the database.
|
|
35
|
+
*/
|
|
36
|
+
export declare class ApiKeyManager {
|
|
37
|
+
private apiKeyStorage;
|
|
38
|
+
private keyLength;
|
|
39
|
+
private secret;
|
|
40
|
+
/** The prefix to add to the hashed key in storage. Defaults to
|
|
41
|
+
* {@link @crossauth/common!KeyPrefix}.apiKey
|
|
42
|
+
*/
|
|
43
|
+
prefix: string;
|
|
44
|
+
/** The name of the speak in the Authorization header. Defaults to "ApiKey" */
|
|
45
|
+
authScheme?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Constructor.
|
|
48
|
+
*
|
|
49
|
+
* @param apiKeyStorage storage for API keys. In addition to the fields {@link KeyStorage} needs, the storage also needs a string field called `name`.
|
|
50
|
+
* @param options options. See {@link ApiKeyManagerOptions}
|
|
51
|
+
*/
|
|
52
|
+
constructor(apiKeyStorage: KeyStorage, options?: ApiKeyManagerOptions);
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new random key and returns it, unsigned. It is also persisted in the key storage as a
|
|
55
|
+
* hash of the unsigned part prefixed with {@link prefix()}.
|
|
56
|
+
* @param name a name for they key. This is for the user to refer to it
|
|
57
|
+
* (eg, for showing the keys the user has created or deleting
|
|
58
|
+
* a key)
|
|
59
|
+
* @param userid id for the user who owns this key, which may be undefined
|
|
60
|
+
* for keys not associated with a user
|
|
61
|
+
* @param data any application-specific extra data.
|
|
62
|
+
* If it contains an array called `scope` and this array
|
|
63
|
+
* contains `editUser`, the api key can be used for user
|
|
64
|
+
* manipulation functions (eg change password)}
|
|
65
|
+
* @param expiry expiry as a number of seconds from now
|
|
66
|
+
* @param extraFields any extra fields to save in key storage, and pass
|
|
67
|
+
* back in the {@link @crossauth/common!Key} object.
|
|
68
|
+
* @returns the new key as a {@link ApiKey} object, plus the token for the
|
|
69
|
+
* Authorization header (with the signature appended.)
|
|
70
|
+
*/
|
|
71
|
+
createKey(name: string, userid: string | number | undefined, data?: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}, expiry?: number, extraFields?: {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}): Promise<{
|
|
76
|
+
key: ApiKey;
|
|
77
|
+
token: string;
|
|
78
|
+
}>;
|
|
79
|
+
private static hashApiKeyValue;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the hash of the bearer value from the Authorization header.
|
|
82
|
+
*
|
|
83
|
+
* This has little practical value other than for reporting. Unhashed
|
|
84
|
+
* tokens are never reported.
|
|
85
|
+
* @param unsignedValue the part of the Authorization header after "Berear ".
|
|
86
|
+
* @returns a hash of the value (without the prefix).
|
|
87
|
+
*/
|
|
88
|
+
static hashSignedApiKeyValue(unsignedValue: string): string;
|
|
89
|
+
private unsignApiKeyValue;
|
|
90
|
+
private signApiKeyValue;
|
|
91
|
+
private getKey;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the {@link ApiKey} if the token is valid, throws an exception otherwise.
|
|
94
|
+
* @param headerValue the token from the Authorization header (after the "Bearer ").
|
|
95
|
+
* @returns The {@link ApiKey} object
|
|
96
|
+
* @throws {@link @crossauth/common!CrossauthError} with code `InvalidKey`
|
|
97
|
+
*/
|
|
98
|
+
validateToken(headerValue: string): Promise<ApiKey>;
|
|
99
|
+
}
|
|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OG;IACH,MAAM,CAAC,qBAAqB,CAAC,aAAa,EAAG,MAAM;IAInD,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,eAAe;YAKT,MAAM;IAYpB;;;;;OAKG;IACG,aAAa,CAAC,WAAW,EAAG,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC;CAO9D"}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { User, UserInputFields, UserSecretsInputFields, Key } from '@crossauth/common';
|
|
2
|
+
|
|
3
|
+
/** Parameters needed for this this class to authenticator a user (besides username)
|
|
4
|
+
* An example is `password`
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthenticationParameters extends UserSecretsInputFields {
|
|
7
|
+
otp?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Options to pass to the constructor.
|
|
11
|
+
*/
|
|
12
|
+
export interface AuthenticationOptions {
|
|
13
|
+
/** If passed, this is what will be displayed to the user when selecting
|
|
14
|
+
* an authentication method.
|
|
15
|
+
*/
|
|
16
|
+
friendlyName?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AuthenticatorCapabilities {
|
|
19
|
+
canCreateUser: boolean;
|
|
20
|
+
canUpdateUser: boolean;
|
|
21
|
+
canUpdateSecrets: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Base class for username/password authentication.
|
|
25
|
+
*
|
|
26
|
+
* Subclass this if you want something other than PBKDF2 password hashing.
|
|
27
|
+
*/
|
|
28
|
+
export declare abstract class Authenticator {
|
|
29
|
+
abstract skipEmailVerificationOnSignup(): boolean;
|
|
30
|
+
abstract prepareConfiguration(user: UserInputFields): Promise<{
|
|
31
|
+
userData: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
sessionData: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
} | undefined>;
|
|
38
|
+
abstract reprepareConfiguration(username: string, sessionKey: Key): Promise<{
|
|
39
|
+
userData: {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
|
+
secrets: Partial<UserSecretsInputFields>;
|
|
43
|
+
newSessionData: {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
} | undefined;
|
|
46
|
+
} | undefined>;
|
|
47
|
+
friendlyName: string;
|
|
48
|
+
factorName: string;
|
|
49
|
+
/**
|
|
50
|
+
* Constructor.
|
|
51
|
+
* @param options see {@link AuthenticationOptions}
|
|
52
|
+
*/
|
|
53
|
+
constructor(options?: AuthenticationOptions);
|
|
54
|
+
/**
|
|
55
|
+
* Used by the OAuth password_mfa grant type.
|
|
56
|
+
*/
|
|
57
|
+
abstract mfaType(): "none" | "oob" | "otp";
|
|
58
|
+
/**
|
|
59
|
+
* Used by the OAuth password_mfa grant type.
|
|
60
|
+
*/
|
|
61
|
+
abstract mfaChannel(): "none" | "email" | "sms";
|
|
62
|
+
/**
|
|
63
|
+
* Should return the user if it exists in storage, otherwise throw {@link @crossauth/common!CrossauthError}:
|
|
64
|
+
* with {@link @crossauth/common!ErrorCode} of `Connection`, `UserNotExist` or `PasswordNotMatch`
|
|
65
|
+
*
|
|
66
|
+
* @param user the user to authenticate
|
|
67
|
+
* @param secrets user secrets for authenticating
|
|
68
|
+
*/
|
|
69
|
+
abstract authenticateUser(user: UserInputFields | undefined, secrets: UserSecretsInputFields, params: AuthenticationParameters): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* This method should create and return any secrets that are persisted in storage, eg hashes of passwords.
|
|
72
|
+
*
|
|
73
|
+
* Not all authenticators have persistent secrets.
|
|
74
|
+
* @param username username to create secrets for
|
|
75
|
+
* @param params user-provided secrets (ie unhashed)
|
|
76
|
+
* @param repeatParams if present, secrets will be checked to be identical in this and `params`, throwing an exception if they are not
|
|
77
|
+
*/
|
|
78
|
+
abstract createPersistentSecrets(username: string, params: AuthenticationParameters, repeatParams?: AuthenticationParameters): Promise<Partial<UserSecretsInputFields>>;
|
|
79
|
+
/**
|
|
80
|
+
* Creates one-time secrets, eg one-time codes that are sent in email or SMS.
|
|
81
|
+
*
|
|
82
|
+
* Not all authenticators create one time secrets
|
|
83
|
+
* @param user user to create secrets for.
|
|
84
|
+
*/
|
|
85
|
+
abstract createOneTimeSecrets(user: User): Promise<Partial<UserSecretsInputFields>>;
|
|
86
|
+
/**
|
|
87
|
+
* If true, it is expected that this authenticator allows users to be created.
|
|
88
|
+
*/
|
|
89
|
+
abstract canCreateUser(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* If true, it is expected that this authenticator allows users to be updated.
|
|
92
|
+
*/
|
|
93
|
+
abstract canUpdateSecrets(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* If true, it is expected that this authenticator allows users to change their secrets.
|
|
96
|
+
*/
|
|
97
|
+
abstract canUpdateUser(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* All peristent secrets created and managed by this authenticator, eg `password`
|
|
100
|
+
*
|
|
101
|
+
* When user data is passed, it is filtered by this list.
|
|
102
|
+
*/
|
|
103
|
+
abstract secretNames(): string[];
|
|
104
|
+
/**
|
|
105
|
+
* All transient secrets created and managed by this authenticator, eg `otp`
|
|
106
|
+
*
|
|
107
|
+
* When user data is passed, it is filtered by this list.
|
|
108
|
+
*/
|
|
109
|
+
abstract transientSecretNames(): string[];
|
|
110
|
+
/**
|
|
111
|
+
* Implementations should use this to validate secrets against local requirements,
|
|
112
|
+
* eg minimum password length.
|
|
113
|
+
* @param params user-provided secrets to validate
|
|
114
|
+
*/
|
|
115
|
+
abstract validateSecrets(params: AuthenticationParameters): string[];
|
|
116
|
+
capabilities(): AuthenticatorCapabilities;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Base class for authenticators that check a username and password.
|
|
120
|
+
*/
|
|
121
|
+
export declare abstract class PasswordAuthenticator extends Authenticator {
|
|
122
|
+
/** @returns `password` */
|
|
123
|
+
secretNames(): string[];
|
|
124
|
+
/** @returns an empty array */
|
|
125
|
+
transientSecretNames(): never[];
|
|
126
|
+
/** @returns `none` */
|
|
127
|
+
mfaType(): "none" | "oob" | "otp";
|
|
128
|
+
/** @returns `none` */
|
|
129
|
+
mfaChannel(): "none" | "email" | "sms";
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE5F;;EAEE;AACF,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACpE,GAAG,CAAC,EAAG,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,YAAY,CAAC,EAAG,MAAM,CAAC;CAE1B;AAED,MAAM,WAAW,yBAAyB;IACtC,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,8BAAsB,aAAa;IAE/B,QAAQ,CAAC,6BAA6B,IAAK,OAAO;IAClD,QAAQ,CAAC,oBAAoB,CAAC,IAAI,EAAG,eAAe,GAAI,OAAO,CAAC;QAAC,QAAQ,EAAE;YAAC,CAAC,GAAG,EAAC,MAAM,GAAG,GAAG,CAAA;SAAC,CAAC;QAAC,WAAW,EAAE;YAAC,CAAC,GAAG,EAAC,MAAM,GAAG,GAAG,CAAA;SAAC,CAAA;KAAE,GAAC,SAAS,CAAC;IAC7I,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,EAAG,MAAM,EAAE,UAAU,EAAG,GAAG,GAAI,OAAO,CAAC;QAAC,QAAQ,EAAE;YAAC,CAAC,GAAG,EAAC,MAAM,GAAG,GAAG,CAAA;SAAC,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,CA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ED;;GAEG;AACH,8BAAsB,qBAAsB,SAAQ,aAAa;IAE7D,0BAA0B;IAC1B,WAAW;IAEX,8BAA8B;IAC9B,oBAAoB;IAEpB,sBAAsB;IACtB,OAAO,IAAK,MAAM,GAAG,KAAK,GAAG,KAAK;IAElC,sBAAsB;IACtB,UAAU,IAAK,MAAM,GAAG,OAAO,GAAG,KAAK;CAC1C"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { User, Key, UserSecretsInputFields, UserInputFields } from '@crossauth/common';
|
|
2
|
+
import { Authenticator, AuthenticationParameters, AuthenticationOptions } from '../auth.ts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Options for `DummyFactor2Authenticator`
|
|
6
|
+
*/
|
|
7
|
+
export interface DummyFactor2AuthenticatorOptions extends AuthenticationOptions {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* This authenticator creates fixed one-time code
|
|
11
|
+
*/
|
|
12
|
+
export declare class DummyFactor2Authenticator extends Authenticator {
|
|
13
|
+
readonly code: string;
|
|
14
|
+
/**
|
|
15
|
+
* Constructor
|
|
16
|
+
*
|
|
17
|
+
* @param options see {@link EmailAuthenticatorOptions}
|
|
18
|
+
*/
|
|
19
|
+
constructor(code: string, options?: DummyFactor2AuthenticatorOptions);
|
|
20
|
+
/**
|
|
21
|
+
* Used by the OAuth password_mfa grant type.
|
|
22
|
+
*/
|
|
23
|
+
mfaType(): "none" | "oob" | "otp";
|
|
24
|
+
/**
|
|
25
|
+
* Used by the OAuth password_mfa grant type.
|
|
26
|
+
*/
|
|
27
|
+
mfaChannel(): "none" | "email" | "sms";
|
|
28
|
+
/**
|
|
29
|
+
* Creates and emails the one-time code
|
|
30
|
+
* @param user the user to create it for. Uses the `email` field if
|
|
31
|
+
* present, `username` otherwise (which in this case is
|
|
32
|
+
* expected to contain an email address)
|
|
33
|
+
* @returns `userData` containing `username`, `email`, `factor2`
|
|
34
|
+
* `sessionData` containing the same plus `otp` and `expiry` which
|
|
35
|
+
* is a Unix time (number).
|
|
36
|
+
*/
|
|
37
|
+
prepareConfiguration(user: UserInputFields): Promise<{
|
|
38
|
+
userData: {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
};
|
|
41
|
+
sessionData: {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
};
|
|
44
|
+
} | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates and emails a new one-time code.
|
|
47
|
+
* @param _username ignored
|
|
48
|
+
* @param sessionKey the session containing the previously created data.
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
reprepareConfiguration(_username: string, sessionKey: Key): Promise<{
|
|
52
|
+
userData: {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
};
|
|
55
|
+
secrets: Partial<UserSecretsInputFields>;
|
|
56
|
+
newSessionData: {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
} | undefined;
|
|
59
|
+
} | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Authenticates the user by comparing the user-provided otp with the one
|
|
62
|
+
* in secrets.
|
|
63
|
+
*
|
|
64
|
+
* Validation fails if the otp is incorrect or has expired.
|
|
65
|
+
*
|
|
66
|
+
* @param _user ignored
|
|
67
|
+
* @param secrets taken from the session and should contain `otp` and
|
|
68
|
+
* `expiry`
|
|
69
|
+
* @param params user input and should contain `otp`
|
|
70
|
+
* @throws {@link @crossauth/common!CrossauthError} with
|
|
71
|
+
* {@link @crossauth/common!ErrorCode} `InvalidToken` or `Expired`.
|
|
72
|
+
*/
|
|
73
|
+
authenticateUser(_user: User, secrets: UserSecretsInputFields, params: AuthenticationParameters): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Does nothing for this class
|
|
76
|
+
*/
|
|
77
|
+
createPersistentSecrets(_username: string, _params: AuthenticationParameters, _repeatParams?: AuthenticationParameters): Promise<Partial<UserSecretsInputFields>>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates and emails a new one-time code.
|
|
80
|
+
* @param user the user to create it for. Uses the `email` field if
|
|
81
|
+
* present, `username` otherwise (which in this case is
|
|
82
|
+
* expected to contain an email address)
|
|
83
|
+
* @returns `otp` and `expiry` as a Unix time (number).
|
|
84
|
+
*/
|
|
85
|
+
createOneTimeSecrets(_user: User): Promise<Partial<UserSecretsInputFields>>;
|
|
86
|
+
/**
|
|
87
|
+
* @returns true - this class can create users
|
|
88
|
+
*/
|
|
89
|
+
canCreateUser(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @returns true - this class can update users
|
|
92
|
+
*/
|
|
93
|
+
canUpdateUser(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* @returns false - users cannot update secrets
|
|
96
|
+
*/
|
|
97
|
+
canUpdateSecrets(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @returns empty - this authenticator has no persistent secrets
|
|
100
|
+
*/
|
|
101
|
+
secretNames(): string[];
|
|
102
|
+
/**
|
|
103
|
+
* @returns otp
|
|
104
|
+
*/
|
|
105
|
+
transientSecretNames(): string[];
|
|
106
|
+
/**
|
|
107
|
+
* Does nothing for this class
|
|
108
|
+
*/
|
|
109
|
+
validateSecrets(_params: AuthenticationParameters): string[];
|
|
110
|
+
/**
|
|
111
|
+
* @returns true - as a code is sent to the registers email address, no
|
|
112
|
+
* additional email verification is needed
|
|
113
|
+
*/
|
|
114
|
+
skipEmailVerificationOnSignup(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Returns whether or not the passed email has a valid form.
|
|
117
|
+
* @param email the email address to validate
|
|
118
|
+
* @returns true if it is valid. false otherwise
|
|
119
|
+
*/
|
|
120
|
+
static isEmailValid(email: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Takles a number and turns it into a zero-padded string
|
|
123
|
+
* @param num number ot pad
|
|
124
|
+
* @param places total number of required digits
|
|
125
|
+
* @returns zero-padded string
|
|
126
|
+
*/
|
|
127
|
+
static zeroPad(num: number, places: number): string;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=dummyfactor2.d.ts.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