@junobuild/cli 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -710,7 +710,7 @@ Done. The ${ba(t)} ${(0,Vc.green)(r)} has been configured for your terminal. \u2
710
710
  ${(0,zi.yellow)("--source-path")} Optional path to the TypeScript or JavaScript entry file.`,TA=`${Qpn}
711
711
  ${efn}`,cie=`${(0,zi.yellow)("--container-url")} Override a custom container URL. If not provided, defaults to production or the local container in development mode.`,Gi=`${TA}
712
712
  ${cie}
713
- ${(0,zi.yellow)("--console-url")} Specify a custom URL to access the developer Console.`,i8=`The option ${(0,zi.yellow)("--keep-staged")} only applies when ${(0,zi.yellow)("--no-apply")} is NOT used (i.e. the change is applied immediately).`;var er=e=>Rr({args:e,options:["-d","--doc"]})?"doc":"cli";var ia=rt(ct(),1);var bA="0.11.0";var rfn=` __ __ __ __ _ ____
713
+ ${(0,zi.yellow)("--console-url")} Specify a custom URL to access the developer Console.`,i8=`The option ${(0,zi.yellow)("--keep-staged")} only applies when ${(0,zi.yellow)("--no-apply")} is NOT used (i.e. the change is applied immediately).`;var er=e=>Rr({args:e,options:["-d","--doc"]})?"doc":"cli";var ia=rt(ct(),1);var bA="0.11.1";var rfn=` __ __ __ __ _ ____
714
714
  __) || | || \\| |/ \\
715
715
  \\___/ \\___/ |_|\\__|\\____/`,Gt=`${rfn} CLI ${(0,ia.grey)(`v${bA}`)}`,XMe=`Juno CLI ${(0,ia.grey)(`v${bA}`)}`,xA=`
716
716
  ${Gt}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "The Juno command-line interface",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@ ic-cdk = "0.18.5"
12
12
  ic-cdk-macros = "0.18.5"
13
13
  serde = "1.0.225"
14
14
  serde_cbor = "0.11.2"
15
- junobuild-satellite = "0.2.6"
15
+ junobuild-satellite = "0.3.0"
16
16
  junobuild-macros = "0.1.1"
17
- junobuild-utils = "0.1.3"
17
+ junobuild-utils = "0.1.4"
18
18
 
@@ -20,8 +20,15 @@ type AssetNoContent = record {
20
20
  version : opt nat64;
21
21
  };
22
22
  type AssetsUpgradeOptions = record { clear_existing_assets : opt bool };
