@junobuild/ic-client 3.1.4 → 4.0.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.
Files changed (60) hide show
  1. package/actor/api/actor.api.d.ts +2 -2
  2. package/actor/api/agent.api.d.ts +1 -1
  3. package/actor/types/actor.d.ts +2 -2
  4. package/actor/utils/agent.utils.d.ts +1 -1
  5. package/actor.js +1 -1
  6. package/actor.js.map +3 -3
  7. package/actor.mjs +1 -1
  8. package/actor.mjs.map +3 -3
  9. package/declarations/console/console.did.d.ts +128 -3
  10. package/declarations/console/console.factory.certified.did.js +148 -8
  11. package/declarations/console/console.factory.did.js +148 -8
  12. package/declarations/console/console.factory.did.mjs +148 -8
  13. package/declarations/deprecated/console-0-0-14.did.d.ts +3 -3
  14. package/declarations/deprecated/console-0-0-8-patch1.did.d.ts +3 -3
  15. package/declarations/deprecated/mission_control-0-0-13.did.d.ts +3 -3
  16. package/declarations/deprecated/mission_control-0-0-14.did.d.ts +3 -3
  17. package/declarations/deprecated/mission_control-0-0-4.did.d.ts +2 -2
  18. package/declarations/deprecated/mission_control-deprecated-version.did.d.ts +3 -3
  19. package/declarations/deprecated/observatory-0-0-9.did.d.ts +3 -3
  20. package/declarations/deprecated/orbiter-0-0-6.did.d.ts +3 -3
  21. package/declarations/deprecated/orbiter-0-0-7.did.d.ts +3 -3
  22. package/declarations/deprecated/orbiter-0-0-8.did.d.ts +3 -3
  23. package/declarations/deprecated/orbiter-0-2-0.did.d.ts +3 -3
  24. package/declarations/deprecated/orbiter-deprecated-version.did.d.ts +3 -3
  25. package/declarations/deprecated/satellite-0-0-16.did.d.ts +3 -3
  26. package/declarations/deprecated/satellite-0-0-17.did.d.ts +3 -3
  27. package/declarations/deprecated/satellite-0-0-21.did.d.ts +3 -3
  28. package/declarations/deprecated/satellite-0-0-22.did.d.ts +3 -3
  29. package/declarations/deprecated/satellite-0-0-8.did.d.ts +2 -2
  30. package/declarations/deprecated/satellite-0-0-9.did.d.ts +2 -2
  31. package/declarations/deprecated/satellite-deprecated-no-scope.did.d.ts +2 -2
  32. package/declarations/deprecated/satellite-deprecated-version.did.d.ts +3 -3
  33. package/declarations/deprecated/satellite-deprecated.did.d.ts +2 -2
  34. package/declarations/mission_control/mission_control.did.d.ts +3 -3
  35. package/declarations/observatory/observatory.did.d.ts +47 -3
  36. package/declarations/observatory/observatory.factory.certified.did.js +39 -1
  37. package/declarations/observatory/observatory.factory.did.js +43 -1
  38. package/declarations/observatory/observatory.factory.did.mjs +43 -1
  39. package/declarations/orbiter/orbiter.did.d.ts +3 -3
  40. package/declarations/satellite/satellite.did.d.ts +92 -3
  41. package/declarations/satellite/satellite.factory.certified.did.js +106 -7
  42. package/declarations/satellite/satellite.factory.did.js +106 -7
  43. package/declarations/satellite/satellite.factory.did.mjs +106 -7
  44. package/declarations/sputnik/sputnik.did.d.ts +92 -3
  45. package/declarations/sputnik/sputnik.factory.certified.did.js +106 -7
  46. package/declarations/sputnik/sputnik.factory.did.js +106 -7
  47. package/package.json +3 -6
  48. package/utils/principal.utils.d.ts +1 -1
  49. package/utils.js +1 -1
  50. package/utils.js.map +2 -2
  51. package/utils.mjs +1 -1
  52. package/utils.mjs.map +2 -2
  53. package/webauthn/agent-js/cose-key.d.ts +1 -1
  54. package/webauthn/agent-js/cose-utils.d.ts +1 -1
  55. package/webauthn/identity.d.ts +1 -1
  56. package/webauthn/types/identity.d.ts +1 -1
  57. package/webauthn.js +1 -1
  58. package/webauthn.js.map +3 -3
  59. package/webauthn.mjs +1 -1
  60. package/webauthn.mjs.map +3 -3
