@junobuild/config 2.5.0 → 2.6.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 +16 -91
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/cli/run.context.d.ts +2 -2
- package/dist/types/console/console.config.d.ts +41 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/satellite/configs/satellite.config.d.ts +15 -1
- package/dist/types/satellite/juno.config.d.ts +14 -0
- package/dist/types/{satellite/configs → shared}/authentication.config.d.ts +78 -0
- package/dist/types/utils/principal.utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Identity } from '@
|
|
2
|
-
import type { Principal } from '@
|
|
1
|
+
import type { Identity } from '@icp-sdk/core/agent';
|
|
2
|
+
import type { Principal } from '@icp-sdk/core/principal';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
/**
|
|
5
5
|
* @see OnRunContext
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PrincipalText } from '@dfinity/zod-schemas';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
+
import { type AuthenticationConfig } from '../shared/authentication.config';
|
|
3
4
|
import { type StorageConfig } from '../shared/storage.config';
|
|
4
5
|
import { type CliConfig } from '../types/cli.config';
|
|
5
6
|
import { type JunoConfigMode } from '../types/juno.env';
|
|
@@ -70,6 +71,23 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
70
71
|
}, z.core.$strict>>;
|
|
71
72
|
version: z.ZodOptional<z.ZodBigInt>;
|
|
72
73
|
}, z.core.$strip>>;
|
|
74
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
77
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
clientId: z.ZodString;
|
|
81
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
83
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
rules: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
allowedCallers: z.ZodArray<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
version: z.ZodOptional<z.ZodBigInt>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
73
91
|
source: z.ZodOptional<z.ZodString>;
|
|
74
92
|
ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
93
|
precompress: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -130,6 +148,23 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
130
148
|
}, z.core.$strict>>;
|
|
131
149
|
version: z.ZodOptional<z.ZodBigInt>;
|
|
132
150
|
}, z.core.$strip>>;
|
|
151
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
154
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
clientId: z.ZodString;
|
|
158
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
160
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
rules: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
allowedCallers: z.ZodArray<z.ZodString>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
version: z.ZodOptional<z.ZodBigInt>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
133
168
|
source: z.ZodOptional<z.ZodString>;
|
|
134
169
|
ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
170
|
precompress: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -175,4 +210,10 @@ export type JunoConsoleConfig = Either<ConsoleId, ConsoleIds> & CliConfig & {
|
|
|
175
210
|
* @optional
|
|
176
211
|
*/
|
|
177
212
|
storage?: StorageConfig;
|
|
213
|
+
/**
|
|
214
|
+
* Optional configuration parameters for the console, affecting the operational behavior of its Authentication.
|
|
215
|
+
* @type {AuthenticationConfig}
|
|
216
|
+
* @optional
|
|
217
|
+
*/
|
|
218
|
+
authentication?: AuthenticationConfig;
|
|
178
219
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export * from './pkg/juno.package';
|
|
|
7
7
|
export * from './pkg/juno.package.constants';
|
|
8
8
|
export * from './satellite/config';
|
|
9
9
|
export * from './satellite/configs/assertions.config';
|
|
10
|
-
export * from './satellite/configs/authentication.config';
|
|
11
10
|
export * from './satellite/configs/collections';
|
|
12
11
|
export * from './satellite/configs/datastore.config';
|
|
13
12
|
export * from './satellite/configs/emulator.config';
|
|
@@ -17,6 +16,7 @@ export * from './satellite/configs/rules';
|
|
|
17
16
|
export * from './satellite/configs/satellite.config';
|
|
18
17
|
export * from './satellite/constants/emulator.constants';
|
|
19
18
|
export * from './satellite/juno.config';
|
|
19
|
+
export * from './shared/authentication.config';
|
|
20
20
|
export * from './shared/feature.config';
|
|
21
21
|
export * from './shared/storage.config';
|
|
22
22
|
export * from './types/cli.config';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type PrincipalText } from '@dfinity/zod-schemas';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
+
import { type AuthenticationConfig } from '../../shared/authentication.config';
|
|
3
4
|
import { type StorageConfig } from '../../shared/storage.config';
|
|
4
5
|
import type { CliConfig } from '../../types/cli.config';
|
|
5
6
|
import { type JunoConfigMode } from '../../types/juno.env';
|
|
6
7
|
import type { Either } from '../../types/utility.types';
|
|
7
8
|
import { type SatelliteAssertions } from './assertions.config';
|
|
8
|
-
import { type AuthenticationConfig } from './authentication.config';
|
|
9
9
|
import { type Collections } from './collections';
|
|
10
10
|
import { type DatastoreConfig } from './datastore.config';
|
|
11
11
|
import { type ModuleSettings } from './module.settings';
|
|
@@ -93,6 +93,13 @@ export declare const SatelliteConfigOptionsSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
93
93
|
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
94
94
|
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
95
95
|
}, z.core.$strict>>;
|
|
96
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
clientId: z.ZodString;
|
|
98
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
100
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
96
103
|
rules: z.ZodOptional<z.ZodObject<{
|
|
97
104
|
allowedCallers: z.ZodArray<z.ZodString>;
|
|
98
105
|
}, z.core.$strict>>;
|
|
@@ -202,6 +209,13 @@ export declare const SatelliteConfigOptionsSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
202
209
|
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
203
210
|
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
204
211
|
}, z.core.$strict>>;
|
|
212
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
213
|
+
clientId: z.ZodString;
|
|
214
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
216
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
205
219
|
rules: z.ZodOptional<z.ZodObject<{
|
|
206
220
|
allowedCallers: z.ZodArray<z.ZodString>;
|
|
207
221
|
}, z.core.$strict>>;
|
|
@@ -45,6 +45,13 @@ export declare const JunoConfigSchema: z.ZodObject<{
|
|
|
45
45
|
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
46
46
|
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
47
47
|
}, z.core.$strict>>;
|
|
48
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
clientId: z.ZodString;
|
|
50
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
52
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
53
|
+
}, z.core.$strict>>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
48
55
|
rules: z.ZodOptional<z.ZodObject<{
|
|
49
56
|
allowedCallers: z.ZodArray<z.ZodString>;
|
|
50
57
|
}, z.core.$strict>>;
|
|
@@ -154,6 +161,13 @@ export declare const JunoConfigSchema: z.ZodObject<{
|
|
|
154
161
|
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
155
162
|
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
156
163
|
}, z.core.$strict>>;
|
|
164
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
clientId: z.ZodString;
|
|
166
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
168
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
169
|
+
}, z.core.$strict>>;
|
|
170
|
+
}, z.core.$strict>>;
|
|
157
171
|
rules: z.ZodOptional<z.ZodObject<{
|
|
158
172
|
allowedCallers: z.ZodArray<z.ZodString>;
|
|
159
173
|
}, z.core.$strict>>;
|
|
@@ -26,6 +26,71 @@ export interface AuthenticationConfigInternetIdentity {
|
|
|
26
26
|
*/
|
|
27
27
|
externalAlternativeOrigins?: string[];
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* @see AuthenticationConfigDelegation
|
|
31
|
+
*/
|
|
32
|
+
export declare const AuthenticationConfigDelegationSchema: z.ZodObject<{
|
|
33
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
34
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
/**
|
|
37
|
+
* Configure the delegation behavior for authentication.
|
|
38
|
+
*
|
|
39
|
+
* @interface AuthenticationConfigDelegation
|
|
40
|
+
*/
|
|
41
|
+
export interface AuthenticationConfigDelegation {
|
|
42
|
+
/**
|
|
43
|
+
* List of allowed targets (backend modules) that authenticated users
|
|
44
|
+
* may call using the issued session.
|
|
45
|
+
*
|
|
46
|
+
* - Omit this value to restrict access to this Satellite only (default).
|
|
47
|
+
* - Provide an array to explicitly allow only those targets.
|
|
48
|
+
* - Set to `null` to allow calling any backend.
|
|
49
|
+
*
|
|
50
|
+
* ⚠️ Setting to `null` removes all restrictions — use with caution.
|
|
51
|
+
*/
|
|
52
|
+
allowedTargets?: PrincipalText[] | null;
|
|
53
|
+
/**
|
|
54
|
+
* Duration for which a session remains valid, expressed in nanoseconds.
|
|
55
|
+
*
|
|
56
|
+
* Defaults to 1 day. Cannot exceed 30 days.
|
|
57
|
+
*
|
|
58
|
+
* Once issued, a session cannot be extended or shortened.
|
|
59
|
+
* New settings only apply to future logins.
|
|
60
|
+
*/
|
|
61
|
+
sessionDuration?: bigint;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @see AuthenticationConfigGoogle
|
|
65
|
+
*/
|
|
66
|
+
export declare const AuthenticationConfigGoogleSchema: z.ZodObject<{
|
|
67
|
+
clientId: z.ZodString;
|
|
68
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
70
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
/**
|
|
74
|
+
* Configure the sign-in with Google.
|
|
75
|
+
*
|
|
76
|
+
* @interface AuthenticationConfigGoogle
|
|
77
|
+
*/
|
|
78
|
+
export interface AuthenticationConfigGoogle {
|
|
79
|
+
/**
|
|
80
|
+
* The OAuth 2.0 client ID from your
|
|
81
|
+
* [Google Cloud Console](https://console.cloud.google.com/apis/credentials).
|
|
82
|
+
*
|
|
83
|
+
* Example: `"1234567890-abcdefg.apps.googleusercontent.com"`
|
|
84
|
+
*
|
|
85
|
+
* @type {string}
|
|
86
|
+
*/
|
|
87
|
+
clientId: string;
|
|
88
|
+
/**
|
|
89
|
+
* Optional delegation settings for authentication.
|
|
90
|
+
* If omitted, the default delegation behavior applies.
|
|
91
|
+
*/
|
|
92
|
+
delegation?: AuthenticationConfigDelegation;
|
|
93
|
+
}
|
|
29
94
|
/**
|
|
30
95
|
* @see AuthenticationConfigRules
|
|
31
96
|
*/
|
|
@@ -55,6 +120,13 @@ export declare const AuthenticationConfigSchema: z.ZodObject<{
|
|
|
55
120
|
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
56
121
|
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
57
122
|
}, z.core.$strict>>;
|
|
123
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
clientId: z.ZodString;
|
|
125
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
allowedTargets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
127
|
+
sessionDuration: z.ZodOptional<z.ZodBigInt>;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
58
130
|
rules: z.ZodOptional<z.ZodObject<{
|
|
59
131
|
allowedCallers: z.ZodArray<z.ZodString>;
|
|
60
132
|
}, z.core.$strict>>;
|
|
@@ -71,6 +143,12 @@ export interface AuthenticationConfig {
|
|
|
71
143
|
* @optional
|
|
72
144
|
*/
|
|
73
145
|
internetIdentity?: AuthenticationConfigInternetIdentity;
|
|
146
|
+
/**
|
|
147
|
+
* Optional configuration for enabling Google authentication method.
|
|
148
|
+
* @type {AuthenticationConfigGoogle}
|
|
149
|
+
* @optional
|
|
150
|
+
*/
|
|
151
|
+
google?: AuthenticationConfigGoogle;
|
|
74
152
|
/**
|
|
75
153
|
* Optional configuration for the rules of the authentication.
|
|
76
154
|
* @type {AuthenticationConfigRules}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Configuration options for Juno CLI",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://juno.build",
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@dfinity/zod-schemas": "^
|
|
44
|
+
"@dfinity/zod-schemas": "^3",
|
|
45
45
|
"zod": "^4"
|
|
46
46
|
}
|
|
47
47
|
}
|