@equinor/fusion-framework-module-msal 7.0.0-next.0 → 7.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.
- package/CHANGELOG.md +44 -5
- package/dist/esm/MsalClient.js +12 -7
- package/dist/esm/MsalClient.js.map +1 -1
- package/dist/esm/create-proxy-provider.js +5 -2
- package/dist/esm/create-proxy-provider.js.map +1 -1
- package/dist/esm/static.js +8 -7
- package/dist/esm/static.js.map +1 -1
- package/dist/esm/v4/create-proxy-provider.js +73 -0
- package/dist/esm/v4/create-proxy-provider.js.map +1 -0
- package/dist/esm/v4/index.js +12 -0
- package/dist/esm/v4/index.js.map +1 -0
- package/dist/esm/v4/types.js +27 -0
- package/dist/esm/v4/types.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/versioning/resolve-version.js +17 -4
- package/dist/esm/versioning/resolve-version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/static.d.ts +9 -8
- package/dist/types/v4/create-proxy-provider.d.ts +20 -0
- package/dist/types/v4/index.d.ts +12 -0
- package/dist/types/v4/types.d.ts +587 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +13 -6
- package/src/MsalClient.ts +22 -3
- package/src/MsalProxyProvider.interface.ts +1 -0
- package/src/create-proxy-provider.ts +5 -2
- package/src/static.ts +8 -7
- package/src/v4/create-proxy-provider.ts +74 -0
- package/src/v4/index.ts +13 -0
- package/src/v4/types.ts +727 -0
- package/src/version.ts +1 -1
- package/src/versioning/resolve-version.ts +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.0.0
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#3944](https://github.com/equinor/fusion-framework/pull/3944) [`cb37cae`](https://github.com/equinor/fusion-framework/commit/cb37cae45e06778e8d1ea20faed31b582e49fcae) Thanks [@dependabot](https://github.com/apps/dependabot)! - Upgrade @azure/msal-browser from v2.39.0 to v5.0.2
|
|
8
|
+
|
|
9
|
+
**Changes:**
|
|
10
|
+
|
|
11
|
+
- Updated MSAL browser dependency to v5.0.2
|
|
12
|
+
- Added V5 to MsalModuleVersion enum for version detection
|
|
13
|
+
- Updated version mapping logic to handle MSAL v5.x (maps to V5)
|
|
14
|
+
- Created v4 compatibility layer with frozen type snapshots from MSAL v5
|
|
15
|
+
- Fixed internal logger calls to include required correlationId parameter
|
|
16
|
+
- Added v4 export to package.json for consumers needing v4-compatible types
|
|
17
|
+
|
|
18
|
+
**Breaking changes:**
|
|
19
|
+
None - all changes are internal. Consumer API remains unchanged and fully backward compatible.
|
|
20
|
+
|
|
21
|
+
**Migration:**
|
|
22
|
+
No action required. The module automatically detects and uses MSAL v5 when available, while maintaining compatibility with existing code through version proxies.
|
|
23
|
+
|
|
24
|
+
## 6.0.5
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
6
27
|
|
|
7
|
-
- [#
|
|
28
|
+
- [#3866](https://github.com/equinor/fusion-framework/pull/3866) [`f70d66f`](https://github.com/equinor/fusion-framework/commit/f70d66f1bc826e614140adb2c6ee052f98e3b3da) Thanks [@dependabot](https://github.com/apps/dependabot)! - Internal: Dedupe zod dependency to 4.3.5
|
|
29
|
+
|
|
30
|
+
Deduplicated zod dependency to version 4.3.5 across all packages using `pnpm dedupe`. This aligns all packages (AI plugins upgraded from v3.25.76, other packages consolidated from v4.1.8/v4.1.11) to use the same latest stable version, improving consistency and reducing bundle size. All builds, tests, and linting pass successfully.
|
|
8
31
|
|
|
9
|
-
- Updated dependencies [[`
|
|
10
|
-
- @equinor/fusion-framework-module-telemetry@
|
|
11
|
-
- @equinor/fusion-framework-module@5.0.6-next.0
|
|
32
|
+
- Updated dependencies [[`f70d66f`](https://github.com/equinor/fusion-framework/commit/f70d66f1bc826e614140adb2c6ee052f98e3b3da)]:
|
|
33
|
+
- @equinor/fusion-framework-module-telemetry@4.6.1
|
|
12
34
|
|
|
13
35
|
## 6.0.4
|
|
14
36
|
|
|
@@ -72,6 +94,7 @@
|
|
|
72
94
|
**🚀 Enhanced features available** - New v4 APIs provide better performance, security, and error handling.
|
|
73
95
|
|
|
74
96
|
## What You Get
|
|
97
|
+
|
|
75
98
|
- **Better Security**: Latest MSAL v4 security improvements and vulnerability fixes
|
|
76
99
|
- **Improved Performance**: Faster token acquisition and caching
|
|
77
100
|
- **Enhanced Error Handling**: More robust error recovery and retry mechanisms
|
|
@@ -116,6 +139,7 @@
|
|
|
116
139
|
- [#3714](https://github.com/equinor/fusion-framework/pull/3714) [`11fe961`](https://github.com/equinor/fusion-framework/commit/11fe961794e4960ccb987bc320268cc9b263f1f8) Thanks [@odinr](https://github.com/odinr)! - Add optional provider-level telemetry for MSAL flows and update interface methods.
|
|
117
140
|
|
|
118
141
|
**BREAKING CHANGES:**
|
|
142
|
+
|
|
119
143
|
- `acquireAccessToken(options: AcquireTokenOptions)` → `acquireAccessToken(options: AcquireTokenOptionsLegacy)`
|
|
120
144
|
- `acquireToken(options: AcquireTokenOptions)` → `acquireToken(options: AcquireTokenOptionsLegacy)`
|
|
121
145
|
- `logout(options?: LogoutOptions): Promise<void>` → `logout(options?: LogoutOptions): Promise<boolean>`
|
|
@@ -123,6 +147,7 @@
|
|
|
123
147
|
- Added `initialize(): Promise<void>` method
|
|
124
148
|
|
|
125
149
|
**New Features:**
|
|
150
|
+
|
|
126
151
|
- Optional provider-level telemetry for MSAL flows (login, token acquisition, redirect handling)
|
|
127
152
|
- Emits telemetry events and measurements via injected telemetry provider when available
|
|
128
153
|
- Includes basic metadata (framework module version, clientId, tenantId) and authentication context
|
|
@@ -175,6 +200,7 @@
|
|
|
175
200
|
### Minor Changes
|
|
176
201
|
|
|
177
202
|
- [#3573](https://github.com/equinor/fusion-framework/pull/3573) [`b42b116`](https://github.com/equinor/fusion-framework/commit/b42b11616487c534e8e01f2df126e2ad05ce6a8f) Thanks [@odinr](https://github.com/odinr)! - Refactored AuthProvider to use a cleaner `client` property instead of deprecated `defaultClient`.
|
|
203
|
+
|
|
178
204
|
- Added `client` property to IAuthProvider interface
|
|
179
205
|
- Replaced deprecated `defaultClient` getter with `client` getter
|
|
180
206
|
- Updated internal references to use private `#client` field
|
|
@@ -183,12 +209,14 @@
|
|
|
183
209
|
- [#3572](https://github.com/equinor/fusion-framework/pull/3572) [`2d90f8b`](https://github.com/equinor/fusion-framework/commit/2d90f8b3806aa3deec5ca60142d38118748b1d3e) Thanks [@odinr](https://github.com/odinr)! - Refactored MSAL versioning module to use warnings instead of errors for version incompatibilities.
|
|
184
210
|
|
|
185
211
|
**Changes:**
|
|
212
|
+
|
|
186
213
|
- Removed `create-version-message.ts` and `static.ts` utility files
|
|
187
214
|
- Modified `resolveVersion()` to collect warnings for version mismatches instead of throwing errors
|
|
188
215
|
- Simplified `VersionError` class by removing factory methods and type enum references
|
|
189
216
|
- Updated tests to reflect new warning-based behavior
|
|
190
217
|
|
|
191
218
|
**Breaking Changes:**
|
|
219
|
+
|
|
192
220
|
- Version resolution now returns warnings for incompatible versions instead of throwing errors
|
|
193
221
|
- This change is backward compatible as existing code will continue to work, but error handling behavior has changed
|
|
194
222
|
|
|
@@ -202,6 +230,7 @@
|
|
|
202
230
|
- [#3442](https://github.com/equinor/fusion-framework/pull/3442) [`3b614f8`](https://github.com/equinor/fusion-framework/commit/3b614f87138f5a52f8ccc50ca8c6598ef3db37d6) Thanks [@asbjornhaland](https://github.com/asbjornhaland)! - Update biome to latest version
|
|
203
231
|
|
|
204
232
|
- [#3428](https://github.com/equinor/fusion-framework/pull/3428) [`1700ca8`](https://github.com/equinor/fusion-framework/commit/1700ca8851fa108e55e9729fd24f595272766e63) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update zod from 4.1.9 to 4.1.11
|
|
233
|
+
|
|
205
234
|
- **v4.1.10**: Fixed shape caching issue (#5263) improving validation performance for complex schemas
|
|
206
235
|
- **v4.1.11**: Maintenance release with general improvements
|
|
207
236
|
|
|
@@ -219,6 +248,7 @@
|
|
|
219
248
|
Updated source code to migrate from zod v3 to v4. Updated zod dependency from v3.25.76 to v4.1.8 and modified authentication configuration schemas in the MSAL module to be compatible with zod v4's stricter type checking and updated API.
|
|
220
249
|
|
|
221
250
|
Key changes in source code:
|
|
251
|
+
|
|
222
252
|
- Updated `AuthClientConfigSchema` and `AuthConfigSchema` for zod v4 compatibility
|
|
223
253
|
- Enhanced version schema transformation to work with zod v4
|
|
224
254
|
- Improved validation of client configuration (clientId, tenantId, redirectUri)
|
|
@@ -227,6 +257,7 @@
|
|
|
227
257
|
Breaking changes: Schema validation behavior may differ due to zod v4's stricter type checking. Error message format has changed from zod v3 to v4 format. Function schema definitions now require explicit typing.
|
|
228
258
|
|
|
229
259
|
Links:
|
|
260
|
+
|
|
230
261
|
- [Zod v4 Migration Guide](https://github.com/colinhacks/zod/releases/tag/v4.0.0)
|
|
231
262
|
- [Zod v4.1.8 Release Notes](https://github.com/colinhacks/zod/releases/tag/v4.1.8)
|
|
232
263
|
|
|
@@ -237,6 +268,7 @@
|
|
|
237
268
|
- [#3376](https://github.com/equinor/fusion-framework/pull/3376) [`da373ad`](https://github.com/equinor/fusion-framework/commit/da373ade663898b2628e28529b6e3dea3b91ed43) Thanks [@odinr](https://github.com/odinr)! - Improved MSAL module version checking to be more permissive for minor and patch versions.
|
|
238
269
|
|
|
239
270
|
Fixes: #3375
|
|
271
|
+
|
|
240
272
|
- Refactored version checking logic into dedicated versioning module
|
|
241
273
|
- Made version checking more permissive for minor and patch versions
|
|
242
274
|
- Only major version incompatibilities will block execution
|
|
@@ -251,6 +283,7 @@
|
|
|
251
283
|
### Patch Changes
|
|
252
284
|
|
|
253
285
|
- [#3343](https://github.com/equinor/fusion-framework/pull/3343) [`68dc22f`](https://github.com/equinor/fusion-framework/commit/68dc22f582bb68fbc94f29ad053122f81c049405) Thanks [@odinr](https://github.com/odinr)! - Enhanced documentation with comprehensive guides and improved developer experience.
|
|
286
|
+
|
|
254
287
|
- **Complete documentation rewrite** with better structure and organization
|
|
255
288
|
- **Added comprehensive API reference** with detailed interface documentation
|
|
256
289
|
- **Enhanced configuration guide** with clear required/optional settings tables
|
|
@@ -261,6 +294,7 @@
|
|
|
261
294
|
- **Added package description** for better npm package visibility
|
|
262
295
|
|
|
263
296
|
**Key Improvements:**
|
|
297
|
+
|
|
264
298
|
- Clear separation between required and optional configuration
|
|
265
299
|
- Comprehensive API reference with TypeScript interfaces
|
|
266
300
|
- Migration guidance for v4 breaking changes
|
|
@@ -281,6 +315,7 @@
|
|
|
281
315
|
### Patch Changes
|
|
282
316
|
|
|
283
317
|
- [#3088](https://github.com/equinor/fusion-framework/pull/3088) [`7441b13`](https://github.com/equinor/fusion-framework/commit/7441b13aa50dd7362d1629086a27b6b4e571575d) Thanks [@eikeland](https://github.com/eikeland)! - chore: update package typesVersions
|
|
318
|
+
|
|
284
319
|
- Updated package.json typesVersions.
|
|
285
320
|
- Ensures backward compatibility with older node versions.
|
|
286
321
|
- Ensured consistency with workspace and repository configuration.
|
|
@@ -346,6 +381,7 @@
|
|
|
346
381
|
- [#2814](https://github.com/equinor/fusion-framework/pull/2814) [`ea4b522`](https://github.com/equinor/fusion-framework/commit/ea4b5221b30719289fc947b5dbb0acd3ea52ffaa) Thanks [@odinr](https://github.com/odinr)! - Rework of the MSAL module to support module hoisting. This means that sub modules instances will proxy the parent module instance. This means that the module instance will be shared between all instances of the module.
|
|
347
382
|
|
|
348
383
|
**Highlights:**
|
|
384
|
+
|
|
349
385
|
- Versioning module, config and provider.
|
|
350
386
|
- Interfaces for MSAL versions
|
|
351
387
|
- Proxy provider instances for sub modules.
|
|
@@ -353,6 +389,7 @@
|
|
|
353
389
|
- Configurator using `BaseConfigBuilder` (aligned with other modules)
|
|
354
390
|
|
|
355
391
|
**BREAKING CHANGES:**
|
|
392
|
+
|
|
356
393
|
- `configureMsal` has changed parameter signature to `configureMsal(msalConfigurator: MsalConfigurator): void`
|
|
357
394
|
- Added `enableMsal` with parameter signature to `enableMsal(configurator: IModulesConfigurator, configureMsal: (msalConfigurator: MsalConfigurator) => void): void`
|
|
358
395
|
|
|
@@ -411,6 +448,7 @@
|
|
|
411
448
|
- [#2320](https://github.com/equinor/fusion-framework/pull/2320) [`1dd85f3`](https://github.com/equinor/fusion-framework/commit/1dd85f3a408a73df556d1812a5f280945cc100ee) Thanks [@odinr](https://github.com/odinr)! - Removed the `removeComments` option from the `tsconfig.base.json` file.
|
|
412
449
|
|
|
413
450
|
Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
|
|
451
|
+
|
|
414
452
|
1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
|
|
415
453
|
2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
|
|
416
454
|
3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
|
|
@@ -536,6 +574,7 @@
|
|
|
536
574
|
### Patch Changes
|
|
537
575
|
|
|
538
576
|
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
|
|
577
|
+
|
|
539
578
|
- align all versions of typescript
|
|
540
579
|
- update types to build
|
|
541
580
|
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
|
package/dist/esm/MsalClient.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { PublicClientApplication, } from '@azure/msal-browser';
|
|
2
|
+
/**
|
|
3
|
+
* Fallback correlation ID for logger calls when request doesn't provide one.
|
|
4
|
+
* Empty string indicates a non-request-specific log (validation, configuration warnings).
|
|
5
|
+
*/
|
|
6
|
+
const FUSION_CORRELATION_ID = '';
|
|
2
7
|
/**
|
|
3
8
|
* MSAL v4 client implementation with extended properties and methods.
|
|
4
9
|
*
|
|
@@ -83,14 +88,14 @@ export class MsalClient extends PublicClientApplication {
|
|
|
83
88
|
// This provides better UX by avoiding unnecessary popups/redirects
|
|
84
89
|
if (options.silent) {
|
|
85
90
|
if (!options.request.account && !options.request.loginHint) {
|
|
86
|
-
this.getLogger().warning('No account or login hint provided, please provide an account or login hint in the request');
|
|
91
|
+
this.getLogger().warning('No account or login hint provided, please provide an account or login hint in the request', options.request.correlationId || FUSION_CORRELATION_ID);
|
|
87
92
|
}
|
|
88
93
|
try {
|
|
89
94
|
return await this.ssoSilent(options.request);
|
|
90
95
|
}
|
|
91
96
|
catch {
|
|
92
97
|
// Silent login failed - continue to interactive flow
|
|
93
|
-
this.getLogger().warning('Silent login failed, falling back to interactive');
|
|
98
|
+
this.getLogger().warning('Silent login failed, falling back to interactive', options.request.correlationId || FUSION_CORRELATION_ID);
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
// Perform interactive authentication based on specified behavior
|
|
@@ -140,7 +145,7 @@ export class MsalClient extends PublicClientApplication {
|
|
|
140
145
|
*/
|
|
141
146
|
async logout(options) {
|
|
142
147
|
if (!options?.account) {
|
|
143
|
-
this.getLogger().warning('No account available for logout, please provide an account in the options');
|
|
148
|
+
this.getLogger().warning('No account available for logout, please provide an account in the options', FUSION_CORRELATION_ID);
|
|
144
149
|
}
|
|
145
150
|
const logoutRequest = {
|
|
146
151
|
account: options?.account,
|
|
@@ -177,23 +182,23 @@ export class MsalClient extends PublicClientApplication {
|
|
|
177
182
|
throw new Error('No request provided, please provide a request in the options');
|
|
178
183
|
}
|
|
179
184
|
if (request.scopes.length === 0) {
|
|
180
|
-
this.getLogger().warning('No scopes provided, please provide scopes in the request option, see options.request for more information.');
|
|
185
|
+
this.getLogger().warning('No scopes provided, please provide scopes in the request option, see options.request for more information.', request.correlationId || FUSION_CORRELATION_ID);
|
|
181
186
|
}
|
|
182
187
|
// Attempt silent token acquisition first
|
|
183
188
|
// This fetches from cache or uses refresh token without user interaction
|
|
184
189
|
if (silent) {
|
|
185
190
|
if (request.account) {
|
|
186
191
|
try {
|
|
187
|
-
this.getLogger().verbose('Attempting to acquire token silently');
|
|
192
|
+
this.getLogger().verbose('Attempting to acquire token silently', request.correlationId || FUSION_CORRELATION_ID);
|
|
188
193
|
return await this.acquireTokenSilent(request);
|
|
189
194
|
}
|
|
190
195
|
catch {
|
|
191
196
|
// Silent acquisition failed - fall back to interactive
|
|
192
|
-
this.getLogger().warning('Silent token acquisition failed, falling back to interactive');
|
|
197
|
+
this.getLogger().warning('Silent token acquisition failed, falling back to interactive', request.correlationId || FUSION_CORRELATION_ID);
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
200
|
else {
|
|
196
|
-
this.getLogger().warning('Cannot acquire token silently, no account provided, falling back to interactive.');
|
|
201
|
+
this.getLogger().warning('Cannot acquire token silently, no account provided, falling back to interactive.', request.correlationId || FUSION_CORRELATION_ID);
|
|
197
202
|
}
|
|
198
203
|
}
|
|
199
204
|
// Perform interactive token acquisition
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsalClient.js","sourceRoot":"","sources":["../../src/MsalClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAMxB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"MsalClient.js","sourceRoot":"","sources":["../../src/MsalClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAMxB,MAAM,qBAAqB,CAAC;AAa7B;;;GAGG;AACH,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAoBjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAW,SAAQ,uBAAuB;IACrD,SAAS,CAAU;IACnB,SAAS,CAAU;IAEnB;;;;OAIG;IACH,YAAY,MAAwB;QAClC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,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AAC,SAAS,EAAE,CAAC,OAAO,CACtB,4GAA4G,EAC5G,OAAO,CAAC,aAAa,IAAI,qBAAqB,CAC/C,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,yEAAyE;QACzE,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,IAAI,CAAC;oBACH,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CACtB,sCAAsC,EACtC,OAAO,CAAC,aAAa,IAAI,qBAAqB,CAC/C,CAAC;oBACF,OAAO,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAwB,CAAC,CAAC;gBACjE,CAAC;gBAAC,MAAM,CAAC;oBACP,uDAAuD;oBACvD,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CACtB,8DAA8D,EAC9D,OAAO,CAAC,aAAa,IAAI,qBAAqB,CAC/C,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CACtB,kFAAkF,EAClF,OAAO,CAAC,aAAa,IAAI,qBAAqB,CAC/C,CAAC;YACJ,CAAC;QACH,CAAC;QAED,wCAAwC;QACxC,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,OAAO;gBACV,sEAAsE;gBACtE,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC/C,KAAK,UAAU;gBACb,4DAA4D;gBAC5D,+EAA+E;gBAC/E,kFAAkF;gBAClF,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;gBACzC,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CACb,8BAA8B,QAAQ,+EAA+E,CACtH,CAAC;QACN,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MsalModuleVersion } from './static';
|
|
2
2
|
import { resolveVersion } from './versioning/resolve-version';
|
|
3
3
|
import { createProxyProvider as createProxyProvider_v2 } from './v2/create-proxy-provider';
|
|
4
|
+
import { createProxyProvider as createProxyProvider_v4 } from './v4/create-proxy-provider';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a proxy provider for version compatibility.
|
|
6
7
|
*
|
|
@@ -26,8 +27,10 @@ export function createProxyProvider(provider, version) {
|
|
|
26
27
|
// Create v2-compatible proxy with legacy API adapters
|
|
27
28
|
return createProxyProvider_v2(provider);
|
|
28
29
|
case MsalModuleVersion.V4:
|
|
29
|
-
// Create
|
|
30
|
-
|
|
30
|
+
// Create v4-compatible proxy (passthrough with v4 version metadata)
|
|
31
|
+
return createProxyProvider_v4(provider);
|
|
32
|
+
case MsalModuleVersion.V5:
|
|
33
|
+
// Create transparent proxy for v5 - passes through to original provider
|
|
31
34
|
return new Proxy(provider, {
|
|
32
35
|
get: (target, prop) => {
|
|
33
36
|
switch (prop) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-proxy-provider.js","sourceRoot":"","sources":["../../src/create-proxy-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAE3F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAuB,EACvB,OAAe;IAEf,mEAAmE;IACnE,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEhD,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,iBAAiB,CAAC,EAAE;YACvB,sDAAsD;YACtD,OAAO,sBAAsB,CAAC,QAAQ,CAAM,CAAC;QAC/C,KAAK,iBAAiB,CAAC,EAAE;YACvB,
|
|
1
|
+
{"version":3,"file":"create-proxy-provider.js","sourceRoot":"","sources":["../../src/create-proxy-provider.ts"],"names":[],"mappings":"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CAAC,CAAC;wBAChD,CAAC;wBACD,KAAK,cAAc,CAAC,CAAC,CAAC;4BACpB,OAAO,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC1C,CAAC;wBACD,KAAK,OAAO,CAAC,CAAC,CAAC;4BACb,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBACnC,CAAC;wBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;4BACd,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBACpC,CAAC;wBACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;4BACtB,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC5C,CAAC;wBACD,KAAK,qBAAqB,CAAC,CAAC,CAAC;4BAC3B,OAAO,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBACjD,CAAC;wBACD,KAAK,YAAY,CAAC,CAAC,CAAC;4BAClB,OAAO,GAAG,EAAE;gCACV,8DAA8D;4BAChE,CAAC,CAAC;wBACJ,CAAC;wBACD,OAAO,CAAC,CAAC,CAAC;4BACR,8EAA8E;4BAC9E,IAAI,IAAI,KAAK,MAAM;gCAAE,OAAO,SAAS,CAAC;4BAEtC,uFAAuF;4BACvF,MAAM,SAAS,GAAU,IAAI,CAAC;4BAC9B,OAAQ,MAAwB,CAAC,SAAS,CAAC,CAAC;wBAC9C,CAAC;oBACH,CAAC;gBACH,CAAC;aACF,CAAM,CAAC;QACV;YACE,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,mBAAmB,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
package/dist/esm/static.js
CHANGED
|
@@ -8,20 +8,19 @@ export const ModuleName = 'msal';
|
|
|
8
8
|
* Enumeration of supported MSAL module versions.
|
|
9
9
|
*
|
|
10
10
|
* This enum defines the available MSAL versions and provides type-safe access to version identifiers.
|
|
11
|
-
* The `Latest` value is automatically set to the current module version at build time.
|
|
12
11
|
*
|
|
13
12
|
* @remarks
|
|
14
13
|
* - `V2`: MSAL v2 compatibility (legacy support)
|
|
15
|
-
* - `V4`: MSAL v4 (
|
|
16
|
-
* - `
|
|
14
|
+
* - `V4`: MSAL v4 compatibility (supports @azure/msal-browser 4.x)
|
|
15
|
+
* - `V5`: MSAL v5 compatibility (supports @azure/msal-browser 5.x)
|
|
17
16
|
*
|
|
18
17
|
* @example
|
|
19
18
|
* ```typescript
|
|
20
19
|
* import { MsalModuleVersion } from '@equinor/fusion-framework-module-msal';
|
|
21
20
|
*
|
|
22
21
|
* // Check version
|
|
23
|
-
* if (version === MsalModuleVersion.
|
|
24
|
-
* console.log('Using
|
|
22
|
+
* if (version === MsalModuleVersion.V5) {
|
|
23
|
+
* console.log('Using MSAL v5 compatible version');
|
|
25
24
|
* }
|
|
26
25
|
*
|
|
27
26
|
* // Create version-specific proxy
|
|
@@ -30,9 +29,11 @@ export const ModuleName = 'msal';
|
|
|
30
29
|
*/
|
|
31
30
|
export var MsalModuleVersion;
|
|
32
31
|
(function (MsalModuleVersion) {
|
|
33
|
-
/** MSAL v2 compatibility version */
|
|
32
|
+
/** MSAL v2 compatibility version (legacy support) */
|
|
34
33
|
MsalModuleVersion["V2"] = "v2";
|
|
35
|
-
/** MSAL v4 (
|
|
34
|
+
/** MSAL v4 compatibility version (supports @azure/msal-browser 4.x) */
|
|
36
35
|
MsalModuleVersion["V4"] = "v4";
|
|
36
|
+
/** MSAL v5 compatibility version (supports @azure/msal-browser 5.x) */
|
|
37
|
+
MsalModuleVersion["V5"] = "v5";
|
|
37
38
|
})(MsalModuleVersion || (MsalModuleVersion = {}));
|
|
38
39
|
//# sourceMappingURL=static.js.map
|
package/dist/esm/static.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAe,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAe,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,qDAAqD;IACrD,8BAAS,CAAA;IACT,uEAAuE;IACvE,8BAAS,CAAA;IACT,uEAAuE;IACvE,8BAAS,CAAA;AACX,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { MsalModuleVersion } from '../static';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a v4-compatible proxy provider.
|
|
4
|
+
*
|
|
5
|
+
* Since v4 and v5 are API compatible, this creates a simple passthrough proxy
|
|
6
|
+
* that only adjusts the msalVersion property to report V4 compatibility.
|
|
7
|
+
*
|
|
8
|
+
* @param provider - The base MSAL v5 provider instance to wrap
|
|
9
|
+
* @returns A proxy provider reporting v4 compatibility
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const baseProvider = new MsalProvider(config);
|
|
14
|
+
* const v4Proxy = createProxyProvider(baseProvider);
|
|
15
|
+
*
|
|
16
|
+
* // Use with v4-compatible API (same as v5)
|
|
17
|
+
* await v4Proxy.login({ request: { scopes: ['User.Read'] } });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export function createProxyProvider(provider) {
|
|
21
|
+
// Create passthrough proxy that only overrides msalVersion
|
|
22
|
+
return new Proxy(provider, {
|
|
23
|
+
get: (target, prop) => {
|
|
24
|
+
switch (prop) {
|
|
25
|
+
case 'msalVersion': {
|
|
26
|
+
// Report as V4 for compatibility tracking
|
|
27
|
+
return MsalModuleVersion.V4;
|
|
28
|
+
}
|
|
29
|
+
case 'version': {
|
|
30
|
+
return target.version;
|
|
31
|
+
}
|
|
32
|
+
case 'client': {
|
|
33
|
+
return target.client;
|
|
34
|
+
}
|
|
35
|
+
case 'account': {
|
|
36
|
+
return target.account;
|
|
37
|
+
}
|
|
38
|
+
case 'acquireAccessToken': {
|
|
39
|
+
return target.acquireAccessToken.bind(target);
|
|
40
|
+
}
|
|
41
|
+
case 'acquireToken': {
|
|
42
|
+
return target.acquireToken.bind(target);
|
|
43
|
+
}
|
|
44
|
+
case 'login': {
|
|
45
|
+
return target.login.bind(target);
|
|
46
|
+
}
|
|
47
|
+
case 'logout': {
|
|
48
|
+
return target.logout.bind(target);
|
|
49
|
+
}
|
|
50
|
+
case 'handleRedirect': {
|
|
51
|
+
return target.handleRedirect.bind(target);
|
|
52
|
+
}
|
|
53
|
+
case 'createProxyProvider': {
|
|
54
|
+
return target.createProxyProvider.bind(target);
|
|
55
|
+
}
|
|
56
|
+
case 'initialize': {
|
|
57
|
+
return () => {
|
|
58
|
+
// noop - initialize is handled by the provider, not the proxy
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
default: {
|
|
62
|
+
// Prevent 'then' from being called - this is not an async operation
|
|
63
|
+
if (prop === 'then')
|
|
64
|
+
return undefined;
|
|
65
|
+
// Exhaustive check: TypeScript-only guard to ensure all IMsalProvider keys are handled
|
|
66
|
+
const exhausted = prop;
|
|
67
|
+
return target[exhausted];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=create-proxy-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-proxy-provider.js","sourceRoot":"","sources":["../../../src/v4/create-proxy-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,mBAAmB,CAAC,QA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gBACD,KAAK,YAAY,CAAC,CAAC,CAAC;oBAClB,OAAO,GAAG,EAAE;wBACV,8DAA8D;oBAChE,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,CAAC,CAAC;oBACR,oEAAoE;oBACpE,IAAI,IAAI,KAAK,MAAM;wBAAE,OAAO,SAAS,CAAC;oBAEtC,uFAAuF;oBACvF,MAAM,SAAS,GAAU,IAAI,CAAC;oBAC9B,OAAQ,MAAwB,CAAC,SAAS,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAkB,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MSAL v4 compatibility layer for v5 implementation.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This module provides v4-compatible proxies when running on v5.
|
|
6
|
+
* Since v4 and v5 are API compatible, this is primarily a passthrough
|
|
7
|
+
* with version metadata adjustments.
|
|
8
|
+
*
|
|
9
|
+
* @module v4
|
|
10
|
+
*/
|
|
11
|
+
export { createProxyProvider } from './create-proxy-provider';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v4/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MSAL v4/v5 compatible type definitions.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This file contains explicit type snapshots from MSAL v5 (browser 5.0.2, common 15.14.1)
|
|
6
|
+
* to provide a stable v4 compatibility layer. These types are frozen snapshots to prevent
|
|
7
|
+
* breaking changes from future MSAL versions automatically propagating to v4 consumers.
|
|
8
|
+
*
|
|
9
|
+
* Since MSAL v4 and v5 are API compatible, these types directly match the v5 API surface.
|
|
10
|
+
*
|
|
11
|
+
* @module v4/types
|
|
12
|
+
*/
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Logger Types
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Log message level
|
|
18
|
+
*/
|
|
19
|
+
export var LogLevel;
|
|
20
|
+
(function (LogLevel) {
|
|
21
|
+
LogLevel[LogLevel["Error"] = 0] = "Error";
|
|
22
|
+
LogLevel[LogLevel["Warning"] = 1] = "Warning";
|
|
23
|
+
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
24
|
+
LogLevel[LogLevel["Verbose"] = 3] = "Verbose";
|
|
25
|
+
LogLevel[LogLevel["Trace"] = 4] = "Trace";
|
|
26
|
+
})(LogLevel || (LogLevel = {}));
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/v4/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAybH,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,6CAAW,CAAA;IACX,uCAAQ,CAAA;IACR,6CAAW,CAAA;IACX,yCAAS,CAAA;AACX,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB"}
|
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"}
|
|
@@ -8,21 +8,34 @@ import { version as latestVersionString } from '../version';
|
|
|
8
8
|
* @param version - The version string or SemVer object to map
|
|
9
9
|
* @returns The corresponding MsalModuleVersion enum value
|
|
10
10
|
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Version mapping logic:
|
|
13
|
+
* - Versions <4.0.0 (including 2.x) → MsalModuleVersion.V2
|
|
14
|
+
* - Versions 4.x → MsalModuleVersion.V4
|
|
15
|
+
* - Versions 5.x → MsalModuleVersion.V5
|
|
16
|
+
* - Versions >=6.0.0 → MsalModuleVersion.V5
|
|
17
|
+
*
|
|
11
18
|
* @example
|
|
12
19
|
* ```typescript
|
|
13
|
-
* mapVersionToEnumVersion('2.
|
|
14
|
-
* mapVersionToEnumVersion('
|
|
20
|
+
* mapVersionToEnumVersion('2.39.0') // returns MsalModuleVersion.V2
|
|
21
|
+
* mapVersionToEnumVersion('4.28.1') // returns MsalModuleVersion.V4
|
|
22
|
+
* mapVersionToEnumVersion('5.0.2') // returns MsalModuleVersion.V5
|
|
23
|
+
* mapVersionToEnumVersion('7.0.0') // returns MsalModuleVersion.V5
|
|
15
24
|
* ```
|
|
16
25
|
*/
|
|
17
26
|
function mapVersionToEnumVersion(version) {
|
|
27
|
+
console.log('Resolving version:', version);
|
|
18
28
|
const coercedVersion = semver.coerce(version);
|
|
19
29
|
if (!coercedVersion) {
|
|
20
30
|
throw new Error(`Invalid version: ${version}`);
|
|
21
31
|
}
|
|
22
|
-
if (semver.satisfies(coercedVersion, '<
|
|
32
|
+
if (semver.satisfies(coercedVersion, '<4.0.0')) {
|
|
23
33
|
return MsalModuleVersion.V2;
|
|
24
34
|
}
|
|
25
|
-
|
|
35
|
+
if (semver.satisfies(coercedVersion, '<7.0.0')) {
|
|
36
|
+
return MsalModuleVersion.V4;
|
|
37
|
+
}
|
|
38
|
+
return MsalModuleVersion.V5;
|
|
26
39
|
}
|
|
27
40
|
/**
|
|
28
41
|
* Resolves and validates a version string against the latest available MSAL version.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-version.js","sourceRoot":"","sources":["../../../src/versioning/resolve-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"resolve-version.js","sourceRoot":"","sources":["../../../src/versioning/resolve-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,uBAAuB,CAAC,OAAwB;IACvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/C,OAAO,iBAAiB,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/C,OAAO,iBAAiB,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,iBAAiB,CAAC,EAAE,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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