@@ -1,6 +1,6 @@
1
- import type { ActorMethod } from '@dfinity/agent';
2
- import type { IDL } from '@dfinity/candid';
3
- import type { Principal } from '@dfinity/principal';
1
+ import type { ActorMethod } from '@icp-sdk/core/agent';
2
+ import type { IDL } from '@icp-sdk/core/candid';
3
+ import type { Principal } from '@icp-sdk/core/principal';
4
4
 
5
5
  export interface AssertMissionControlCenterArgs {
6
6
  mission_control_id: Principal;
@@ -30,6 +30,35 @@ export interface AssetNoContent {
30
30
  export interface AssetsUpgradeOptions {
31
31
  clear_existing_assets: [] | [boolean];
32
32
  }
33
+ export interface Authentication {
34
+ delegation: PreparedDelegation;
35
+ mission_control: MissionControl;
36
+ }
37
+ export type AuthenticationArgs = { OpenId: OpenIdPrepareDelegationArgs };
38
+ export interface AuthenticationConfig {
39
+ updated_at: [] | [bigint];
40
+ openid: [] | [AuthenticationConfigOpenId];
41
+ created_at: [] | [bigint];
42
+ version: [] | [bigint];
43
+ internet_identity: [] | [AuthenticationConfigInternetIdentity];
44
+ rules: [] | [AuthenticationRules];
45
+ }
46
+ export interface AuthenticationConfigInternetIdentity {
47
+ derivation_origin: [] | [string];
48
+ external_alternative_origins: [] | [Array<string>];
49
+ }
50
+ export interface AuthenticationConfigOpenId {
51
+ observatory_id: [] | [Principal];
52
+ providers: Array<[OpenIdProvider, OpenIdProviderConfig]>;
53
+ }
54
+ export type AuthenticationError =
55
+ | {
56
+ PrepareDelegation: PrepareDelegationError;
57
+ }
58
+ | { RegisterUser: string };
59
+ export interface AuthenticationRules {
60
+ allowed_callers: Array<Principal>;
61
+ }
33
62
  export interface CommitBatch {
34
63
  batch_id: bigint;
35
64
  headers: Array<[string, string]>;
@@ -40,6 +69,7 @@ export interface CommitProposal {
40
69
  proposal_id: bigint;
41
70
  }
42
71
  export interface Config {
72
+ authentication: [] | [AuthenticationConfig];
43
73
  storage: StorageConfig;
44
74
  }
45
75
  export interface ConfigMaxMemorySize {
@@ -71,6 +101,11 @@ export interface CustomDomain {
71
101
  version: [] | [bigint];
72
102
  bn_id: [] | [string];
73
103
  }
104
+ export interface Delegation {
105
+ pubkey: Uint8Array | number[];
106
+ targets: [] | [Array<Principal>];
107
+ expiration: bigint;
108
+ }
74
109
  export interface DeleteControllersArgs {
75
110
  controllers: Array<Principal>;
76
111
  }
@@ -80,6 +115,24 @@ export interface DeleteProposalAssets {
80
115
  export interface GetCreateCanisterFeeArgs {
81
116
  user: Principal;
82
117
  }
118
+ export type GetDelegationArgs = { OpenId: OpenIdGetDelegationArgs };
119
+ export type GetDelegationError =
120
+ | { JwtFindProvider: JwtFindProviderError }
121
+ | { GetCachedJwks: null }
122
+ | { NoSuchDelegation: null }
123
+ | { JwtVerify: JwtVerifyError }
124
+ | { GetOrFetchJwks: GetOrRefreshJwksError }
125
+ | { DeriveSeedFailed: string };
126
+ export type GetOrRefreshJwksError =
127
+ | { InvalidConfig: string }
128
+ | { MissingKid: null }
129
+ | { BadClaim: string }
130
+ | { KeyNotFoundCooldown: null }
131
+ | { CertificateNotFound: null }
132
+ | { BadSig: string }
133
+ | { MissingLastAttempt: string }
134
+ | { KeyNotFound: null }
135
+ | { FetchFailed: string };
83
136
  export interface HttpRequest {
84
137
  url: string;
85
138
  method: string;
@@ -108,6 +161,16 @@ export type InitStorageMemory = { Heap: null } | { Stable: null };
108
161
  export interface InitUploadResult {
109
162
  batch_id: bigint;
110
163
  }
164
+ export type JwtFindProviderError =
165
+ | { BadClaim: string }
166
+ | { BadSig: string }
167
+ | { NoMatchingProvider: null };
168
+ export type JwtVerifyError =
169
+ | { WrongKeyType: null }
170
+ | { MissingKid: null }
171
+ | { BadClaim: string }
172
+ | { BadSig: string }
173
+ | { NoKeyForKid: null };
111
174
  export interface ListMatcher {
112
175
  key: [] | [string];
113
176
  updated_at: [] | [TimestampMatcher];
@@ -157,9 +220,42 @@ export interface MissionControl {
157
220
  updated_at: bigint;
158
221
  credits: Tokens;
159
222
  mission_control_id: [] | [Principal];
223
+ provider: [] | [Provider];
160
224
  owner: Principal;
161
225
  created_at: bigint;
162
226
  }
227
+ export interface OpenId {
228
+ provider: OpenIdProvider;
229
+ data: OpenIdData;
230
+ }
231
+ export interface OpenIdData {
232
+ name: [] | [string];
233
+ locale: [] | [string];
234
+ family_name: [] | [string];
235
+ email: [] | [string];
236
+ picture: [] | [string];
237
+ given_name: [] | [string];
238
+ }
239
+ export interface OpenIdGetDelegationArgs {
240
+ jwt: string;
241
+ session_key: Uint8Array | number[];
242
+ salt: Uint8Array | number[];
243
+ expiration: bigint;
244
+ }
245
+ export interface OpenIdPrepareDelegationArgs {
246
+ jwt: string;
247
+ session_key: Uint8Array | number[];
248
+ salt: Uint8Array | number[];
249
+ }
250
+ export type OpenIdProvider = { Google: null };
251
+ export interface OpenIdProviderConfig {
252
+ delegation: [] | [OpenIdProviderDelegationConfig];
253
+ client_id: string;
254
+ }
255
+ export interface OpenIdProviderDelegationConfig {
256
+ targets: [] | [Array<Principal>];
257
+ max_time_to_live: [] | [bigint];
258
+ }
163
259
  export interface Payment {
164
260
  status: PaymentStatus;
165
261
  updated_at: bigint;
@@ -169,6 +265,18 @@ export interface Payment {
169
265
  block_index_refunded: [] | [bigint];
170
266
  }
171
267
  export type PaymentStatus = { Refunded: null } | { Acknowledged: null } | { Completed: null };
268
+ export type PrepareDelegationError =
269
+ | {
270
+ JwtFindProvider: JwtFindProviderError;
271
+ }
272
+ | { GetCachedJwks: null }
273
+ | { JwtVerify: JwtVerifyError }
274
+ | { GetOrFetchJwks: GetOrRefreshJwksError }
275
+ | { DeriveSeedFailed: string };
276
+ export interface PreparedDelegation {
277
+ user_key: Uint8Array | number[];
278
+ expiration: bigint;
279
+ }
172
280
  export interface Proposal {
173
281
  status: ProposalStatus;
174
282
  updated_at: bigint;
@@ -192,16 +300,25 @@ export type ProposalStatus =
192
300
  export type ProposalType =
193
301
  | { AssetsUpgrade: AssetsUpgradeOptions }
194
302
  | { SegmentsDeployment: SegmentsDeploymentOptions };
303
+ export type Provider = { InternetIdentity: null } | { OpenId: OpenId };
195
304
  export interface RateConfig {
196
305
  max_tokens: bigint;
197
306
  time_per_token_ns: bigint;
198
307
  }
308
+ export type Result = { Ok: Authentication } | { Err: AuthenticationError };
309
+ export type Result_1 = { Ok: SignedDelegation } | { Err: GetDelegationError };
199
310
  export type SegmentKind = { Orbiter: null } | { MissionControl: null } | { Satellite: null };
200
311
  export interface SegmentsDeploymentOptions {
201
312
  orbiter: [] | [string];
202
313
  mission_control_version: [] | [string];
203
314
  satellite_version: [] | [string];
204
315
  }
316
+ export interface SetAuthenticationConfig {
317
+ openid: [] | [AuthenticationConfigOpenId];
318
+ version: [] | [bigint];
319
+ internet_identity: [] | [AuthenticationConfigInternetIdentity];
320
+ rules: [] | [AuthenticationRules];
321
+ }
205
322
  export interface SetController {
206
323
  metadata: Array<[string, string]>;
207
324
  scope: ControllerScope;
@@ -220,6 +337,10 @@ export interface SetStorageConfig {
220
337
  raw_access: [] | [StorageConfigRawAccess];
221
338
  redirects: [] | [Array<[string, StorageConfigRedirect]>];
222
339
  }
340
+ export interface SignedDelegation {
341
+ signature: Uint8Array | number[];
342
+ delegation: Delegation;
343
+ }
223
344
  export interface StorageConfig {
224
345
  iframe: [] | [StorageConfigIFrame];
225
346
  updated_at: [] | [bigint];
@@ -276,6 +397,7 @@ export interface _SERVICE {
276
397
  add_credits: ActorMethod<[Principal, Tokens], undefined>;
277
398
  add_invitation_code: ActorMethod<[string], undefined>;
278
399
  assert_mission_control_center: ActorMethod<[AssertMissionControlCenterArgs], undefined>;
400
+ authenticate: ActorMethod<[AuthenticationArgs], Result>;
279
401
  commit_proposal: ActorMethod<[CommitProposal], null>;
280
402
  commit_proposal_asset_upload: ActorMethod<[CommitBatch], undefined>;
281
403
  commit_proposal_many_assets_upload: ActorMethod<[Array<CommitBatch>], undefined>;
@@ -285,10 +407,12 @@ export interface _SERVICE {
285
407
  del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
286
408
  del_custom_domain: ActorMethod<[string], undefined>;
287
409
  delete_proposal_assets: ActorMethod<[DeleteProposalAssets], undefined>;
410
+ get_auth_config: ActorMethod<[], [] | [AuthenticationConfig]>;
288
411
  get_config: ActorMethod<[], Config>;
289
412
  get_create_orbiter_fee: ActorMethod<[GetCreateCanisterFeeArgs], [] | [Tokens]>;
290
413
  get_create_satellite_fee: ActorMethod<[GetCreateCanisterFeeArgs], [] | [Tokens]>;
291
414
  get_credits: ActorMethod<[], Tokens>;
415
+ get_delegation: ActorMethod<[GetDelegationArgs], Result_1>;
292
416
  get_proposal: ActorMethod<[bigint], [] | [Proposal]>;
293
417
  get_storage_config: ActorMethod<[], StorageConfig>;
294
418
  get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>;
@@ -311,6 +435,7 @@ export interface _SERVICE {
311
435
  list_proposals: ActorMethod<[ListProposalsParams], ListProposalResults>;
312
436
  list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>;
313
437
  reject_proposal: ActorMethod<[CommitProposal], null>;
438
+ set_auth_config: ActorMethod<[SetAuthenticationConfig], AuthenticationConfig>;
314
439
  set_controllers: ActorMethod<[SetControllersArgs], undefined>;
315
440
  set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
316
441
  set_fee: ActorMethod<[SegmentKind, Tokens], undefined>;
@@ -5,6 +5,85 @@ export const idlFactory = ({IDL}) => {
5
5
  mission_control_id: IDL.Principal,
6
6
  user: IDL.Principal
7
7
  });
8
+ const OpenIdPrepareDelegationArgs = IDL.Record({
9
+ jwt: IDL.Text,
10
+ session_key: IDL.Vec(IDL.Nat8),
11
+ salt: IDL.Vec(IDL.Nat8)
12
+ });
13
+ const AuthenticationArgs = IDL.Variant({
14
+ OpenId: OpenIdPrepareDelegationArgs
15
+ });
16
+ const PreparedDelegation = IDL.Record({
17
+ user_key: IDL.Vec(IDL.Nat8),
18
+ expiration: IDL.Nat64
19
+ });
20
+ const OpenIdProvider = IDL.Variant({Google: IDL.Null});
21
+ const OpenIdData = IDL.Record({
22
+ name: IDL.Opt(IDL.Text),
23
+ locale: IDL.Opt(IDL.Text),
24
+ family_name: IDL.Opt(IDL.Text),
25
+ email: IDL.Opt(IDL.Text),
26
+ picture: IDL.Opt(IDL.Text),
27
+ given_name: IDL.Opt(IDL.Text)
28
+ });
29
+ const OpenId = IDL.Record({
30
+ provider: OpenIdProvider,
31
+ data: OpenIdData
32
+ });
33
+ const Provider = IDL.Variant({
34
+ InternetIdentity: IDL.Null,
35
+ OpenId: OpenId
36
+ });
37
+ const MissionControl = IDL.Record({
38
+ updated_at: IDL.Nat64,
39
+ credits: Tokens,
40
+ mission_control_id: IDL.Opt(IDL.Principal),
41
+ provider: IDL.Opt(Provider),
42
+ owner: IDL.Principal,
43
+ created_at: IDL.Nat64
44
+ });
45
+ const Authentication = IDL.Record({
46
+ delegation: PreparedDelegation,
47
+ mission_control: MissionControl
48
+ });
49
+ const JwtFindProviderError = IDL.Variant({
50
+ BadClaim: IDL.Text,
51
+ BadSig: IDL.Text,
52
+ NoMatchingProvider: IDL.Null
53
+ });
54
+ const JwtVerifyError = IDL.Variant({
55
+ WrongKeyType: IDL.Null,
56
+ MissingKid: IDL.Null,
57
+ BadClaim: IDL.Text,
58
+ BadSig: IDL.Text,
59
+ NoKeyForKid: IDL.Null
60
+ });
61
+ const GetOrRefreshJwksError = IDL.Variant({
62
+ InvalidConfig: IDL.Text,
63
+ MissingKid: IDL.Null,
64
+ BadClaim: IDL.Text,
65
+ KeyNotFoundCooldown: IDL.Null,
66
+ CertificateNotFound: IDL.Null,
67
+ BadSig: IDL.Text,
68
+ MissingLastAttempt: IDL.Text,
69
+ KeyNotFound: IDL.Null,
70
+ FetchFailed: IDL.Text
71
+ });
72
+ const PrepareDelegationError = IDL.Variant({
73
+ JwtFindProvider: JwtFindProviderError,
74
+ GetCachedJwks: IDL.Null,
75
+ JwtVerify: JwtVerifyError,
76
+ GetOrFetchJwks: GetOrRefreshJwksError,
77
+ DeriveSeedFailed: IDL.Text
78
+ });
79
+ const AuthenticationError = IDL.Variant({
80
+ PrepareDelegation: PrepareDelegationError,
81
+ RegisterUser: IDL.Text
82
+ });
83
+ const Result = IDL.Variant({
84
+ Ok: Authentication,
85
+ Err: AuthenticationError
86
+ });
8
87
  const CommitProposal = IDL.Record({
9
88
  sha256: IDL.Vec(IDL.Nat8),
10
89
  proposal_id: IDL.Nat
@@ -38,6 +117,33 @@ export const idlFactory = ({IDL}) => {
38
117
  const DeleteProposalAssets = IDL.Record({
39
118
  proposal_ids: IDL.Vec(IDL.Nat)
40
119
  });
120
+ const OpenIdProviderDelegationConfig = IDL.Record({
121
+ targets: IDL.Opt(IDL.Vec(IDL.Principal)),
122
+ max_time_to_live: IDL.Opt(IDL.Nat64)
123
+ });
124
+ const OpenIdProviderConfig = IDL.Record({
125
+ delegation: IDL.Opt(OpenIdProviderDelegationConfig),
126
+ client_id: IDL.Text
127
+ });
128
+ const AuthenticationConfigOpenId = IDL.Record({
129
+ observatory_id: IDL.Opt(IDL.Principal),
130
+ providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))
131
+ });
132
+ const AuthenticationConfigInternetIdentity = IDL.Record({
133
+ derivation_origin: IDL.Opt(IDL.Text),
134
+ external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
135
+ });
136
+ const AuthenticationRules = IDL.Record({
137
+ allowed_callers: IDL.Vec(IDL.Principal)
138
+ });
139
+ const AuthenticationConfig = IDL.Record({
140
+ updated_at: IDL.Opt(IDL.Nat64),
141
+ openid: IDL.Opt(AuthenticationConfigOpenId),
142
+ created_at: IDL.Opt(IDL.Nat64),
143
+ version: IDL.Opt(IDL.Nat64),
144
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
145
+ rules: IDL.Opt(AuthenticationRules)
146
+ });
41
147
  const StorageConfigIFrame = IDL.Variant({
42
148
  Deny: IDL.Null,
43
149
  AllowAny: IDL.Null,
@@ -66,8 +172,39 @@ export const idlFactory = ({IDL}) => {
66
172
  raw_access: IDL.Opt(StorageConfigRawAccess),
67
173
  redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
68
174
  });
69
- const Config = IDL.Record({storage: StorageConfig});
175
+ const Config = IDL.Record({
176
+ authentication: IDL.Opt(AuthenticationConfig),
177
+ storage: StorageConfig
178
+ });
70
179
  const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});
180
+ const OpenIdGetDelegationArgs = IDL.Record({
181
+ jwt: IDL.Text,
182
+ session_key: IDL.Vec(IDL.Nat8),
183
+ salt: IDL.Vec(IDL.Nat8),
184
+ expiration: IDL.Nat64
185
+ });
186
+ const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});
187
+ const Delegation = IDL.Record({
188
+ pubkey: IDL.Vec(IDL.Nat8),
189
+ targets: IDL.Opt(IDL.Vec(IDL.Principal)),
190
+ expiration: IDL.Nat64
191
+ });
192
+ const SignedDelegation = IDL.Record({
193
+ signature: IDL.Vec(IDL.Nat8),
194
+ delegation: Delegation
195
+ });
196
+ const GetDelegationError = IDL.Variant({
197
+ JwtFindProvider: JwtFindProviderError,
198
+ GetCachedJwks: IDL.Null,
199
+ NoSuchDelegation: IDL.Null,
200
+ JwtVerify: JwtVerifyError,
201
+ GetOrFetchJwks: GetOrRefreshJwksError,
202
+ DeriveSeedFailed: IDL.Text
203
+ });
204
+ const Result_1 = IDL.Variant({
205
+ Ok: SignedDelegation,
206
+ Err: GetDelegationError
207
+ });
71
208
  const ProposalStatus = IDL.Variant({
72
209
  Initialized: IDL.Null,
73
210
  Failed: IDL.Null,
@@ -98,13 +235,6 @@ export const idlFactory = ({IDL}) => {
98
235
  version: IDL.Opt(IDL.Nat64),
99
236
  proposal_type: ProposalType
100
237
  });
101
- const MissionControl = IDL.Record({
102
- updated_at: IDL.Nat64,
103
- credits: Tokens,
104
- mission_control_id: IDL.Opt(IDL.Principal),
105
- owner: IDL.Principal,
106
- created_at: IDL.Nat64
107
- });
108
238
  const HttpRequest = IDL.Record({
109
239
  url: IDL.Text,
110
240
  method: IDL.Text,
@@ -249,6 +379,12 @@ export const idlFactory = ({IDL}) => {
249
379
  items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),
250
380
  items_length: IDL.Nat64
251
381
  });
382
+ const SetAuthenticationConfig = IDL.Record({
383
+ openid: IDL.Opt(AuthenticationConfigOpenId),
384
+ version: IDL.Opt(IDL.Nat64),
385
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
386
+ rules: IDL.Opt(AuthenticationRules)
387
+ });
252
388
  const SetController = IDL.Record({
253
389
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
254
390
  scope: ControllerScope,
@@ -286,6 +422,7 @@ export const idlFactory = ({IDL}) => {
286
422
  add_credits: IDL.Func([IDL.Principal, Tokens], [], []),
287
423
  add_invitation_code: IDL.Func([IDL.Text], [], []),
288
424
  assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], []),
425
+ authenticate: IDL.Func([AuthenticationArgs], [Result], []),
289
426
  commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
290
427
  commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),
291
428
  commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),
@@ -295,10 +432,12 @@ export const idlFactory = ({IDL}) => {
295
432
  del_controllers: IDL.Func([DeleteControllersArgs], [], []),
296
433
  del_custom_domain: IDL.Func([IDL.Text], [], []),
297
434
  delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),
435
+ get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),
298
436
  get_config: IDL.Func([], [Config], []),
299
437
  get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),
300
438
  get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),
301
439
  get_credits: IDL.Func([], [Tokens], []),
440
+ get_delegation: IDL.Func([GetDelegationArgs], [Result_1], []),
302
441
  get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),
303
442
  get_storage_config: IDL.Func([], [StorageConfig], []),
304
443
  get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], []),
@@ -327,6 +466,7 @@ export const idlFactory = ({IDL}) => {
327
466
  []
328
467
  ),
329
468
  reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
469
+ set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),
330
470
  set_controllers: IDL.Func([SetControllersArgs], [], []),
331
471
  set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
332
472
  set_fee: IDL.Func([SegmentKind, Tokens], [], []),
@@ -5,6 +5,85 @@ export const idlFactory = ({IDL}) => {
5
5
  mission_control_id: IDL.Principal,
6
6
  user: IDL.Principal
7
7
  });
8
+ const OpenIdPrepareDelegationArgs = IDL.Record({
9
+ jwt: IDL.Text,
10
+ session_key: IDL.Vec(IDL.Nat8),
11
+ salt: IDL.Vec(IDL.Nat8)
12
+ });
13
+ const AuthenticationArgs = IDL.Variant({
14
+ OpenId: OpenIdPrepareDelegationArgs
15
+ });
16
+ const PreparedDelegation = IDL.Record({
17
+ user_key: IDL.Vec(IDL.Nat8),
18
+ expiration: IDL.Nat64
19
+ });
20
+ const OpenIdProvider = IDL.Variant({Google: IDL.Null});
21
+ const OpenIdData = IDL.Record({
22
+ name: IDL.Opt(IDL.Text),
23
+ locale: IDL.Opt(IDL.Text),
24
+ family_name: IDL.Opt(IDL.Text),
25
+ email: IDL.Opt(IDL.Text),
26
+ picture: IDL.Opt(IDL.Text),
27
+ given_name: IDL.Opt(IDL.Text)
28
+ });
29
+ const OpenId = IDL.Record({
30
+ provider: OpenIdProvider,
31
+ data: OpenIdData
32
+ });
33
+ const Provider = IDL.Variant({
34
+ InternetIdentity: IDL.Null,
35
+ OpenId: OpenId
36
+ });
37
+ const MissionControl = IDL.Record({
38
+ updated_at: IDL.Nat64,
39
+ credits: Tokens,
40
+ mission_control_id: IDL.Opt(IDL.Principal),
41
+ provider: IDL.Opt(Provider),
42
+ owner: IDL.Principal,
43
+ created_at: IDL.Nat64
44
+ });
45
+ const Authentication = IDL.Record({
46
+ delegation: PreparedDelegation,
47
+ mission_control: MissionControl
48
+ });
49
+ const JwtFindProviderError = IDL.Variant({
50
+ BadClaim: IDL.Text,
51
+ BadSig: IDL.Text,
52
+ NoMatchingProvider: IDL.Null
53
+ });
54
+ const JwtVerifyError = IDL.Variant({
55
+ WrongKeyType: IDL.Null,
56
+ MissingKid: IDL.Null,
57
+ BadClaim: IDL.Text,
58
+ BadSig: IDL.Text,
59
+ NoKeyForKid: IDL.Null
60
+ });
61
+ const GetOrRefreshJwksError = IDL.Variant({
62
+ InvalidConfig: IDL.Text,
63
+ MissingKid: IDL.Null,
64
+ BadClaim: IDL.Text,
65
+ KeyNotFoundCooldown: IDL.Null,
66
+ CertificateNotFound: IDL.Null,
67
+ BadSig: IDL.Text,
68
+ MissingLastAttempt: IDL.Text,
69
+ KeyNotFound: IDL.Null,
70
+ FetchFailed: IDL.Text
71
+ });
72
+ const PrepareDelegationError = IDL.Variant({
73
+ JwtFindProvider: JwtFindProviderError,
74
+ GetCachedJwks: IDL.Null,
75
+ JwtVerify: JwtVerifyError,
76
+ GetOrFetchJwks: GetOrRefreshJwksError,
77
+ DeriveSeedFailed: IDL.Text
78
+ });
79
+ const AuthenticationError = IDL.Variant({
80
+ PrepareDelegation: PrepareDelegationError,
81
+ RegisterUser: IDL.Text
82
+ });
83
+ const Result = IDL.Variant({
84
+ Ok: Authentication,
85
+ Err: AuthenticationError
86
+ });
8
87
  const CommitProposal = IDL.Record({
9
88
  sha256: IDL.Vec(IDL.Nat8),
10
89
  proposal_id: IDL.Nat
@@ -38,6 +117,33 @@ export const idlFactory = ({IDL}) => {
38
117
  const DeleteProposalAssets = IDL.Record({
39
118
  proposal_ids: IDL.Vec(IDL.Nat)
40
119
  });
120
+ const OpenIdProviderDelegationConfig = IDL.Record({
121
+ targets: IDL.Opt(IDL.Vec(IDL.Principal)),
122
+ max_time_to_live: IDL.Opt(IDL.Nat64)
123
+ });
124
+ const OpenIdProviderConfig = IDL.Record({
125
+ delegation: IDL.Opt(OpenIdProviderDelegationConfig),
126
+ client_id: IDL.Text
127
+ });
128
+ const AuthenticationConfigOpenId = IDL.Record({
129
+ observatory_id: IDL.Opt(IDL.Principal),
130
+ providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))
131
+ });
132
+ const AuthenticationConfigInternetIdentity = IDL.Record({
133
+ derivation_origin: IDL.Opt(IDL.Text),
134
+ external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
135
+ });
136
+ const AuthenticationRules = IDL.Record({
137
+ allowed_callers: IDL.Vec(IDL.Principal)
138
+ });
139
+ const AuthenticationConfig = IDL.Record({
140
+ updated_at: IDL.Opt(IDL.Nat64),
141
+ openid: IDL.Opt(AuthenticationConfigOpenId),
142
+ created_at: IDL.Opt(IDL.Nat64),
143
+ version: IDL.Opt(IDL.Nat64),
144
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
145
+ rules: IDL.Opt(AuthenticationRules)
146
+ });
41
147
  const StorageConfigIFrame = IDL.Variant({
42
148
  Deny: IDL.Null,
43
149
  AllowAny: IDL.Null,
@@ -66,8 +172,39 @@ export const idlFactory = ({IDL}) => {
66
172
  raw_access: IDL.Opt(StorageConfigRawAccess),
67
173
  redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
68
174
  });
69
- const Config = IDL.Record({storage: StorageConfig});
175
+ const Config = IDL.Record({
176
+ authentication: IDL.Opt(AuthenticationConfig),
177
+ storage: StorageConfig
178
+ });
70
179
  const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});
180
+ const OpenIdGetDelegationArgs = IDL.Record({
181
+ jwt: IDL.Text,
182
+ session_key: IDL.Vec(IDL.Nat8),
183
+ salt: IDL.Vec(IDL.Nat8),
184
+ expiration: IDL.Nat64
185
+ });
186
+ const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});
187
+ const Delegation = IDL.Record({
188
+ pubkey: IDL.Vec(IDL.Nat8),
189
+ targets: IDL.Opt(IDL.Vec(IDL.Principal)),
190
+ expiration: IDL.Nat64
191
+ });
192
+ const SignedDelegation = IDL.Record({
193
+ signature: IDL.Vec(IDL.Nat8),
194
+ delegation: Delegation
195
+ });
196
+ const GetDelegationError = IDL.Variant({
197
+ JwtFindProvider: JwtFindProviderError,
198
+ GetCachedJwks: IDL.Null,
199
+ NoSuchDelegation: IDL.Null,
200
+ JwtVerify: JwtVerifyError,
201
+ GetOrFetchJwks: GetOrRefreshJwksError,
202
+ DeriveSeedFailed: IDL.Text
203
+ });
204
+ const Result_1 = IDL.Variant({
205
+ Ok: SignedDelegation,
206
+ Err: GetDelegationError
207
+ });
71
208
  const ProposalStatus = IDL.Variant({
72
209
  Initialized: IDL.Null,
73
210
  Failed: IDL.Null,
@@ -98,13 +235,6 @@ export const idlFactory = ({IDL}) => {
98
235
  version: IDL.Opt(IDL.Nat64),
99
236
  proposal_type: ProposalType
100
237
  });
101
- const MissionControl = IDL.Record({
102
- updated_at: IDL.Nat64,
103
- credits: Tokens,
104
- mission_control_id: IDL.Opt(IDL.Principal),
105
- owner: IDL.Principal,
106
- created_at: IDL.Nat64
107
- });
108
238
  const HttpRequest = IDL.Record({
109
239
  url: IDL.Text,
110
240
  method: IDL.Text,
@@ -249,6 +379,12 @@ export const idlFactory = ({IDL}) => {
249
379
  items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),
250
380
  items_length: IDL.Nat64
251
381
  });
382
+ const SetAuthenticationConfig = IDL.Record({
383
+ openid: IDL.Opt(AuthenticationConfigOpenId),
384
+ version: IDL.Opt(IDL.Nat64),
385
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
386
+ rules: IDL.Opt(AuthenticationRules)
387
+ });
252
388
  const SetController = IDL.Record({
253
389
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
254
390
  scope: ControllerScope,
@@ -286,6 +422,7 @@ export const idlFactory = ({IDL}) => {
286
422
  add_credits: IDL.Func([IDL.Principal, Tokens], [], []),
287
423
  add_invitation_code: IDL.Func([IDL.Text], [], []),
288
424
  assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
425
+ authenticate: IDL.Func([AuthenticationArgs], [Result], []),
289
426
  commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
290
427
  commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),
291
428
  commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),
@@ -295,10 +432,12 @@ export const idlFactory = ({IDL}) => {
295
432
  del_controllers: IDL.Func([DeleteControllersArgs], [], []),
296
433
  del_custom_domain: IDL.Func([IDL.Text], [], []),
297
434
  delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),
435
+ get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),
298
436
  get_config: IDL.Func([], [Config], ['query']),
299
437
  get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
300
438
  get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
301
439
  get_credits: IDL.Func([], [Tokens], ['query']),
440
+ get_delegation: IDL.Func([GetDelegationArgs], [Result_1], ['query']),
302
441
  get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),
303
442
  get_storage_config: IDL.Func([], [StorageConfig], ['query']),
304
443
  get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
@@ -327,6 +466,7 @@ export const idlFactory = ({IDL}) => {
327
466
  ['query']
328
467
  ),
329
468
  reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
469
+ set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),
330
470
  set_controllers: IDL.Func([SetControllersArgs], [], []),
331
471
  set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
332
472
  set_fee: IDL.Func([SegmentKind, Tokens], [], []),