@equinor/fusion-framework-cli 11.0.0-next.6 → 11.0.0-next.8

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.
@@ -1 +1 @@
1
- export declare const version = "11.0.0-next.6";
1
+ export declare const version = "11.0.0-next.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "11.0.0-next.6",
3
+ "version": "11.0.0-next.8",
4
4
  "homepage": "https://github.com/equinor/fusion-framework",
5
5
  "keywords": [
6
6
  "Fusion",
@@ -54,44 +54,46 @@
54
54
  "directory": "packages/cli"
55
55
  },
56
56
  "dependencies": {
57
- "@azure/msal-node": "^3.5.1",
58
- "@azure/msal-node-extensions": "^1.5.11",
59
- "@rollup/plugin-commonjs": "^28.0.3",
60
- "@rollup/plugin-json": "^6.1.0",
61
- "@rollup/plugin-node-resolve": "^16.0.1",
62
57
  "adm-zip": "^0.5.10",
63
- "ajv": "^8.17.1",
64
- "chalk": "^5.3.0",
65
58
  "commander": "^13.0.0",
66
- "is-ci": "^4.1.0",
67
- "lodash.mergewith": "^4.6.2",
68
- "open": "^10.1.1",
59
+ "keytar": "7.9.0",
69
60
  "ora": "^8.0.1",
70
- "pretty-bytes": "^7.0.0",
71
- "read-package-up": "^11.0.0",
72
- "rollup": "^4.39.0",
73
- "type-fest": "^4.40.0",
74
61
  "vite": "^6.3.5",
62
+ "chalk": "^5.3.0",
63
+ "read-package-up": "^11.0.0",
75
64
  "zod": "^3.25.20",
76
65
  "@equinor/fusion-framework-dev-portal": "^1.0.0-next.2",
77
- "@equinor/fusion-framework-dev-server": "^1.0.0-next.3",
66
+ "@equinor/fusion-framework-dev-server": "^1.0.0-next.4",
78
67
  "@equinor/fusion-imports": "^1.1.1-next.0"
79
68
  },
80
69
  "devDependencies": {
70
+ "ajv": "^8.17.1",
71
+ "pretty-bytes": "^7.0.0",
72
+ "is-ci": "^4.1.0",
73
+ "open": "^10.1.1",
74
+ "lodash.mergewith": "^4.6.2",
75
+ "type-fest": "^4.40.0",
76
+ "rollup": "^4.39.0",
77
+ "@rollup/plugin-commonjs": "^28.0.3",
78
+ "@rollup/plugin-json": "^6.1.0",
79
+ "@rollup/plugin-node-resolve": "^16.0.1",
81
80
  "@types/adm-zip": "^0.5.0",
82
81
  "@types/lodash.mergewith": "^4.6.9",
83
82
  "@types/node": "^20.11.14",
84
83
  "rxjs": "^7.8.1",
85
84
  "typescript": "^5.8.2",
86
- "@equinor/fusion-framework-module": "^4.4.3-next.0",
87
- "@equinor/fusion-framework-module-http": "^6.3.3-next.1",
88
85
  "@equinor/fusion-framework-module-app": "^6.1.13",
89
- "@equinor/fusion-framework-module-msal-node": "^0.1.1-next.1",
90
- "@equinor/fusion-framework-module-service-discovery": "^8.0.15-next.1"
86
+ "@equinor/fusion-framework-module-http": "^6.3.3-next.2",
87
+ "@equinor/fusion-framework-module": "^4.4.3-next.1",
88
+ "@equinor/fusion-framework-module-msal-node": "^0.1.1-next.2",
89
+ "@equinor/fusion-framework-module-service-discovery": "^8.0.15-next.2"
91
90
  },
92
91
  "peerDependenciesMeta": {
93
92
  "typescript": {
94
93
  "optional": true
94
+ },
95
+ "keytar": {
96
+ "optional": true
95
97
  }
96
98
  },