23
+ type AuthenticateResultResponse = variant {
24
+ Ok : Authentication;
25
+ Err : AuthenticationError;
26
+ };
27
+ type Authentication = record { doc : Doc; delegation : PreparedDelegation };
28
+ type AuthenticationArgs = variant { OpenId : OpenIdPrepareDelegationArgs };
23
29
  type AuthenticationConfig = record {
24
30
  updated_at : opt nat64;
31
+ openid : opt AuthenticationConfigOpenId;
25
32
  created_at : opt nat64;
26
33
  version : opt nat64;
27
34
  internet_identity : opt AuthenticationConfigInternetIdentity;
@@ -31,6 +38,14 @@ type AuthenticationConfigInternetIdentity = record {
31
38
  derivation_origin : opt text;
32
39
  external_alternative_origins : opt vec text;
33
40
  };
41
+ type AuthenticationConfigOpenId = record {
42
+ observatory_id : opt principal;
43
+ providers : vec record { OpenIdProvider; OpenIdProviderConfig };
44
+ };
45
+ type AuthenticationError = variant {
46
+ PrepareDelegation : PrepareDelegationError;
47
+ RegisterUser : text;
48
+ };
34
49
  type AuthenticationRules = record { allowed_callers : vec principal };
35
50
  type CollectionType = variant { Db; Storage };
36
51
  type CommitBatch = record {
@@ -67,6 +82,11 @@ type DbConfig = record {
67
82
  };
68
83
  type DelDoc = record { version : opt nat64 };
69
84
  type DelRule = record { version : opt nat64 };
85
+ type Delegation = record {
86
+ pubkey : blob;
87
+ targets : opt vec principal;
88
+ expiration : nat64;
89
+ };
70
90
  type DeleteControllersArgs = record { controllers : vec principal };
71
91
  type DeleteProposalAssets = record { proposal_ids : vec nat };
72
92
  type DepositCyclesArgs = record { cycles : nat; destination_id : principal };
@@ -78,6 +98,30 @@ type Doc = record {
78
98
  created_at : nat64;
79
99
  version : opt nat64;
80
100
  };
101
+ type GetDelegationArgs = variant { OpenId : OpenIdGetDelegationArgs };
102
+ type GetDelegationError = variant {
103
+ JwtFindProvider : JwtFindProviderError;
104
+ GetCachedJwks;
105
+ NoSuchDelegation;
106
+ JwtVerify : JwtVerifyError;
107
+ GetOrFetchJwks : GetOrRefreshJwksError;
108
+ DeriveSeedFailed : text;
109
+ };
110
+ type GetDelegationResultResponse = variant {
111
+ Ok : SignedDelegation;
112
+ Err : GetDelegationError;
113
+ };
114
+ type GetOrRefreshJwksError = variant {
115
+ InvalidConfig : text;
116
+ MissingKid;
117
+ BadClaim : text;
118
+ KeyNotFoundCooldown;
119
+ CertificateNotFound;
120
+ BadSig : text;
121
+ MissingLastAttempt : text;
122
+ KeyNotFound;
123
+ FetchFailed : text;
124
+ };
81
125
  type HttpRequest = record {
82
126
  url : text;
83
127
  method : text;
@@ -105,6 +149,18 @@ type InitSatelliteArgs = record {
105
149
  };
106
150
  type InitStorageArgs = record { system_memory : opt Memory };
107
151
  type InitUploadResult = record { batch_id : nat };
152
+ type JwtFindProviderError = variant {
153
+ BadClaim : text;
154
+ BadSig : text;
155
+ NoMatchingProvider;
156
+ };
157
+ type JwtVerifyError = variant {
158
+ WrongKeyType;
159
+ MissingKid;
160
+ BadClaim : text;
161
+ BadSig : text;
162
+ NoKeyForKid;
163
+ };
108
164
  type ListMatcher = record {
109
165
  key : opt text;
110
166
  updated_at : opt TimestampMatcher;
@@ -154,7 +210,35 @@ type ListRulesResults = record {
154
210
  };
155
211
  type Memory = variant { Heap; Stable };
156
212
  type MemorySize = record { stable : nat64; heap : nat64 };
213
+ type OpenIdGetDelegationArgs = record {
214
+ jwt : text;
215
+ session_key : blob;
216
+ salt : blob;
217
+ expiration : nat64;
218
+ };
219
+ type OpenIdPrepareDelegationArgs = record {
220
+ jwt : text;
221
+ session_key : blob;
222
+ salt : blob;
223
+ };
224
+ type OpenIdProvider = variant { Google };
225
+ type OpenIdProviderConfig = record {
226
+ delegation : opt OpenIdProviderDelegationConfig;
227
+ client_id : text;
228
+ };
229
+ type OpenIdProviderDelegationConfig = record {
230
+ targets : opt vec principal;
231
+ max_time_to_live : opt nat64;
232
+ };
157
233
  type Permission = variant { Controllers; Private; Public; Managed };
234
+ type PrepareDelegationError = variant {
235
+ JwtFindProvider : JwtFindProviderError;
236
+ GetCachedJwks;
237
+ JwtVerify : JwtVerifyError;
238
+ GetOrFetchJwks : GetOrRefreshJwksError;
239
+ DeriveSeedFailed : text;
240
+ };
241
+ type PreparedDelegation = record { user_key : blob; expiration : nat64 };
158
242
  type Proposal = record {
159
243
  status : ProposalStatus;
160
244
  updated_at : nat64;
@@ -198,6 +282,7 @@ type SegmentsDeploymentOptions = record {
198
282
  satellite_version : opt text;
199
283
  };
200
284
  type SetAuthenticationConfig = record {
285
+ openid : opt AuthenticationConfigOpenId;
201
286
  version : opt nat64;
202
287
  internet_identity : opt AuthenticationConfigInternetIdentity;
203
288
  rules : opt AuthenticationRules;
@@ -240,6 +325,7 @@ type SetStorageConfig = record {
240
325
  raw_access : opt StorageConfigRawAccess;
241
326
  redirects : opt vec record { text; StorageConfigRedirect };
242
327
  };
328
+ type SignedDelegation = record { signature : blob; delegation : Delegation };
243
329
  type StorageConfig = record {
244
330
  iframe : opt StorageConfigIFrame;
245
331
  updated_at : opt nat64;
@@ -286,6 +372,7 @@ type UploadChunk = record {
286
372
  };
287
373
  type UploadChunkResult = record { chunk_id : nat };
288
374
  service : (InitSatelliteArgs) -> {
375
+ authenticate : (AuthenticationArgs) -> (AuthenticateResultResponse);
289
376
  commit_asset_upload : (CommitBatch) -> ();
290
377
  commit_proposal : (CommitProposal) -> (null);
291
378
  commit_proposal_asset_upload : (CommitBatch) -> ();
@@ -314,6 +401,7 @@ service : (InitSatelliteArgs) -> {
314
401
  get_auth_config : () -> (opt AuthenticationConfig) query;
315
402
  get_config : () -> (Config);
316
403
  get_db_config : () -> (opt DbConfig) query;
404
+ get_delegation : (GetDelegationArgs) -> (GetDelegationResultResponse) query;
317
405
  get_doc : (text, text) -> (opt Doc) query;
318
406
  get_many_assets : (vec record { text; text }) -> (
319
407
  vec record { text; opt AssetNoContent },