cloudfire-auth 0.1.0 → 0.3.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/README.md +40 -27
- package/dist/CloudFireAuth.d.ts +304 -1
- package/dist/CloudFireAuth.js +345 -0
- package/dist/rest-api/create-custom-token.d.ts +18 -0
- package/dist/rest-api/create-custom-token.js +20 -0
- package/dist/rest-api/create-provider-config.d.ts +16 -0
- package/dist/rest-api/create-provider-config.js +17 -0
- package/dist/rest-api/create-session-cookie.d.ts +18 -0
- package/dist/rest-api/create-session-cookie.js +19 -0
- package/dist/rest-api/delete-provider-config.d.ts +16 -0
- package/dist/rest-api/delete-provider-config.js +18 -0
- package/dist/rest-api/generate-email-verification-link.d.ts +18 -0
- package/dist/rest-api/generate-email-verification-link.js +19 -0
- package/dist/rest-api/generate-password-reset-link.d.ts +18 -0
- package/dist/rest-api/generate-password-reset-link.js +19 -0
- package/dist/rest-api/generate-sign-in-with-email-link.d.ts +18 -0
- package/dist/rest-api/generate-sign-in-with-email-link.js +19 -0
- package/dist/rest-api/generate-verify-and-change-email-link.d.ts +20 -0
- package/dist/rest-api/generate-verify-and-change-email-link.js +21 -0
- package/dist/rest-api/get-provider-config.d.ts +17 -0
- package/dist/rest-api/get-provider-config.js +18 -0
- package/dist/rest-api/import-users.d.ts +18 -0
- package/dist/rest-api/import-users.js +19 -0
- package/dist/rest-api/list-provider-configs.d.ts +17 -0
- package/dist/rest-api/list-provider-configs.js +18 -0
- package/dist/rest-api/update-provider-config.d.ts +18 -0
- package/dist/rest-api/update-provider-config.js +19 -0
- package/dist/types/firebase-admin/action-code-settings.d.ts +102 -0
- package/dist/types/firebase-admin/action-code-settings.js +17 -0
- package/dist/types/firebase-admin/auth-config.d.ts +39 -33
- package/dist/types/firebase-admin/auth-config.js +16 -0
- package/dist/types/firebase-admin/identifier.d.ts +6 -0
- package/dist/types/firebase-admin/identifier.js +16 -0
- package/dist/types/firebase-admin/index.d.ts +11 -2
- package/dist/types/firebase-admin/index.js +16 -0
- package/dist/types/firebase-admin/token-verifier.d.ts +6 -0
- package/dist/types/firebase-admin/token-verifier.js +16 -0
- package/dist/types/firebase-admin/user-import.d.ts +226 -0
- package/dist/types/firebase-admin/user-import.js +17 -0
- package/dist/types/firebase-admin/user-record.d.ts +6 -0
- package/dist/types/firebase-admin/user-record.js +17 -0
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/*! firebase-admin v13.4.0 */
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright 2018 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* You can find the code taken from the Firebase Admin SDK in this location of
|
|
19
|
+
* the firebase-admin 13.4.0 npm package:
|
|
20
|
+
*
|
|
21
|
+
* firebase-admin/lib/auth/user-import-builder.d.ts
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Alterations to Firebase Admin SDK Code
|
|
25
|
+
*
|
|
26
|
+
* The Buffer types have been replaced with Uint8Array types. The replacements
|
|
27
|
+
* have been made to:
|
|
28
|
+
*
|
|
29
|
+
* - UserImportOptions.hash.key
|
|
30
|
+
* - UserImportOptions.hash.saltSeparator
|
|
31
|
+
* - UserImportRecord.passwordHash
|
|
32
|
+
* - UserImportRecord.passwordSalt
|
|
33
|
+
*/
|
|
34
|
+
import type { FirebaseArrayIndexError } from "./index.js";
|
|
35
|
+
import type { MultiFactorUpdateSettings } from "./auth-config.js";
|
|
36
|
+
export type HashAlgorithmType = "SCRYPT" | "STANDARD_SCRYPT" | "HMAC_SHA512" | "HMAC_SHA256" | "HMAC_SHA1" | "HMAC_MD5" | "MD5" | "PBKDF_SHA1" | "BCRYPT" | "PBKDF2_SHA256" | "SHA512" | "SHA256" | "SHA1";
|
|
37
|
+
/**
|
|
38
|
+
* Interface representing the user import options needed for
|
|
39
|
+
* {@link BaseAuth.importUsers} method. This is used to
|
|
40
|
+
* provide the password hashing algorithm information.
|
|
41
|
+
*/
|
|
42
|
+
export interface UserImportOptions {
|
|
43
|
+
/**
|
|
44
|
+
* The password hashing information.
|
|
45
|
+
*/
|
|
46
|
+
hash: {
|
|
47
|
+
/**
|
|
48
|
+
* The password hashing algorithm identifier. The following algorithm
|
|
49
|
+
* identifiers are supported:
|
|
50
|
+
* `SCRYPT`, `STANDARD_SCRYPT`, `HMAC_SHA512`, `HMAC_SHA256`, `HMAC_SHA1`,
|
|
51
|
+
* `HMAC_MD5`, `MD5`, `PBKDF_SHA1`, `BCRYPT`, `PBKDF2_SHA256`, `SHA512`,
|
|
52
|
+
* `SHA256` and `SHA1`.
|
|
53
|
+
*/
|
|
54
|
+
algorithm: HashAlgorithmType;
|
|
55
|
+
/**
|
|
56
|
+
* The signing key used in the hash algorithm in buffer bytes.
|
|
57
|
+
* Required by hashing algorithms `SCRYPT`, `HMAC_SHA512`, `HMAC_SHA256`,
|
|
58
|
+
* `HAMC_SHA1` and `HMAC_MD5`.
|
|
59
|
+
*/
|
|
60
|
+
key?: Uint8Array;
|
|
61
|
+
/**
|
|
62
|
+
* The salt separator in buffer bytes which is appended to salt when
|
|
63
|
+
* verifying a password. This is only used by the `SCRYPT` algorithm.
|
|
64
|
+
*/
|
|
65
|
+
saltSeparator?: Uint8Array;
|
|
66
|
+
/**
|
|
67
|
+
* The number of rounds for hashing calculation.
|
|
68
|
+
* Required for `SCRYPT`, `MD5`, `SHA512`, `SHA256`, `SHA1`, `PBKDF_SHA1` and
|
|
69
|
+
* `PBKDF2_SHA256`.
|
|
70
|
+
*/
|
|
71
|
+
rounds?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The memory cost required for `SCRYPT` algorithm, or the CPU/memory cost.
|
|
74
|
+
* Required for `STANDARD_SCRYPT` algorithm.
|
|
75
|
+
*/
|
|
76
|
+
memoryCost?: number;
|
|
77
|
+
/**
|
|
78
|
+
* The parallelization of the hashing algorithm. Required for the
|
|
79
|
+
* `STANDARD_SCRYPT` algorithm.
|
|
80
|
+
*/
|
|
81
|
+
parallelization?: number;
|
|
82
|
+
/**
|
|
83
|
+
* The block size (normally 8) of the hashing algorithm. Required for the
|
|
84
|
+
* `STANDARD_SCRYPT` algorithm.
|
|
85
|
+
*/
|
|
86
|
+
blockSize?: number;
|
|
87
|
+
/**
|
|
88
|
+
* The derived key length of the hashing algorithm. Required for the
|
|
89
|
+
* `STANDARD_SCRYPT` algorithm.
|
|
90
|
+
*/
|
|
91
|
+
derivedKeyLength?: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Interface representing the user metadata.
|
|
96
|
+
*/
|
|
97
|
+
export interface UserMetadataRequest {
|
|
98
|
+
/**
|
|
99
|
+
* The date the user last signed in, formatted as a UTC string.
|
|
100
|
+
*/
|
|
101
|
+
lastSignInTime?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The date the user was created, formatted as a UTC string.
|
|
104
|
+
*/
|
|
105
|
+
creationTime?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Interface representing a user identity provider.
|
|
109
|
+
*/
|
|
110
|
+
export interface UserProviderRequest {
|
|
111
|
+
/**
|
|
112
|
+
* The user identifier for the linked provider.
|
|
113
|
+
*/
|
|
114
|
+
uid: string;
|
|
115
|
+
/**
|
|
116
|
+
* The display name for the linked provider.
|
|
117
|
+
*/
|
|
118
|
+
displayName?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The email for the linked provider.
|
|
121
|
+
*/
|
|
122
|
+
email?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The phone number for the linked provider.
|
|
125
|
+
*/
|
|
126
|
+
phoneNumber?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The photo URL for the linked provider.
|
|
129
|
+
*/
|
|
130
|
+
photoURL?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The linked provider ID (for example, "google.com" for the Google provider).
|
|
133
|
+
*/
|
|
134
|
+
providerId: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Interface representing a user to import to Firebase Auth via the
|
|
138
|
+
* {@link BaseAuth.importUsers} method.
|
|
139
|
+
*/
|
|
140
|
+
export interface UserImportRecord {
|
|
141
|
+
/**
|
|
142
|
+
* The user's `uid`.
|
|
143
|
+
*/
|
|
144
|
+
uid: string;
|
|
145
|
+
/**
|
|
146
|
+
* The user's primary email, if set.
|
|
147
|
+
*/
|
|
148
|
+
email?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Whether or not the user's primary email is verified.
|
|
151
|
+
*/
|
|
152
|
+
emailVerified?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* The user's display name.
|
|
155
|
+
*/
|
|
156
|
+
displayName?: string;
|
|
157
|
+
/**
|
|
158
|
+
* The user's primary phone number, if set.
|
|
159
|
+
*/
|
|
160
|
+
phoneNumber?: string;
|
|
161
|
+
/**
|
|
162
|
+
* The user's photo URL.
|
|
163
|
+
*/
|
|
164
|
+
photoURL?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Whether or not the user is disabled: `true` for disabled; `false` for
|
|
167
|
+
* enabled.
|
|
168
|
+
*/
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Additional metadata about the user.
|
|
172
|
+
*/
|
|
173
|
+
metadata?: UserMetadataRequest;
|
|
174
|
+
/**
|
|
175
|
+
* An array of providers (for example, Google, Facebook) linked to the user.
|
|
176
|
+
*/
|
|
177
|
+
providerData?: UserProviderRequest[];
|
|
178
|
+
/**
|
|
179
|
+
* The user's custom claims object if available, typically used to define
|
|
180
|
+
* user roles and propagated to an authenticated user's ID token.
|
|
181
|
+
*/
|
|
182
|
+
customClaims?: {
|
|
183
|
+
[key: string]: any;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* The buffer of bytes representing the user's hashed password.
|
|
187
|
+
* When a user is to be imported with a password hash,
|
|
188
|
+
* {@link UserImportOptions} are required to be
|
|
189
|
+
* specified to identify the hashing algorithm used to generate this hash.
|
|
190
|
+
*/
|
|
191
|
+
passwordHash?: Uint8Array;
|
|
192
|
+
/**
|
|
193
|
+
* The buffer of bytes representing the user's password salt.
|
|
194
|
+
*/
|
|
195
|
+
passwordSalt?: Uint8Array;
|
|
196
|
+
/**
|
|
197
|
+
* The identifier of the tenant where user is to be imported to.
|
|
198
|
+
* When not provided in an `admin.auth.Auth` context, the user is uploaded to
|
|
199
|
+
* the default parent project.
|
|
200
|
+
* When not provided in an `admin.auth.TenantAwareAuth` context, the user is uploaded
|
|
201
|
+
* to the tenant corresponding to that `TenantAwareAuth` instance's tenant ID.
|
|
202
|
+
*/
|
|
203
|
+
tenantId?: string;
|
|
204
|
+
/**
|
|
205
|
+
* The user's multi-factor related properties.
|
|
206
|
+
*/
|
|
207
|
+
multiFactor?: MultiFactorUpdateSettings;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Interface representing the result of the {@link BaseAuth.importUsers} API.
|
|
211
|
+
*/
|
|
212
|
+
export interface UserImportResult {
|
|
213
|
+
/**
|
|
214
|
+
* The number of user records that failed to import to Firebase Auth.
|
|
215
|
+
*/
|
|
216
|
+
failureCount: number;
|
|
217
|
+
/**
|
|
218
|
+
* The number of user records that successfully imported to Firebase Auth.
|
|
219
|
+
*/
|
|
220
|
+
successCount: number;
|
|
221
|
+
/**
|
|
222
|
+
* An array of errors corresponding to the provided users to import. The
|
|
223
|
+
* length of this array is equal to [`failureCount`].
|
|
224
|
+
*/
|
|
225
|
+
errors: FirebaseArrayIndexError[];
|
|
226
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*! firebase-admin v13.4.0 */
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright 2018 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* You can find the code taken from the Firebase Admin SDK in this location of
|
|
20
|
+
* the firebase-admin 13.4.0 npm package:
|
|
21
|
+
*
|
|
22
|
+
* firebase-admin/lib/auth/user-record.d.ts
|
|
23
|
+
*/
|
|
18
24
|
export interface MultiFactorInfoResponse {
|
|
19
25
|
mfaEnrollmentId: string;
|
|
20
26
|
displayName?: string;
|
|
@@ -1 +1,18 @@
|
|
|
1
|
+
/*! firebase-admin v13.4.0 */
|
|
2
|
+
/*!
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google Inc.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
1
18
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DecodedIdToken, UserRecord, UserIdentifier, GetUsersResult, ListUsersResult, CreateRequest, UpdateRequest, DeleteUsersResult } from "./types/firebase-admin/index.js";
|
|
1
|
+
import type { DecodedIdToken, UserRecord, UserIdentifier, GetUsersResult, ListUsersResult, CreateRequest, UpdateRequest, DeleteUsersResult, SessionCookieOptions, AuthProviderConfig, UpdateAuthProviderRequest, AuthProviderConfigFilter, ListProviderConfigResults, ActionCodeSettings, UserImportRecord, UserImportOptions, UserImportResult, HashAlgorithmType, UserMetadataRequest, UserProviderRequest } from "./types/firebase-admin/index.js";
|
|
2
2
|
import type { ServiceAccountKey } from "./types/service-account-key.js";
|
|
3
3
|
import type { SetAccountInfoResponse } from "./types/google-auth.js";
|
|
4
|
-
export type { DecodedIdToken, UserRecord, UserIdentifier, GetUsersResult, ListUsersResult, CreateRequest, UpdateRequest, DeleteUsersResult, };
|
|
4
|
+
export type { DecodedIdToken, UserRecord, UserIdentifier, GetUsersResult, ListUsersResult, CreateRequest, UpdateRequest, DeleteUsersResult, SessionCookieOptions, AuthProviderConfig, UpdateAuthProviderRequest, AuthProviderConfigFilter, ListProviderConfigResults, ActionCodeSettings, UserImportRecord, UserImportOptions, UserImportResult, HashAlgorithmType, UserMetadataRequest, UserProviderRequest, };
|
|
5
5
|
export type { ServiceAccountKey };
|
|
6
6
|
export type { SetAccountInfoResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudfire-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Connor Skelland",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "tsc",
|
|
32
32
|
"clean": "tsx scripts/publishing/remove-dist.ts",
|
|
33
33
|
"build:watch": "tsc --watch",
|
|
34
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
34
|
+
"prepublishOnly": "npm run test && npm run clean && npm run build"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@cloudflare/workers-types": "^4.20250816.0",
|