@ic-reactor/react 3.6.0 → 3.8.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 +117 -13
- package/dist/auth/authentication-manager.d.ts +98 -0
- package/dist/auth/authentication-manager.d.ts.map +1 -0
- package/dist/auth/authentication-manager.js +532 -0
- package/dist/auth/authentication-manager.js.map +1 -0
- package/dist/auth/constants.d.ts +18 -0
- package/dist/auth/constants.d.ts.map +1 -0
- package/dist/auth/constants.js +18 -0
- package/dist/auth/constants.js.map +1 -0
- package/dist/auth/createIdentityAttributeHooks.d.ts +14 -0
- package/dist/auth/createIdentityAttributeHooks.d.ts.map +1 -0
- package/dist/auth/createIdentityAttributeHooks.js +54 -0
- package/dist/auth/createIdentityAttributeHooks.js.map +1 -0
- package/dist/auth/identity-attributes-manager.d.ts +26 -0
- package/dist/auth/identity-attributes-manager.d.ts.map +1 -0
- package/dist/auth/identity-attributes-manager.js +108 -0
- package/dist/auth/identity-attributes-manager.js.map +1 -0
- package/dist/auth/identity-attributes.d.ts +19 -0
- package/dist/auth/identity-attributes.d.ts.map +1 -0
- package/dist/auth/identity-attributes.js +170 -0
- package/dist/auth/identity-attributes.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/types.d.ts +182 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +2 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/createActorHooks.d.ts +16 -16
- package/dist/createActorHooks.d.ts.map +1 -1
- package/dist/createActorHooks.js +6 -6
- package/dist/createActorHooks.js.map +1 -1
- package/dist/createInfiniteQuery.d.ts +33 -33
- package/dist/createInfiniteQuery.d.ts.map +1 -1
- package/dist/createInfiniteQuery.js +6 -6
- package/dist/createInfiniteQuery.js.map +1 -1
- package/dist/createMutation.d.ts +13 -2
- package/dist/createMutation.d.ts.map +1 -1
- package/dist/createMutation.js +11 -0
- package/dist/createMutation.js.map +1 -1
- package/dist/createQuery.d.ts +13 -3
- package/dist/createQuery.d.ts.map +1 -1
- package/dist/createQuery.js +16 -6
- package/dist/createQuery.js.map +1 -1
- package/dist/createSuspenseInfiniteQuery.d.ts +32 -32
- package/dist/createSuspenseInfiniteQuery.d.ts.map +1 -1
- package/dist/createSuspenseInfiniteQuery.js +6 -6
- package/dist/createSuspenseInfiniteQuery.js.map +1 -1
- package/dist/createSuspenseQuery.d.ts +3 -3
- package/dist/createSuspenseQuery.d.ts.map +1 -1
- package/dist/createSuspenseQuery.js +1 -1
- package/dist/createSuspenseQuery.js.map +1 -1
- package/dist/defineReactor.d.ts +124 -0
- package/dist/defineReactor.d.ts.map +1 -0
- package/dist/defineReactor.js +145 -0
- package/dist/defineReactor.js.map +1 -0
- package/dist/{createAuthHooks.d.ts → hooks/createAuthHooks.d.ts} +6 -13
- package/dist/hooks/createAuthHooks.d.ts.map +1 -0
- package/dist/{createAuthHooks.js → hooks/createAuthHooks.js} +18 -58
- package/dist/hooks/createAuthHooks.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useActorInfiniteQuery.d.ts +9 -9
- package/dist/hooks/useActorInfiniteQuery.d.ts.map +1 -1
- package/dist/hooks/useActorInfiniteQuery.js +3 -1
- package/dist/hooks/useActorInfiniteQuery.js.map +1 -1
- package/dist/hooks/useActorMethod.d.ts +17 -17
- package/dist/hooks/useActorMethod.d.ts.map +1 -1
- package/dist/hooks/useActorMethod.js.map +1 -1
- package/dist/hooks/useActorMutation.d.ts +18 -7
- package/dist/hooks/useActorMutation.d.ts.map +1 -1
- package/dist/hooks/useActorMutation.js +11 -0
- package/dist/hooks/useActorMutation.js.map +1 -1
- package/dist/hooks/useActorQuery.d.ts +8 -8
- package/dist/hooks/useActorQuery.d.ts.map +1 -1
- package/dist/hooks/useActorQuery.js.map +1 -1
- package/dist/hooks/useActorSuspenseInfiniteQuery.d.ts +9 -9
- package/dist/hooks/useActorSuspenseInfiniteQuery.d.ts.map +1 -1
- package/dist/hooks/useActorSuspenseInfiniteQuery.js +3 -1
- package/dist/hooks/useActorSuspenseInfiniteQuery.js.map +1 -1
- package/dist/hooks/useActorSuspenseQuery.d.ts +8 -8
- package/dist/hooks/useActorSuspenseQuery.d.ts.map +1 -1
- package/dist/hooks/useActorSuspenseQuery.js.map +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +24 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +10 -2
- package/dist/utils.js.map +1 -1
- package/llms.txt +48 -0
- package/package.json +34 -23
- package/src/auth/authentication-manager.ts +591 -0
- package/src/auth/constants.ts +25 -0
- package/src/auth/createIdentityAttributeHooks.ts +83 -0
- package/src/auth/identity-attributes-manager.ts +136 -0
- package/src/auth/identity-attributes.ts +270 -0
- package/src/auth/index.ts +7 -0
- package/src/auth/types.ts +204 -0
- package/src/createActorHooks.ts +90 -58
- package/src/createInfiniteQuery.ts +154 -98
- package/src/createMutation.ts +35 -19
- package/src/createQuery.ts +94 -50
- package/src/createSuspenseInfiniteQuery.ts +166 -115
- package/src/createSuspenseQuery.ts +69 -43
- package/src/defineReactor.ts +272 -0
- package/src/{createAuthHooks.ts → hooks/createAuthHooks.ts} +23 -99
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useActorInfiniteQuery.ts +44 -30
- package/src/hooks/useActorMethod.ts +62 -53
- package/src/hooks/useActorMutation.ts +47 -30
- package/src/hooks/useActorQuery.ts +36 -32
- package/src/hooks/useActorSuspenseInfiniteQuery.ts +56 -30
- package/src/hooks/useActorSuspenseQuery.ts +42 -32
- package/src/index.ts +12 -10
- package/src/types.ts +76 -71
- package/src/utils.ts +15 -2
- package/dist/createAuthHooks.d.ts.map +0 -1
- package/dist/createAuthHooks.js.map +0 -1
- package/src/hooks/useActorInfiniteQuery.test.tsx +0 -457
- package/src/hooks/useActorMethod.test.tsx +0 -798
- package/src/hooks/useActorMutation.test.tsx +0 -220
- package/src/hooks/useActorQuery.test.tsx +0 -287
- package/src/hooks/useActorSuspenseInfiniteQuery.test.tsx +0 -472
- package/src/hooks/useActorSuspenseQuery.test.tsx +0 -254
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { isDev } from "@ic-reactor/core";
|
|
2
|
+
import { safeGetCanisterEnv } from "@icp-sdk/core/agent/canister-env";
|
|
3
|
+
import { IC_INTERNET_IDENTITY_PROVIDER, INTERNET_IDENTITY_PROVIDER_ENV_KEY, localInternetIdentityProvider, } from "./constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* Manages Internet Identity sign-in, session restoration, and authentication
|
|
6
|
+
* state for a {@link ClientManager}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const authentication = new AuthenticationManager({ clientManager })
|
|
11
|
+
* const identity = await authentication.authenticate()
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export class AuthenticationManager {
|
|
15
|
+
/** The current authentication state. */
|
|
16
|
+
get authState() {
|
|
17
|
+
return this.authStateValue;
|
|
18
|
+
}
|
|
19
|
+
constructor({ clientManager, authClient, identityProvider, internetIdentityId, ...clientOptions }) {
|
|
20
|
+
Object.defineProperty(this, "authClient", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: void 0
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "authPromise", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: void 0
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(this, "authClientWasProvided", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: false
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "authStateRevision", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: 0
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(this, "authStateSubscribers", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: []
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(this, "authClientConstructor", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: void 0
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(this, "authClientConstructorPromise", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
value: void 0
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(this, "authModuleMissing", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
value: false
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(this, "authClientOptions", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: true,
|
|
71
|
+
writable: true,
|
|
72
|
+
value: void 0
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(this, "authStateValue", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: {
|
|
79
|
+
identity: null,
|
|
80
|
+
isAuthenticating: false,
|
|
81
|
+
isAuthenticated: false,
|
|
82
|
+
error: undefined,
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(this, "identityProvider", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
configurable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
value: void 0
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(this, "internetIdentityId", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true,
|
|
94
|
+
writable: true,
|
|
95
|
+
value: void 0
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(this, "defaultClientOptions", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
configurable: true,
|
|
100
|
+
writable: true,
|
|
101
|
+
value: void 0
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(this, "clientManager", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value: void 0
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(this, "authenticate", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: async () => {
|
|
114
|
+
if (this.authState.isAuthenticated) {
|
|
115
|
+
return this.authState.identity || undefined;
|
|
116
|
+
}
|
|
117
|
+
if (this.authPromise) {
|
|
118
|
+
return this.authPromise;
|
|
119
|
+
}
|
|
120
|
+
if (this.authModuleMissing) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
this.authPromise = (async () => {
|
|
124
|
+
if (isDev() && typeof window !== "undefined") {
|
|
125
|
+
console.info(`%cic-reactor:%c Authenticating...`, "color: #3b82f6; font-weight: bold", "color: inherit", {
|
|
126
|
+
network: this.clientManager.network,
|
|
127
|
+
authClient: this.authClient ? "Shared Instance" : "Dynamic Import",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
this.updateState({ isAuthenticating: true });
|
|
131
|
+
try {
|
|
132
|
+
if (!this.authClient) {
|
|
133
|
+
const authClient = await this.initializeClient(this.resolveClientOptions());
|
|
134
|
+
if (!authClient) {
|
|
135
|
+
this.updateState({ isAuthenticating: false });
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const identity = await this.authClient.getIdentity();
|
|
140
|
+
const isAuthenticated = await this.authClient.isAuthenticated();
|
|
141
|
+
// Restoring an anonymous session is the common first-load case; pushing
|
|
142
|
+
// it through updateAgent would invalidate the whole query cache on
|
|
143
|
+
// every mount for nothing.
|
|
144
|
+
if (isAuthenticated || !identity.getPrincipal().isAnonymous()) {
|
|
145
|
+
this.clientManager.updateAgent(identity);
|
|
146
|
+
}
|
|
147
|
+
this.updateState({
|
|
148
|
+
identity,
|
|
149
|
+
isAuthenticated,
|
|
150
|
+
isAuthenticating: false,
|
|
151
|
+
});
|
|
152
|
+
return identity;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
this.updateState({ error: error, isAuthenticating: false });
|
|
156
|
+
console.error("Authentication failed:", error);
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
this.authPromise = undefined;
|
|
161
|
+
}
|
|
162
|
+
})();
|
|
163
|
+
return this.authPromise;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(this, "login", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
configurable: true,
|
|
169
|
+
writable: true,
|
|
170
|
+
value: async (loginOptions) => {
|
|
171
|
+
let didCompleteSignIn = false;
|
|
172
|
+
try {
|
|
173
|
+
const authClientOptions = this.resolveClientOptions(loginOptions);
|
|
174
|
+
// Stays synchronous when `prepareClient()` has already loaded the auth
|
|
175
|
+
// module, so `signIn()` still runs inside the caller's click handler.
|
|
176
|
+
if (!this.ensurePreparedClient(authClientOptions)) {
|
|
177
|
+
await this.initializeClient(authClientOptions);
|
|
178
|
+
}
|
|
179
|
+
if (!this.authClient) {
|
|
180
|
+
await this.authenticate();
|
|
181
|
+
}
|
|
182
|
+
if (!this.authClient) {
|
|
183
|
+
throw new Error("Authentication module is missing or failed to initialize. To use login, install the optional auth peer: npm install @icp-sdk/auth. If it is already installed and your bundler could not resolve it, pass a pre-constructed client instead: new AuthenticationManager({ clientManager, authClient: new AuthClient(...) })");
|
|
184
|
+
}
|
|
185
|
+
this.updateState({ isAuthenticating: true, error: undefined });
|
|
186
|
+
const identity = await this.signInOrRecoverIdentity(getSignInOptions(loginOptions));
|
|
187
|
+
if (!this.clientManager.agentState.isInitialized) {
|
|
188
|
+
await this.clientManager.initializeAgent();
|
|
189
|
+
}
|
|
190
|
+
this.clientManager.updateAgent(identity);
|
|
191
|
+
this.updateState({
|
|
192
|
+
identity,
|
|
193
|
+
isAuthenticated: true,
|
|
194
|
+
isAuthenticating: false,
|
|
195
|
+
});
|
|
196
|
+
didCompleteSignIn = true;
|
|
197
|
+
try {
|
|
198
|
+
await loginOptions?.onSuccess?.();
|
|
199
|
+
}
|
|
200
|
+
catch (callbackError) {
|
|
201
|
+
this.updateState({ error: callbackError });
|
|
202
|
+
await loginOptions?.onError?.(callbackError.message);
|
|
203
|
+
throw callbackError;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
if (!didCompleteSignIn) {
|
|
208
|
+
await loginOptions?.onError?.(error.message);
|
|
209
|
+
this.updateState({
|
|
210
|
+
error: error,
|
|
211
|
+
isAuthenticating: false,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(this, "logout", {
|
|
219
|
+
enumerable: true,
|
|
220
|
+
configurable: true,
|
|
221
|
+
writable: true,
|
|
222
|
+
value: async (options) => {
|
|
223
|
+
if (!this.authClient) {
|
|
224
|
+
throw new Error("Authentication module is missing or failed to initialize. To use logout, install the optional auth peer: npm install @icp-sdk/auth. If it is already installed and your bundler could not resolve it, pass a pre-constructed client instead: new AuthenticationManager({ clientManager, authClient: new AuthClient(...) })");
|
|
225
|
+
}
|
|
226
|
+
this.updateState({ isAuthenticating: true, error: undefined });
|
|
227
|
+
await this.authClient.signOut(options);
|
|
228
|
+
const identity = await this.authClient.getIdentity();
|
|
229
|
+
this.clientManager.updateAgent(identity);
|
|
230
|
+
this.updateState({
|
|
231
|
+
identity,
|
|
232
|
+
isAuthenticated: false,
|
|
233
|
+
isAuthenticating: false,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
this.clientManager = clientManager;
|
|
238
|
+
const canisterEnv = typeof window !== "undefined" ? getAuthenticationCanisterEnv() : undefined;
|
|
239
|
+
this.identityProvider =
|
|
240
|
+
identityProvider ||
|
|
241
|
+
canisterEnv?.[INTERNET_IDENTITY_PROVIDER_ENV_KEY] ||
|
|
242
|
+
canisterEnv?.["PUBLIC_INTERNET_IDENTITY_PROVIDER"];
|
|
243
|
+
this.internetIdentityId =
|
|
244
|
+
internetIdentityId ||
|
|
245
|
+
canisterEnv?.["internet_identity"] ||
|
|
246
|
+
canisterEnv?.["PUBLIC_CANISTER_ID:internet_identity"] ||
|
|
247
|
+
canisterEnv?.["CANISTER_ID_INTERNET_IDENTITY"];
|
|
248
|
+
this.defaultClientOptions = clientOptions;
|
|
249
|
+
if (authClient) {
|
|
250
|
+
this.authClientWasProvided = true;
|
|
251
|
+
this.authClient = authClient;
|
|
252
|
+
this.syncStateFromClient(this.authStateRevision).catch((error) => {
|
|
253
|
+
this.updateState({ error: error, isAuthenticating: false });
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
else if (typeof window !== "undefined") {
|
|
257
|
+
this.loadAuthClientConstructor().catch(() => {
|
|
258
|
+
// Optional auth support is reported when an auth method is used.
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
263
|
+
get client() {
|
|
264
|
+
return this.authClient;
|
|
265
|
+
}
|
|
266
|
+
subscribeAuthState(callback) {
|
|
267
|
+
this.authStateSubscribers.push(callback);
|
|
268
|
+
return () => {
|
|
269
|
+
this.authStateSubscribers = this.authStateSubscribers.filter((subscriber) => subscriber !== callback);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Preloads the auth module and creates an AuthClient ahead of time.
|
|
274
|
+
*
|
|
275
|
+
* Call (and await) this before wiring up a login button: it makes
|
|
276
|
+
* {@link login} and {@link IdentityAttributesManager.request} able to open
|
|
277
|
+
* the identity provider synchronously inside the click handler, which is
|
|
278
|
+
* what browser popup blockers and the ICRC-29 transport require.
|
|
279
|
+
*/
|
|
280
|
+
async prepareClient(options) {
|
|
281
|
+
const clientOptions = this.resolveClientOptions(options);
|
|
282
|
+
if (this.authClient && !this.shouldRecreateClient(clientOptions)) {
|
|
283
|
+
return this.authClient;
|
|
284
|
+
}
|
|
285
|
+
return this.initializeClient(clientOptions);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Returns an AuthClient without awaiting, or `undefined` when the auth
|
|
289
|
+
* module has not been loaded yet.
|
|
290
|
+
*
|
|
291
|
+
* Callers that must stay inside a user gesture use this instead of
|
|
292
|
+
* {@link ensureClient}; awaiting anything before opening the identity
|
|
293
|
+
* provider window loses the gesture.
|
|
294
|
+
*/
|
|
295
|
+
getPreparedClient(options) {
|
|
296
|
+
return this.ensurePreparedClient(this.resolveClientOptions(options));
|
|
297
|
+
}
|
|
298
|
+
async initializeClient(options) {
|
|
299
|
+
const AuthClient = await this.loadAuthClientConstructor();
|
|
300
|
+
if (!AuthClient) {
|
|
301
|
+
return undefined;
|
|
302
|
+
}
|
|
303
|
+
this.authClient = new AuthClient(options);
|
|
304
|
+
this.authClientOptions = options;
|
|
305
|
+
return this.authClient;
|
|
306
|
+
}
|
|
307
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
308
|
+
async signInOrRecoverIdentity(options) {
|
|
309
|
+
if (!this.authClient) {
|
|
310
|
+
throw new Error("Authentication module is missing or failed to initialize. To use login, install the optional auth peer: npm install @icp-sdk/auth. If it is already installed and your bundler could not resolve it, pass a pre-constructed client instead: new AuthenticationManager({ clientManager, authClient: new AuthClient(...) })");
|
|
311
|
+
}
|
|
312
|
+
try {
|
|
313
|
+
return await this.authClient.signIn(options);
|
|
314
|
+
}
|
|
315
|
+
catch (error) {
|
|
316
|
+
const identity = await Promise.resolve(this.authClient.getIdentity()).catch(() => null);
|
|
317
|
+
const isAuthenticated = await Promise.resolve(this.authClient.isAuthenticated()).catch(() => false);
|
|
318
|
+
if (identity && isAuthenticated) {
|
|
319
|
+
return identity;
|
|
320
|
+
}
|
|
321
|
+
throw error;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
ensurePreparedClient(options) {
|
|
325
|
+
if (this.authClient && !this.shouldRecreateClient(options)) {
|
|
326
|
+
return this.authClient;
|
|
327
|
+
}
|
|
328
|
+
const AuthClient = this.authClientConstructor;
|
|
329
|
+
if (!AuthClient || this.authClientWasProvided) {
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
this.authClient = new AuthClient(options);
|
|
333
|
+
this.authClientOptions = options;
|
|
334
|
+
return this.authClient;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Only rebuild the client when the effective options actually changed.
|
|
338
|
+
*
|
|
339
|
+
* Recreating on every call would discard the client warmed up by
|
|
340
|
+
* `prepareClient()` and register a duplicate sign-out callback on the
|
|
341
|
+
* shared IdleManager singleton each time.
|
|
342
|
+
*/
|
|
343
|
+
shouldRecreateClient(options) {
|
|
344
|
+
if (this.authClientWasProvided) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
return !isSameAuthClientOptions(this.authClientOptions, options);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Merges constructor-level defaults with per-call overrides and fills in the
|
|
351
|
+
* network-appropriate identity provider.
|
|
352
|
+
*/
|
|
353
|
+
resolveClientOptions(options) {
|
|
354
|
+
const merged = getAuthClientOptions({
|
|
355
|
+
...this.defaultClientOptions,
|
|
356
|
+
...options,
|
|
357
|
+
});
|
|
358
|
+
return {
|
|
359
|
+
...merged,
|
|
360
|
+
identityProvider: merged?.identityProvider ?? this.getDefaultIdentityProvider(),
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
async syncStateFromClient(revision = this.authStateRevision) {
|
|
364
|
+
if (!this.authClient) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const identity = await this.authClient.getIdentity();
|
|
368
|
+
const isAuthenticated = await this.authClient.isAuthenticated();
|
|
369
|
+
if (revision !== this.authStateRevision) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
this.clientManager.updateAgent(identity);
|
|
373
|
+
this.updateState({
|
|
374
|
+
identity,
|
|
375
|
+
isAuthenticated,
|
|
376
|
+
isAuthenticating: false,
|
|
377
|
+
error: undefined,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
381
|
+
async ensureClient(options) {
|
|
382
|
+
const clientOptions = this.resolveClientOptions(options);
|
|
383
|
+
if (!this.ensurePreparedClient(clientOptions)) {
|
|
384
|
+
await this.initializeClient(clientOptions);
|
|
385
|
+
}
|
|
386
|
+
return this.authClient;
|
|
387
|
+
}
|
|
388
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
389
|
+
async commitIdentity(identity, isAuthenticated) {
|
|
390
|
+
if (!this.clientManager.agentState.isInitialized) {
|
|
391
|
+
await this.clientManager.initializeAgent();
|
|
392
|
+
}
|
|
393
|
+
this.clientManager.updateAgent(identity);
|
|
394
|
+
this.updateState({ identity, isAuthenticated, isAuthenticating: false });
|
|
395
|
+
}
|
|
396
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
397
|
+
setAuthenticating() {
|
|
398
|
+
this.updateState({ isAuthenticating: true, error: undefined });
|
|
399
|
+
}
|
|
400
|
+
/** @internal Used by IdentityAttributesManager. */
|
|
401
|
+
setAuthenticationError(error) {
|
|
402
|
+
this.updateState({ error, isAuthenticating: false });
|
|
403
|
+
}
|
|
404
|
+
getDefaultIdentityProvider() {
|
|
405
|
+
if (this.identityProvider) {
|
|
406
|
+
return this.identityProvider;
|
|
407
|
+
}
|
|
408
|
+
return this.clientManager.isLocal
|
|
409
|
+
? localInternetIdentityProvider(Number(this.clientManager.agentHost?.port) || 4943, this.internetIdentityId)
|
|
410
|
+
: IC_INTERNET_IDENTITY_PROVIDER;
|
|
411
|
+
}
|
|
412
|
+
updateState(newState) {
|
|
413
|
+
if (isDev())
|
|
414
|
+
console.debug("[ic-reactor] Updating Auth State:", newState);
|
|
415
|
+
this.authStateRevision += 1;
|
|
416
|
+
this.authStateValue = { ...this.authStateValue, ...newState };
|
|
417
|
+
this.authStateSubscribers.forEach((subscriber) => subscriber(this.authStateValue));
|
|
418
|
+
}
|
|
419
|
+
async loadAuthClientConstructor() {
|
|
420
|
+
if (this.authClientConstructor) {
|
|
421
|
+
return this.authClientConstructor;
|
|
422
|
+
}
|
|
423
|
+
if (!this.authClientConstructorPromise) {
|
|
424
|
+
// The specifier must stay a literal: a variable specifier (or /* @vite-ignore */)
|
|
425
|
+
// makes bundlers skip this import entirely, so the bare specifier survives into
|
|
426
|
+
// the browser, where it cannot be resolved without an import map and every login
|
|
427
|
+
// path fails. A literal lets Vite/Rollup/webpack code-split the optional peer,
|
|
428
|
+
// and lets them tree-shake it away for apps that never reference this class.
|
|
429
|
+
this.authClientConstructorPromise = import("@icp-sdk/auth/client")
|
|
430
|
+
.then((authModule) => {
|
|
431
|
+
const AuthClient = authModule.AuthClient;
|
|
432
|
+
if (!AuthClient) {
|
|
433
|
+
throw new Error("@icp-sdk/auth/client did not export AuthClient");
|
|
434
|
+
}
|
|
435
|
+
this.authClientConstructor = AuthClient;
|
|
436
|
+
return AuthClient;
|
|
437
|
+
})
|
|
438
|
+
.catch((error) => {
|
|
439
|
+
this.authModuleMissing = true;
|
|
440
|
+
this.authClientConstructorPromise = undefined;
|
|
441
|
+
if (error instanceof Error &&
|
|
442
|
+
error.message.includes("did not export AuthClient")) {
|
|
443
|
+
throw error;
|
|
444
|
+
}
|
|
445
|
+
return undefined;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
return this.authClientConstructorPromise;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function getAuthClientOptions(options) {
|
|
452
|
+
if (!options) {
|
|
453
|
+
return undefined;
|
|
454
|
+
}
|
|
455
|
+
return {
|
|
456
|
+
identityProvider: options.identityProvider,
|
|
457
|
+
windowOpenerFeatures: options.windowOpenerFeatures,
|
|
458
|
+
openIdProvider: getAuthClientOpenIdProvider(options.openIdProvider),
|
|
459
|
+
derivationOrigin: options.derivationOrigin,
|
|
460
|
+
storage: options.storage,
|
|
461
|
+
keyType: options.keyType,
|
|
462
|
+
idleOptions: options.idleOptions,
|
|
463
|
+
identity: options.identity,
|
|
464
|
+
transport: options.transport,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function getAuthClientOpenIdProvider(openIdProvider) {
|
|
468
|
+
return openIdProvider === "google" ||
|
|
469
|
+
openIdProvider === "apple" ||
|
|
470
|
+
openIdProvider === "microsoft"
|
|
471
|
+
? openIdProvider
|
|
472
|
+
: undefined;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Compares the options two AuthClients would be built from. Object-valued
|
|
476
|
+
* options (`storage`, `identity`, `idleOptions`) are compared by reference,
|
|
477
|
+
* which is what module-scoped configuration produces.
|
|
478
|
+
*/
|
|
479
|
+
function isSameAuthClientOptions(current, next) {
|
|
480
|
+
if (current === next) {
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
if (!current || !next) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
return (String(current.identityProvider ?? "") ===
|
|
487
|
+
String(next.identityProvider ?? "") &&
|
|
488
|
+
current.windowOpenerFeatures === next.windowOpenerFeatures &&
|
|
489
|
+
current.openIdProvider === next.openIdProvider &&
|
|
490
|
+
String(current.derivationOrigin ?? "") ===
|
|
491
|
+
String(next.derivationOrigin ?? "") &&
|
|
492
|
+
current.storage === next.storage &&
|
|
493
|
+
current.keyType === next.keyType &&
|
|
494
|
+
current.idleOptions === next.idleOptions &&
|
|
495
|
+
current.identity === next.identity &&
|
|
496
|
+
current.transport === next.transport);
|
|
497
|
+
}
|
|
498
|
+
function getAuthenticationCanisterEnv() {
|
|
499
|
+
const canisterEnv = safeGetCanisterEnv();
|
|
500
|
+
if (canisterEnv) {
|
|
501
|
+
return canisterEnv;
|
|
502
|
+
}
|
|
503
|
+
if (typeof document === "undefined") {
|
|
504
|
+
return undefined;
|
|
505
|
+
}
|
|
506
|
+
const cookie = document.cookie
|
|
507
|
+
.split(";")
|
|
508
|
+
.find((part) => part.trim().startsWith("ic_env="));
|
|
509
|
+
const encodedValue = cookie?.split("=").slice(1).join("=")?.trim();
|
|
510
|
+
if (!encodedValue) {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
513
|
+
const env = Object.fromEntries(decodeURIComponent(encodedValue)
|
|
514
|
+
.split("&")
|
|
515
|
+
.map((entry) => {
|
|
516
|
+
const separatorIndex = entry.indexOf("=");
|
|
517
|
+
return separatorIndex === -1
|
|
518
|
+
? [entry, ""]
|
|
519
|
+
: [entry.slice(0, separatorIndex), entry.slice(separatorIndex + 1)];
|
|
520
|
+
}));
|
|
521
|
+
return Object.keys(env).length ? env : undefined;
|
|
522
|
+
}
|
|
523
|
+
function getSignInOptions(options) {
|
|
524
|
+
if (!options) {
|
|
525
|
+
return undefined;
|
|
526
|
+
}
|
|
527
|
+
return {
|
|
528
|
+
maxTimeToLive: options.maxTimeToLive,
|
|
529
|
+
targets: options.targets,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
//# sourceMappingURL=authentication-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-manager.js","sourceRoot":"","sources":["../../src/auth/authentication-manager.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EACL,6BAA6B,EAC7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GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;AAClD,CAAC;AAED,SAAS,gBAAgB,CACvB,OAAqC;IAErC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO;QACL,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const IC_INTERNET_IDENTITY_PROVIDER = "https://id.ai/authorize";
|
|
2
|
+
/**
|
|
3
|
+
* `ic_env` key used to provide a fully resolved Internet Identity URL.
|
|
4
|
+
*/
|
|
5
|
+
export declare const INTERNET_IDENTITY_PROVIDER_ENV_KEY = "INTERNET_IDENTITY_PROVIDER";
|
|
6
|
+
/**
|
|
7
|
+
* Well-known Internet Identity canister ID used when deploying II locally.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LOCAL_INTERNET_IDENTITY_CANISTER_ID = "rdmx6-jaaaa-aaaaa-aaadq-cai";
|
|
10
|
+
/**
|
|
11
|
+
* Builds the local Internet Identity provider URL for the given replica port.
|
|
12
|
+
*/
|
|
13
|
+
export declare const localInternetIdentityProvider: (port: number, canisterId?: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Legacy default URL for local Internet Identity, using port `4943`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const LOCAL_INTERNET_IDENTITY_PROVIDER: string;
|
|
18
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/auth/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,4BAA4B,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,kCAAkC,+BAA+B,CAAA;AAE9E;;GAEG;AACH,eAAO,MAAM,mCAAmC,gCAAgC,CAAA;AAEhF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,MAAM,MAAM,EACZ,aAAY,MAA4C,WACH,CAAA;AAEvD;;GAEG;AACH,eAAO,MAAM,gCAAgC,QACR,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const IC_INTERNET_IDENTITY_PROVIDER = "https://id.ai/authorize";
|
|
2
|
+
/**
|
|
3
|
+
* `ic_env` key used to provide a fully resolved Internet Identity URL.
|
|
4
|
+
*/
|
|
5
|
+
export const INTERNET_IDENTITY_PROVIDER_ENV_KEY = "INTERNET_IDENTITY_PROVIDER";
|
|
6
|
+
/**
|
|
7
|
+
* Well-known Internet Identity canister ID used when deploying II locally.
|
|
8
|
+
*/
|
|
9
|
+
export const LOCAL_INTERNET_IDENTITY_CANISTER_ID = "rdmx6-jaaaa-aaaaa-aaadq-cai";
|
|
10
|
+
/**
|
|
11
|
+
* Builds the local Internet Identity provider URL for the given replica port.
|
|
12
|
+
*/
|
|
13
|
+
export const localInternetIdentityProvider = (port, canisterId = LOCAL_INTERNET_IDENTITY_CANISTER_ID) => `http://${canisterId}.localhost:${port}/authorize`;
|
|
14
|
+
/**
|
|
15
|
+
* Legacy default URL for local Internet Identity, using port `4943`.
|
|
16
|
+
*/
|
|
17
|
+
export const LOCAL_INTERNET_IDENTITY_PROVIDER = localInternetIdentityProvider(4943);
|
|
18
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/auth/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAA;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,4BAA4B,CAAA;AAE9E;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,6BAA6B,CAAA;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,IAAY,EACZ,aAAqB,mCAAmC,EACxD,EAAE,CAAC,UAAU,UAAU,cAAc,IAAI,YAAY,CAAA;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,6BAA6B,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IdentityAttributesManager } from "./identity-attributes-manager.js";
|
|
2
|
+
import type { IdentityAttributeResult, RequestIdentityAttributesParameters, RequestOpenIdIdentityAttributesParameters } from "./types.js";
|
|
3
|
+
export interface UseIdentityAttributesReturn {
|
|
4
|
+
requestAttributes: (params: RequestIdentityAttributesParameters) => Promise<IdentityAttributeResult>;
|
|
5
|
+
requestOpenIdAttributes: (params: RequestOpenIdIdentityAttributesParameters) => Promise<IdentityAttributeResult>;
|
|
6
|
+
attributes: IdentityAttributeResult | null;
|
|
7
|
+
isRequestingAttributes: boolean;
|
|
8
|
+
attributeError: Error | null;
|
|
9
|
+
clearAttributes: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createIdentityAttributeHooks(identityAttributes: IdentityAttributesManager): {
|
|
12
|
+
useIdentityAttributes: () => UseIdentityAttributesReturn;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=createIdentityAttributeHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIdentityAttributeHooks.d.ts","sourceRoot":"","sources":["../../src/auth/createIdentityAttributeHooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EACV,uBAAuB,EACvB,mCAAmC,EACnC,yCAAyC,EAC1C,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,EAAE,CACjB,MAAM,EAAE,mCAAmC,KACxC,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACrC,uBAAuB,EAAE,CACvB,MAAM,EAAE,yCAAyC,KAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACrC,UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC1C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,cAAc,EAAE,KAAK,GAAG,IAAI,CAAA;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B;AAED,wBAAgB,4BAA4B,CAC1C,kBAAkB,EAAE,yBAAyB;iCAEX,2BAA2B;EA0D9D"}
|