@equinor/fusion-framework-vite-plugin-spa 4.0.17 → 4.1.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/CHANGELOG.md +37 -0
- package/README.md +123 -5
- package/dist/esm/html/bootstrap.js +23 -10
- package/dist/esm/html/bootstrap.js.map +1 -1
- package/dist/esm/html/is-enabled-env-value.js +10 -0
- package/dist/esm/html/is-enabled-env-value.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/html/bootstrap.js +5575 -45208
- package/dist/html/bootstrap.js.map +1 -1
- package/dist/index-B_3FYBBq.js +879 -0
- package/dist/index-B_3FYBBq.js.map +1 -0
- package/dist/module-w44_1T9j.js +39800 -0
- package/dist/module-w44_1T9j.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/html/html.d.ts +1 -1
- package/dist/types/html/is-enabled-env-value.d.ts +7 -0
- package/dist/types/types.d.ts +12 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/html/bootstrap.ts +24 -10
- package/src/html/is-enabled-env-value.ts +9 -0
- package/src/types.ts +12 -0
- package/src/version.ts +1 -1
- package/tests/is-enabled-env-value.test.ts +13 -0
- package/vitest.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @equinor/fusion-framework-vite-plugin-spa
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f663b46: Add `FUSION_SPA_MSAL_MOCK` environment variable. When set to `true`, the generated bootstrap
|
|
8
|
+
script signs in through `@equinor/fusion-framework-module-msal/mock` instead of the real MSAL
|
|
9
|
+
client, so the dev server can run without Entra ID credentials, redirects, or network calls.
|
|
10
|
+
Intended for CI and Playwright runs against the dev server. The mock client is lazily
|
|
11
|
+
imported, so it is not loaded at runtime unless the flag is enabled.
|
|
12
|
+
|
|
13
|
+
Also add `FUSION_SPA_MSAL_MOCK_TOKEN`, an optional companion variable read only when
|
|
14
|
+
`FUSION_SPA_MSAL_MOCK` is set. Provide a JWT (e.g. from `createMockToken`, or one issued by a
|
|
15
|
+
team's backend mock) and its `name`, `preferred_username`, `oid`, `tid`, and `scp` claims name
|
|
16
|
+
the signed-in mock user. The token itself is also sent verbatim as the access/id token, so a
|
|
17
|
+
backend mock that validates the token sees exactly what was configured, not a regenerated one.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [f663b46]
|
|
22
|
+
- Updated dependencies [f663b46]
|
|
23
|
+
- Updated dependencies [f663b46]
|
|
24
|
+
- Updated dependencies [f663b46]
|
|
25
|
+
- Updated dependencies [f663b46]
|
|
26
|
+
- Updated dependencies [f663b46]
|
|
27
|
+
- Updated dependencies [f663b46]
|
|
28
|
+
- Updated dependencies [f663b46]
|
|
29
|
+
- Updated dependencies [f663b46]
|
|
30
|
+
- Updated dependencies [f663b46]
|
|
31
|
+
- Updated dependencies [f663b46]
|
|
32
|
+
- Updated dependencies [f663b46]
|
|
33
|
+
- Updated dependencies [f663b46]
|
|
34
|
+
- @equinor/fusion-framework-module-service-discovery@10.1.0
|
|
35
|
+
- @equinor/fusion-framework-module-msal@11.0.0
|
|
36
|
+
- @equinor/fusion-framework-module-http@8.1.0
|
|
37
|
+
- @equinor/fusion-framework-module-telemetry@7.1.0
|
|
38
|
+
- @equinor/fusion-framework-module@6.1.3
|
|
39
|
+
|
|
3
40
|
## 4.0.17
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -176,6 +176,8 @@ fusionSpaPlugin({
|
|
|
176
176
|
clientId: 'my-client-id',
|
|
177
177
|
redirectUri: 'https://my-app.com/auth-callback',
|
|
178
178
|
requiresAuth: 'true',
|
|
179
|
+
mock: 'true', // (Optional) Use mock authentication for CI/Playwright
|
|
180
|
+
mockToken: '<token>', // (Optional) JWT that identifies the mock user
|
|
179
181
|
},
|
|
180
182
|
|
|
181
183
|
// Service Worker configuration for API proxying and authentication
|
|
@@ -238,11 +240,8 @@ Configures Azure AD authentication via the Microsoft Authentication Library (MSA
|
|
|
238
240
|
- `clientId` — Application (client) ID registered in Azure AD
|
|
239
241
|
- `redirectUri` — URL to redirect to after authentication
|
|
240
242
|
- `requiresAuth` _(optional, string)_ — When `'true'`, automatically prompts for login on first load
|
|
241
|
-
|
|
242
|
-
- `
|
|
243
|
-
- `clientId` — Application (client) ID registered in Azure AD
|
|
244
|
-
- `redirectUri` — URL to redirect to after authentication
|
|
245
|
-
- `requiresAuth` _(optional, string)_ — When `'true'`, automatically prompts for login on first load
|
|
243
|
+
- `mock` _(optional, string)_ — When `'true'`, uses mock authentication instead of Entra ID
|
|
244
|
+
- `mockToken` _(optional, string)_ — JWT used as-is to identify and authenticate the mock user
|
|
246
245
|
|
|
247
246
|
### Service Worker
|
|
248
247
|
|
|
@@ -395,6 +394,10 @@ FUSION_SPA_MSAL_TENANT_ID=my-tenant-id
|
|
|
395
394
|
FUSION_SPA_MSAL_CLIENT_ID=my-client-id
|
|
396
395
|
FUSION_SPA_MSAL_REDIRECT_URI=https://my-app.com/auth-callback
|
|
397
396
|
FUSION_SPA_MSAL_REQUIRES_AUTH=true
|
|
397
|
+
# Set to skip Entra ID and sign in a mock user instead — for CI/Playwright runs
|
|
398
|
+
FUSION_SPA_MSAL_MOCK=true
|
|
399
|
+
# Optional: a mock JWT whose claims (name, preferred_username, oid, tid, scp) name the signed-in user
|
|
400
|
+
FUSION_SPA_MSAL_MOCK_TOKEN=eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0....
|
|
398
401
|
|
|
399
402
|
# Telemetry
|
|
400
403
|
FUSION_SPA_TELEMETRY_CONSOLE_LEVEL=2
|
|
@@ -409,6 +412,121 @@ FUSION_SPA_SERVICE_WORKER_RESOURCES=[{"url":"/app-proxy","rewrite":"/@fusion-api
|
|
|
409
412
|
> [!IMPORTANT]
|
|
410
413
|
> The `.env` file must be in the project root (or the directory specified by Vite's `envDir`). Values from `.env` files override matching values from `generateTemplateEnv`.
|
|
411
414
|
|
|
415
|
+
## Running Against a Mock Client (CI / Playwright)
|
|
416
|
+
|
|
417
|
+
Setting `FUSION_SPA_MSAL_MOCK=true` swaps the real MSAL client for
|
|
418
|
+
`@equinor/fusion-framework-module-msal/mock`, which signs in a default mock user with no
|
|
419
|
+
Entra ID redirects, popups, or network calls. This is the recommended way to run the dev
|
|
420
|
+
server headlessly in GitHub Actions or a Playwright suite.
|
|
421
|
+
|
|
422
|
+
```sh
|
|
423
|
+
FUSION_SPA_MSAL_MOCK=true
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
By default the mock signs in a generic `Test User`. To control who that user is, set
|
|
427
|
+
`FUSION_SPA_MSAL_MOCK_TOKEN` to a JWT — generate one with `createMockToken` from
|
|
428
|
+
`@equinor/fusion-framework-module-msal/mock`, or use one issued by your backend's own mock —
|
|
429
|
+
and its `name`, `preferred_username`, `oid`, `tid`, and `scp` claims name the signed-in user:
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
import { createMockToken } from '@equinor/fusion-framework-module-msal/mock';
|
|
433
|
+
|
|
434
|
+
const token = createMockToken({
|
|
435
|
+
name: 'Ada Lovelace',
|
|
436
|
+
preferred_username: 'ada.lovelace@equinor.com',
|
|
437
|
+
oid: 'ada-object-id',
|
|
438
|
+
scp: 'user_impersonation',
|
|
439
|
+
});
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
```sh
|
|
443
|
+
FUSION_SPA_MSAL_MOCK_TOKEN=<token>
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Generate a mock user and update `.env`
|
|
447
|
+
|
|
448
|
+
> [!WARNING]
|
|
449
|
+
> The script below writes `FUSION_SPA_MSAL_MOCK=true` to the project-root `.env`. This is
|
|
450
|
+
> persistent configuration: the application remains locked to mock authentication across restarts
|
|
451
|
+
> until the variable is removed or set to `false`. `ffc app dev --mock` and
|
|
452
|
+
> `ffc app serve --mock` already enable mock authentication for that command, so do not persist
|
|
453
|
+
> `FUSION_SPA_MSAL_MOCK=true` merely to use those CLI flags. Never deploy an environment file that
|
|
454
|
+
> enables mock authentication.
|
|
455
|
+
|
|
456
|
+
Run the following from the application root. The application needs
|
|
457
|
+
`@equinor/fusion-framework-module-msal` as a direct development dependency so the Node.js script
|
|
458
|
+
can import `createMockToken` when pnpm uses strict dependency resolution:
|
|
459
|
+
|
|
460
|
+
```sh
|
|
461
|
+
pnpm add --save-dev @equinor/fusion-framework-module-msal
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Create `scripts/set-mock-user.mjs`. The script creates the project-root `.env` when it does not
|
|
465
|
+
exist. When `.env` already exists, it preserves comments and unrelated variables while replacing
|
|
466
|
+
the existing mock-auth values or appending them when absent:
|
|
467
|
+
|
|
468
|
+
```js
|
|
469
|
+
#!/usr/bin/env node
|
|
470
|
+
|
|
471
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
472
|
+
import { createMockToken } from '@equinor/fusion-framework-module-msal/mock';
|
|
473
|
+
|
|
474
|
+
const envFile = new URL('../.env', import.meta.url);
|
|
475
|
+
const token = createMockToken({
|
|
476
|
+
name: 'Ada Lovelace',
|
|
477
|
+
preferred_username: 'ada.lovelace@equinor.com',
|
|
478
|
+
oid: 'ada-object-id',
|
|
479
|
+
scp: 'user_impersonation',
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
let contents = await readFile(envFile, 'utf8').catch((error) => {
|
|
483
|
+
if (error.code === 'ENOENT') return '';
|
|
484
|
+
throw error;
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
const updates = {
|
|
488
|
+
FUSION_SPA_MSAL_MOCK: 'true',
|
|
489
|
+
FUSION_SPA_MSAL_MOCK_TOKEN: token,
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
493
|
+
const line = `${key}=${value}`;
|
|
494
|
+
const existing = new RegExp(`^${key}=.*$`, 'm');
|
|
495
|
+
if (existing.test(contents)) {
|
|
496
|
+
contents = contents.replace(existing, line);
|
|
497
|
+
} else {
|
|
498
|
+
const separator = contents.length > 0 && !contents.endsWith('\n') ? '\n' : '';
|
|
499
|
+
contents = `${contents}${separator}${line}\n`;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
await writeFile(envFile, contents);
|
|
504
|
+
console.log('Updated .env with the mock user token.');
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Make the script executable and run it:
|
|
508
|
+
|
|
509
|
+
```sh
|
|
510
|
+
chmod +x scripts/set-mock-user.mjs
|
|
511
|
+
./scripts/set-mock-user.mjs
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
Restart the Vite or Fusion Framework development server after updating `.env`. To return to real
|
|
515
|
+
Entra ID authentication, remove both `FUSION_SPA_MSAL_MOCK` and `FUSION_SPA_MSAL_MOCK_TOKEN` from
|
|
516
|
+
`.env` (or set `FUSION_SPA_MSAL_MOCK=false`), then restart the server again. The generated JWT is
|
|
517
|
+
deterministic and unsigned; use it only with the in-process MSAL mock and mocked backend services,
|
|
518
|
+
never as a credential for a real service.
|
|
519
|
+
|
|
520
|
+
The token itself is also sent as-is as the access/id token — it is not regenerated — so a
|
|
521
|
+
backend mock that validates its own tokens (specific claims, audience, or signature) sees
|
|
522
|
+
exactly the token it issued.
|
|
523
|
+
|
|
524
|
+
Mocking authentication does not mock the rest of the API surface — service discovery and
|
|
525
|
+
any backend calls the portal makes still hit real URLs unless you also override them. Use
|
|
526
|
+
the dev server's `api.routes`/`api.processServices` options (see the
|
|
527
|
+
[`@equinor/fusion-framework-dev-server`](../../dev-server/README.md) docs) to intercept
|
|
528
|
+
those requests with fixture responses.
|
|
529
|
+
|
|
412
530
|
## Advanced Customization
|
|
413
531
|
|
|
414
532
|
### Providing a Custom Template
|
|
@@ -5,6 +5,7 @@ import { enableServiceDiscovery, } from '@equinor/fusion-framework-module-servic
|
|
|
5
5
|
import { enableTelemetry, TelemetryLevel, } from '@equinor/fusion-framework-module-telemetry';
|
|
6
6
|
import { ConsoleAdapter } from '@equinor/fusion-framework-module-telemetry/console-adapter';
|
|
7
7
|
import { createPortalEntryPoint } from './create-portal-entry-point.js';
|
|
8
|
+
import { isEnabledEnvValue } from './is-enabled-env-value.js';
|
|
8
9
|
import { registerServiceWorker } from './register-service-worker.js';
|
|
9
10
|
import { version } from '../version.js';
|
|
10
11
|
// Allow dynamic import without vite
|
|
@@ -23,17 +24,29 @@ configurator.addConfig(configureHttpClient('service_discovery', {
|
|
|
23
24
|
enableServiceDiscovery(configurator, async (builder) => {
|
|
24
25
|
builder.configureServiceDiscoveryClientByClientKey('service_discovery');
|
|
25
26
|
});
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
// Avoid interactive Entra ID authentication when the SPA runs in CI or Playwright.
|
|
28
|
+
if (isEnabledEnvValue(import.meta.env.FUSION_SPA_MSAL_MOCK)) {
|
|
29
|
+
const { enableMsalMock } = await import('@equinor/fusion-framework-module-msal/mock');
|
|
30
|
+
const mockToken = import.meta.env.FUSION_SPA_MSAL_MOCK_TOKEN;
|
|
31
|
+
enableMsalMock(configurator, (builder) => {
|
|
32
|
+
// Preserve the mock client's default identity when no backend-specific token is configured.
|
|
33
|
+
if (!mockToken)
|
|
34
|
+
return;
|
|
35
|
+
builder.setToken(mockToken);
|
|
34
36
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
enableMSAL(configurator, (builder) => {
|
|
40
|
+
builder.setClientConfig({
|
|
41
|
+
auth: {
|
|
42
|
+
clientId: import.meta.env.FUSION_SPA_MSAL_CLIENT_ID,
|
|
43
|
+
tenantId: import.meta.env.FUSION_SPA_MSAL_TENANT_ID,
|
|
44
|
+
redirectUri: import.meta.env.FUSION_SPA_MSAL_REDIRECT_URI,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
builder.setRequiresAuth(isEnabledEnvValue(import.meta.env.FUSION_SPA_MSAL_REQUIRES_AUTH));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
37
50
|
enableTelemetry(configurator, {
|
|
38
51
|
attachConfiguratorEvents: true,
|
|
39
52
|
configure: (builder) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/html/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAmB,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAmB,MAAM,uCAAuC,CAAC;AACpF,OAAO,EACL,sBAAsB,GAEvB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AAE5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAWxC,oCAAoC;AACpC,MAAM,iBAAiB,GAAG,CAAI,IAAY,EAAc,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAE3F,uCAAuC;AACvC,MAAM,YAAY,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAE/C,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,OAAO,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAChD,OAAO,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,UAAU,CAAC,MAAM,CAAC;IACjE,CAAC,CAAC,SAAS;IACX,CAAC,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E,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a Vite environment toggle that may arrive as a parsed boolean or raw string.
|
|
3
|
+
*
|
|
4
|
+
* @param value - Environment value supplied through plugin configuration or a custom Vite define.
|
|
5
|
+
* @returns `true` only for the boolean `true` or the string `'true'`.
|
|
6
|
+
*/
|
|
7
|
+
export function isEnabledEnvValue(value) {
|
|
8
|
+
return value === true || value === 'true';
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=is-enabled-env-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-enabled-env-value.js","sourceRoot":"","sources":["../../../src/html/is-enabled-env-value.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC;AAC5C,CAAC"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|