97
99
  "scripts": {
@@ -1,89 +0,0 @@
1
- import { PublicClientApplication } from '@azure/msal-node';
2
- import { PersistenceCachePlugin, PersistenceCreator, DataProtectionScope, Environment } from '@azure/msal-node-extensions';
3
- import { tmpdir } from 'node:os';
4
- import path from 'node:path';
5
-
6
- /**
7
- * Resolves the directory path for storing the authentication cache.
8
- *
9
- * Uses the user's root directory if available, otherwise falls back to the OS temp directory.
10
- *
11
- * @returns The resolved cache directory path as a string.
12
- */
13
- const resolveCachePath = () => {
14
- return Environment?.getUserRootDirectory() ?? tmpdir();
15
- };
16
- /**
17
- * Resolves the file path for the authentication cache based on tenant and client IDs.
18
- *
19
- * @param tenantId - The Azure AD tenant ID.
20
- * @param clientId - The Azure AD client/application ID.
21
- * @returns The full file path for the cache file.
22
- */
23
- const resolveCacheFilePath = (tenantId, clientId) => {
24
- return path.join(resolveCachePath(), `.token-cache-${tenantId}_${clientId}`);
25
- };
26
- /**
27
- * Creates a persistence cache for storing authentication data securely on disk.
28
- *
29
- * The cache is encrypted and scoped to the current user for security. It is uniquely identified
30
- * by the provided tenant and client IDs, and is associated with the 'fusion-framework' service.
31
- *
32
- * @param tenantId - The Azure AD tenant ID used to identify the cache.
33
- * @param clientId - The Azure AD client/application ID used to identify the cache.
34
- * @returns A promise that resolves to the created persistence cache instance.
35
- */
36
- const createPersistenceCache = async (tenantId, clientId) => {
37
- return PersistenceCreator.createPersistence({
38
- cachePath: resolveCacheFilePath(tenantId, clientId),
39
- serviceName: 'fusion-framework',
40
- accountName: [tenantId, clientId].join('_'),
41
- dataProtectionScope: DataProtectionScope.CurrentUser,
42
- });
43
- };
44
- /**
45
- * Creates a `PersistenceCachePlugin` instance for use with MSAL, using the provided tenant and client IDs.
46
- *
47
- * This plugin enables MSAL to use the secure persistence cache for token storage.
48
- *
49
- * @param tenantId - The Azure AD tenant ID.
50
- * @param clientId - The Azure AD client/application ID.
51
- * @returns A promise that resolves to an instance of `PersistenceCachePlugin`.
52
- */
53
- const createPersistenceCachePlugin = async (tenantId, clientId) => {
54
- return new PersistenceCachePlugin(await createPersistenceCache(tenantId, clientId));
55
- };
56
-
57
- /**
58
- * Creates and configures a new MSAL PublicClientApplication instance for Azure AD authentication.
59
- *
60
- * This function sets up the client with the specified tenant and client IDs, and attaches a secure
61
- * persistence cache plugin for storing authentication tokens on disk. The resulting client can be used
62
- * for both silent and interactive authentication flows, depending on how it is integrated.
63
- *
64
- * @param tenantId - The Azure Active Directory tenant ID (directory identifier).
65
- * @param clientId - The client/application ID registered in Azure AD.
66
- * @returns A Promise that resolves to a configured instance of `PublicClientApplication`.
67
- *
68
- * @remarks
69
- * The returned client uses a secure, user-scoped cache for token storage. This is recommended for CLI tools,
70
- * background services, and other Node.js applications that require persistent authentication.
71
- *
72
- * @example
73
- * ```typescript
74
- * const client = await createAuthClient('your-tenant-id', 'your-client-id');
75
- * // Use the client with MSAL APIs for authentication flows
76
- * ```
77
- */
78
- const createAuthClient = async (tenantId, clientId) => {
79
- const cachePlugin = await createPersistenceCachePlugin(tenantId, clientId);
80
- return new PublicClientApplication({
81
- auth: {
82
- clientId: clientId,
83
- authority: `https://login.microsoftonline.com/${tenantId}`,
84
- },
85
- cache: { cachePlugin },
86
- });
87
- };
88
-
89
- export { createAuthClient, createAuthClient as default };