@equinor/fusion-framework-module-msal 4.0.8 → 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 +40 -0
- package/README.md +203 -48
- package/dist/esm/__tests__/versioning/resolve-version.test.js +207 -0
- package/dist/esm/__tests__/versioning/resolve-version.test.js.map +1 -0
- package/dist/esm/static.js +1 -1
- package/dist/esm/v2/provider.js +1 -1
- package/dist/esm/v2/provider.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/versioning/VersionError.js +78 -0
- package/dist/esm/versioning/VersionError.js.map +1 -0
- package/dist/esm/versioning/create-version-message.js +54 -0
- package/dist/esm/versioning/create-version-message.js.map +1 -0
- package/dist/esm/versioning/index.js +25 -0
- package/dist/esm/versioning/index.js.map +1 -0
- package/dist/esm/versioning/resolve-version.js +90 -0
- package/dist/esm/versioning/resolve-version.js.map +1 -0
- package/dist/esm/versioning/static.js +10 -0
- package/dist/esm/versioning/static.js.map +1 -0
- package/dist/esm/versioning/types.js +2 -0
- package/dist/esm/versioning/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/__tests__/versioning/resolve-version.test.d.ts +1 -0
- package/dist/types/static.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/versioning/VersionError.d.ts +73 -0
- package/dist/types/versioning/create-version-message.d.ts +34 -0
- package/dist/types/versioning/index.d.ts +23 -0
- package/dist/types/versioning/resolve-version.d.ts +43 -0
- package/dist/types/versioning/static.d.ts +8 -0
- package/dist/types/versioning/types.d.ts +54 -0
- package/package.json +5 -4
- package/src/__tests__/versioning/resolve-version.test.ts +255 -0
- package/src/v2/provider.ts +1 -1
- package/src/version.ts +1 -1
- package/src/versioning/VersionError.ts +103 -0
- package/src/versioning/create-version-message.ts +63 -0
- package/src/versioning/index.ts +29 -0
- package/src/versioning/resolve-version.ts +125 -0
- package/src/versioning/static.ts +8 -0
- package/src/versioning/types.ts +60 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +11 -0
- package/dist/esm/resolve-version.js +0 -27
- package/dist/esm/resolve-version.js.map +0 -1
- package/dist/types/resolve-version.d.ts +0 -10
- package/src/resolve-version.ts +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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.
|
|
8
|
+
|
|
9
|
+
Fixes: #3375
|
|
10
|
+
|
|
11
|
+
- Refactored version checking logic into dedicated versioning module
|
|
12
|
+
- Made version checking more permissive for minor and patch versions
|
|
13
|
+
- Only major version incompatibilities will block execution
|
|
14
|
+
- Minor version differences now show warnings but allow execution to continue
|
|
15
|
+
- Patch version differences are completely ignored
|
|
16
|
+
- Added comprehensive test coverage for version resolution
|
|
17
|
+
- Improved error messages and warnings for better developer experience
|
|
18
|
+
- Maintains backward compatibility with existing configurations
|
|
19
|
+
|
|
20
|
+
## 4.0.9
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#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.
|
|
25
|
+
|
|
26
|
+
- **Complete documentation rewrite** with better structure and organization
|
|
27
|
+
- **Added comprehensive API reference** with detailed interface documentation
|
|
28
|
+
- **Enhanced configuration guide** with clear required/optional settings tables
|
|
29
|
+
- **Added migration guide** for v4 breaking changes and module hoisting
|
|
30
|
+
- **Improved troubleshooting section** with common issues and solutions
|
|
31
|
+
- **Added quick start examples** with practical usage patterns
|
|
32
|
+
- **Enhanced module hoisting documentation** explaining shared authentication state
|
|
33
|
+
- **Added package description** for better npm package visibility
|
|
34
|
+
|
|
35
|
+
**Key Improvements:**
|
|
36
|
+
|
|
37
|
+
- Clear separation between required and optional configuration
|
|
38
|
+
- Comprehensive API reference with TypeScript interfaces
|
|
39
|
+
- Migration guidance for v4 breaking changes
|
|
40
|
+
- Better developer onboarding with quick start examples
|
|
41
|
+
- Enhanced troubleshooting with platform-specific solutions
|
|
42
|
+
|
|
3
43
|
## 4.0.8
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,74 +1,229 @@
|
|
|
1
|
-
## MSAL mod
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
`@equinor/fusion-framework-module-msal` provides secure Azure AD authentication for browser applications using Microsoft's MSAL (Microsoft Authentication Library). Perfect for web applications, SPAs, and React apps that need to authenticate with Microsoft services.
|
|
4
3
|
|
|
5
|
-
##
|
|
4
|
+
## Features
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
- **Single Sign-On (SSO)** support for Microsoft Azure AD and Azure AD B2C
|
|
7
|
+
- **Token Management** with automatic refresh and secure caching
|
|
8
|
+
- **Module Hoisting** for shared authentication state across application scopes
|
|
9
|
+
- **Silent Authentication** for seamless user experience
|
|
10
|
+
- **Popup & Redirect Flows** for different authentication scenarios
|
|
11
|
+
- **Zero Configuration** with sensible defaults and optional customization
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
// enable the module
|
|
12
|
-
import { enableMsal } from '@equinor/fusion-framework-module-msal';
|
|
13
|
+
## Quick Start
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @equinor/fusion-framework-module-msal
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
```typescript
|
|
20
|
+
import { enableMSAL } from '@equinor/fusion-framework-module-msal';
|
|
21
|
+
import { ModulesConfigurator } from '@equinor/fusion-framework-module';
|
|
22
|
+
|
|
23
|
+
const configurator = new ModulesConfigurator();
|
|
24
|
+
|
|
25
|
+
enableMSAL(configurator, (builder) => {
|
|
26
|
+
builder.setClientConfig({
|
|
27
|
+
tenantId: 'your-tenant-id',
|
|
28
|
+
clientId: 'your-client-id',
|
|
29
|
+
redirectUri: 'https://your-app.com/callback'
|
|
30
|
+
});
|
|
31
|
+
builder.setRequiresAuth(true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const framework = await initialize();
|
|
35
|
+
const token = await framework.auth.acquireAccessToken({
|
|
36
|
+
scopes: ['https://graph.microsoft.com/.default']
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> [!IMPORTANT]
|
|
41
|
+
> The `@equinor/fusion-framework-app` enables this package by default, so applications using the app package do not need to enable this module manually.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
22
45
|
|
|
23
|
-
|
|
46
|
+
### Required Settings
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
| Setting | Description | Required |
|
|
49
|
+
|---------|-------------|----------|
|
|
50
|
+
| `clientId` | Azure AD application client ID | ✅ |
|
|
51
|
+
| `tenantId` | Azure AD tenant ID | ✅ |
|
|
52
|
+
| `redirectUri` | Authentication callback URL | Optional |
|
|
26
53
|
|
|
27
|
-
|
|
28
|
-
tenantId: 'your-tenant',
|
|
29
|
-
clientId: 'your-client'
|
|
30
|
-
callbackUrl: 'your-callback-url'
|
|
31
|
-
};
|
|
54
|
+
### Optional Settings
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
| Setting | Description | Default |
|
|
57
|
+
|---------|-------------|---------|
|
|
58
|
+
| `requiresAuth` | Auto-authenticate on initialization | `false` |
|
|
59
|
+
| `version` | Force specific MSAL version | `Latest` |
|
|
35
60
|
|
|
36
|
-
|
|
37
|
-
import { configureMsal } from '@equinor/fusion-framework-module-msal';
|
|
38
|
-
myConfigurator.addConfig(configureMsal(msalConfigurator => {
|
|
39
|
-
configurator.setClientConfig(msalConfig);
|
|
40
|
-
}));
|
|
61
|
+
### Environment Variables
|
|
41
62
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
```bash
|
|
64
|
+
# Required
|
|
65
|
+
AZURE_CLIENT_ID=your-client-id
|
|
66
|
+
AZURE_TENANT_ID=your-tenant-id
|
|
67
|
+
|
|
68
|
+
# Optional
|
|
69
|
+
AZURE_REDIRECT_URI=https://your-app.com/callback
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## API Reference
|
|
73
|
+
|
|
74
|
+
### `enableMSAL(configurator, configure)`
|
|
75
|
+
|
|
76
|
+
Enables the MSAL module in your Fusion Framework application.
|
|
77
|
+
|
|
78
|
+
**Parameters:**
|
|
79
|
+
- `configurator`: `ModulesConfigurator` - The modules configurator instance
|
|
80
|
+
- `configure`: `(builder: IAuthConfigurator) => void` - Configuration function
|
|
81
|
+
|
|
82
|
+
### `IAuthProvider`
|
|
83
|
+
|
|
84
|
+
The authentication provider interface available at `framework.auth`:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
interface IAuthProvider {
|
|
88
|
+
// Current user account information
|
|
89
|
+
readonly defaultAccount: AccountInfo | undefined;
|
|
90
|
+
|
|
91
|
+
// Acquire an access token for the specified scopes
|
|
92
|
+
acquireAccessToken(options: { scopes: string[] }): Promise<string | undefined>;
|
|
93
|
+
|
|
94
|
+
// Acquire full authentication result
|
|
95
|
+
acquireToken(options: { scopes: string[] }): Promise<AuthenticationResult | void>;
|
|
96
|
+
|
|
97
|
+
// Login user
|
|
98
|
+
login(): Promise<void>;
|
|
99
|
+
|
|
100
|
+
// Logout user
|
|
101
|
+
logout(options?: { redirectUri?: string }): Promise<void>;
|
|
102
|
+
|
|
103
|
+
// Handle authentication redirect
|
|
104
|
+
handleRedirect(): Promise<void | null>;
|
|
47
105
|
}
|
|
48
106
|
```
|
|
49
107
|
|
|
50
|
-
### Interoperability with MSAL versions
|
|
51
108
|
|
|
52
|
-
|
|
109
|
+
## Module Hoisting
|
|
53
110
|
|
|
54
|
-
|
|
55
|
-
> this should not be necessary in most cases and only done by understanding the inner workings of the module, but can be done in a transition phase._
|
|
111
|
+
The module implements a hoisting pattern where the authentication provider is created once at the root level and shared across all sub-modules. This ensures consistent authentication state throughout your application while maintaining security and performance.
|
|
56
112
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
113
|
+
> [!IMPORTANT]
|
|
114
|
+
> **Configure the auth module only in the root Fusion Framework instance** - Sub-instances will automatically inherit the authentication configuration from the parent.
|
|
115
|
+
|
|
116
|
+
## Migration Guide
|
|
117
|
+
|
|
118
|
+
### Version 4 Breaking Changes
|
|
119
|
+
|
|
120
|
+
**Module Hoisting**: The module now uses module hoisting, meaning sub-module instances proxy the parent module instance. This creates a shared authentication state across all module instances.
|
|
121
|
+
|
|
122
|
+
**Removed Multi-Client Support**: This version no longer supports multiple MSAL clients (multi-tenant, multi-authority) in the same scoped instance due to how `@azure/msal-browser` uses a shared cache.
|
|
123
|
+
|
|
124
|
+
**Benefits of V4**:
|
|
125
|
+
- Shared authentication state across application scopes
|
|
126
|
+
- Improved performance and memory usage
|
|
127
|
+
- Simplified configuration management
|
|
128
|
+
- Better integration with Fusion Framework architecture
|
|
129
|
+
|
|
130
|
+
#### Migration Steps
|
|
131
|
+
|
|
132
|
+
1. **Update Configuration**: Ensure only the root module configures MSAL
|
|
133
|
+
2. **Remove Duplicate Configurations**: Remove MSAL configuration from child modules
|
|
134
|
+
3. **Update Authentication Logic**: Rely on shared authentication state
|
|
135
|
+
4. **Test Multi-Scope Applications**: Verify authentication works across different application scopes
|
|
136
|
+
|
|
137
|
+
## Troubleshooting
|
|
138
|
+
|
|
139
|
+
### Common Issues
|
|
140
|
+
|
|
141
|
+
| Issue | Solution |
|
|
142
|
+
|-------|----------|
|
|
143
|
+
| **Authentication Loop** | Ensure redirect URIs match your application's routing |
|
|
144
|
+
| **Token Acquisition Fails** | Check that required scopes are properly configured |
|
|
145
|
+
| **Module Not Found** | Ensure the module is properly configured and framework is initialized |
|
|
146
|
+
| **Multiple MSAL Instances** | Remove duplicate configurations from child modules |
|
|
147
|
+
|
|
148
|
+
### Getting Help
|
|
149
|
+
|
|
150
|
+
- 📖 [MSAL Cookbook](https://github.com/equinor/fusion-framework/tree/main/cookbooks/app-react-msal) - Complete working examples
|
|
151
|
+
- 🐛 [Report Issues](https://github.com/equinor/fusion/issues) - Bug reports and feature requests
|
|
152
|
+
|
|
153
|
+
## Version Management
|
|
154
|
+
|
|
155
|
+
The MSAL module includes built-in version checking to ensure compatibility between different MSAL library versions.
|
|
156
|
+
|
|
157
|
+
### Version Resolution
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { resolveVersion, VersionError } from '@equinor/fusion-framework-module-msal/versioning';
|
|
161
|
+
|
|
162
|
+
// Resolve and validate a version
|
|
163
|
+
const result = resolveVersion('2.0.0');
|
|
164
|
+
console.log(result.isLatest); // false
|
|
165
|
+
console.log(result.satisfiesLatest); // true
|
|
166
|
+
console.log(result.enumVersion); // MsalModuleVersion.V2
|
|
63
167
|
```
|
|
64
168
|
|
|
65
|
-
|
|
169
|
+
### Version Checking Behavior
|
|
170
|
+
|
|
171
|
+
- **Major Version Incompatibility**: Throws `VersionError` if requested major version is greater than latest
|
|
172
|
+
- **Minor Version Mismatch**: Logs warning but allows execution
|
|
173
|
+
- **Patch Differences**: Ignored for compatibility
|
|
174
|
+
- **Invalid Versions**: Throws `VersionError` with descriptive message
|
|
175
|
+
|
|
176
|
+
### API Reference
|
|
177
|
+
|
|
178
|
+
#### `resolveVersion(version: string | SemVer): ResolvedVersion`
|
|
179
|
+
|
|
180
|
+
Resolves and validates a version string against the latest available MSAL version.
|
|
181
|
+
|
|
182
|
+
**Parameters:**
|
|
183
|
+
- `version` - Version string or SemVer object to resolve
|
|
184
|
+
|
|
185
|
+
**Returns:** `ResolvedVersion` object containing:
|
|
186
|
+
- `wantedVersion: SemVer` - The parsed requested version
|
|
187
|
+
- `latestVersion: SemVer` - The latest available version
|
|
188
|
+
- `isLatest: boolean` - Whether the version is exactly the latest
|
|
189
|
+
- `satisfiesLatest: boolean` - Whether the major version matches latest
|
|
190
|
+
- `enumVersion: MsalModuleVersion` - Corresponding enum version
|
|
191
|
+
|
|
192
|
+
**Throws:** `VersionError` for invalid or incompatible versions
|
|
193
|
+
|
|
194
|
+
#### `VersionError`
|
|
195
|
+
|
|
196
|
+
Error class for version-related issues with the following types:
|
|
197
|
+
- `InvalidVersion` - Requested version is not a valid semver
|
|
198
|
+
- `InvalidLatestVersion` - Latest version parsing failed (build issue)
|
|
199
|
+
- `MajorIncompatibility` - Major version is greater than latest
|
|
200
|
+
- `MinorMismatch` - Minor version differs (warning only)
|
|
201
|
+
- `PatchDifference` - Patch version differs (info only)
|
|
202
|
+
- `IncompatibleVersion` - General incompatibility
|
|
203
|
+
|
|
204
|
+
### Error Handling
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { resolveVersion, VersionError } from '@equinor/fusion-framework-module-msal/versioning';
|
|
208
|
+
|
|
209
|
+
try {
|
|
210
|
+
const result = resolveVersion('3.0.0'); // Assuming latest is 2.x
|
|
211
|
+
} catch (error) {
|
|
212
|
+
if (error instanceof VersionError) {
|
|
213
|
+
console.error('Version error:', error.message);
|
|
214
|
+
console.error('Requested:', error.requestedVersion);
|
|
215
|
+
console.error('Latest:', error.latestVersion);
|
|
216
|
+
console.error('Type:', error.type);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
```
|
|
66
220
|
|
|
67
|
-
|
|
221
|
+
## Additional Resources
|
|
68
222
|
|
|
69
|
-
|
|
223
|
+
- [Microsoft Graph API Documentation](https://docs.microsoft.com/en-us/graph/)
|
|
224
|
+
- [Azure AD App Registration Guide](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app)
|
|
225
|
+
- [MSAL Browser Documentation](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)
|
|
226
|
+
- [Fusion Framework Documentation](https://github.com/equinor/fusion-framework)
|
|
70
227
|
|
|
71
|
-
This is a __breaking change__ since this module used to support multiple MSAL clients _(multi tenant, multi authority)_ in the same scoped instance. This is no longer supported, due to the way `@azure/msal-browser` uses a shared cache.
|
|
72
228
|
|
|
73
|
-
This version still uses `@azure/msal-browser@^2`, but enables
|
|
74
229
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import { resolveVersion } from '../../versioning/resolve-version';
|
|
4
|
+
import { VersionError } from '../../versioning/VersionError';
|
|
5
|
+
// Mock the static module to avoid test failures when package version changes
|
|
6
|
+
// This ensures tests remain stable regardless of package.json version bumps
|
|
7
|
+
vi.mock('../../static', () => ({
|
|
8
|
+
MsalModuleVersion: {
|
|
9
|
+
V2: 'v2',
|
|
10
|
+
Latest: '4.0.9', // Fixed version for consistent testing
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
// Import the mocked version
|
|
14
|
+
import { MsalModuleVersion } from '../../static';
|
|
15
|
+
describe('resolveVersion', () => {
|
|
16
|
+
describe('mock verification', () => {
|
|
17
|
+
it('should use mocked version for consistent testing', () => {
|
|
18
|
+
// Verify that our mock is working and we're using the fixed version
|
|
19
|
+
expect(MsalModuleVersion.Latest).toBe('4.0.9');
|
|
20
|
+
expect(MsalModuleVersion.V2).toBe('v2');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('successful version resolution', () => {
|
|
24
|
+
it('should resolve a valid version string', () => {
|
|
25
|
+
const result = resolveVersion('2.1.0');
|
|
26
|
+
expect(result).toMatchObject({
|
|
27
|
+
wantedVersion: expect.any(SemVer),
|
|
28
|
+
latestVersion: expect.any(SemVer),
|
|
29
|
+
isLatest: false,
|
|
30
|
+
satisfiesLatest: false, // 2.x is not compatible with 4.x
|
|
31
|
+
enumVersion: MsalModuleVersion.V2,
|
|
32
|
+
});
|
|
33
|
+
expect(result.wantedVersion.version).toBe('2.1.0');
|
|
34
|
+
expect(result.latestVersion.version).toBe('4.0.9');
|
|
35
|
+
});
|
|
36
|
+
it('should resolve with SemVer object', () => {
|
|
37
|
+
const semver = new SemVer('2.0.0');
|
|
38
|
+
const result = resolveVersion(semver);
|
|
39
|
+
expect(result.wantedVersion).toBe(semver);
|
|
40
|
+
expect(result.satisfiesLatest).toBe(false); // 2.x is not compatible with 4.x
|
|
41
|
+
});
|
|
42
|
+
it('should resolve latest version when no version provided', () => {
|
|
43
|
+
const result = resolveVersion();
|
|
44
|
+
expect(result.wantedVersion.version).toBe('4.0.9');
|
|
45
|
+
expect(result.latestVersion.version).toBe('4.0.9');
|
|
46
|
+
expect(result.isLatest).toBe(true);
|
|
47
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
it('should resolve latest version when empty string provided', () => {
|
|
50
|
+
const result = resolveVersion('');
|
|
51
|
+
expect(result.wantedVersion.version).toBe('4.0.9');
|
|
52
|
+
expect(result.isLatest).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
it('should handle patch version differences without warnings', () => {
|
|
55
|
+
const result = resolveVersion('4.0.8');
|
|
56
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
57
|
+
expect(result.isLatest).toBe(false);
|
|
58
|
+
expect(result.warnings).toBeUndefined();
|
|
59
|
+
});
|
|
60
|
+
it('should handle minor version differences with warnings', () => {
|
|
61
|
+
const result = resolveVersion('4.1.0');
|
|
62
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
63
|
+
expect(result.isLatest).toBe(false);
|
|
64
|
+
expect(result.warnings).toBeDefined();
|
|
65
|
+
expect(result.warnings).toHaveLength(1);
|
|
66
|
+
expect(result.warnings?.[0]).toContain('Minor version mismatch');
|
|
67
|
+
});
|
|
68
|
+
it('should find correct enum version for major version', () => {
|
|
69
|
+
const result = resolveVersion('2.5.0');
|
|
70
|
+
expect(result.enumVersion).toBe(MsalModuleVersion.V2);
|
|
71
|
+
expect(result.satisfiesLatest).toBe(false); // 2.x is not compatible with 4.x
|
|
72
|
+
});
|
|
73
|
+
it('should throw error when no matching major version exists in enum', () => {
|
|
74
|
+
// Version 3.0.0 should throw because there's no enum for major version 3
|
|
75
|
+
expect(() => resolveVersion('3.0.0')).toThrow(VersionError);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('error handling', () => {
|
|
79
|
+
it('should throw VersionError for invalid version string', () => {
|
|
80
|
+
expect(() => resolveVersion('invalid-version')).toThrow(VersionError);
|
|
81
|
+
});
|
|
82
|
+
it('should not throw for malformed version (coerce handles it)', () => {
|
|
83
|
+
// semver.coerce('2.') returns '2.0.0', so it doesn't throw
|
|
84
|
+
expect(() => resolveVersion('2.')).not.toThrow();
|
|
85
|
+
});
|
|
86
|
+
it('should throw VersionError for non-semver string', () => {
|
|
87
|
+
expect(() => resolveVersion('not-a-version')).toThrow(VersionError);
|
|
88
|
+
});
|
|
89
|
+
it('should throw VersionError for major version incompatibility', () => {
|
|
90
|
+
expect(() => resolveVersion('5.0.0')).toThrow(VersionError);
|
|
91
|
+
});
|
|
92
|
+
it('should throw VersionError for very high major version', () => {
|
|
93
|
+
expect(() => resolveVersion('999.0.0')).toThrow(VersionError);
|
|
94
|
+
});
|
|
95
|
+
it('should include correct error type for major incompatibility', () => {
|
|
96
|
+
try {
|
|
97
|
+
resolveVersion('5.0.0');
|
|
98
|
+
expect.fail('Should have thrown VersionError');
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
expect(error).toBeInstanceOf(VersionError);
|
|
102
|
+
const versionError = error;
|
|
103
|
+
expect(versionError.type).toBe('major-incompatibility');
|
|
104
|
+
expect(versionError.requestedVersion).toBe('5.0.0');
|
|
105
|
+
expect(versionError.latestVersion).toBe('4.0.9');
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
it('should include correct error type for invalid version', () => {
|
|
109
|
+
try {
|
|
110
|
+
resolveVersion('invalid');
|
|
111
|
+
expect.fail('Should have thrown VersionError');
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
expect(error).toBeInstanceOf(VersionError);
|
|
115
|
+
expect(error.type).toBe('invalid-version');
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('version comparison logic', () => {
|
|
120
|
+
it('should correctly identify latest version', () => {
|
|
121
|
+
const result = resolveVersion('4.0.9');
|
|
122
|
+
expect(result.isLatest).toBe(true);
|
|
123
|
+
});
|
|
124
|
+
it('should correctly identify non-latest version', () => {
|
|
125
|
+
const result = resolveVersion('4.0.8');
|
|
126
|
+
expect(result.isLatest).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
it('should correctly identify satisfying version', () => {
|
|
129
|
+
const result = resolveVersion('4.1.0');
|
|
130
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
131
|
+
});
|
|
132
|
+
it('should correctly identify non-satisfying version', () => {
|
|
133
|
+
expect(() => resolveVersion('5.0.0')).toThrow();
|
|
134
|
+
});
|
|
135
|
+
it('should throw error for major versions without enum values', () => {
|
|
136
|
+
// Version 3.0.0 should throw because there's no enum for major version 3
|
|
137
|
+
expect(() => resolveVersion('3.0.0')).toThrow(VersionError);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
describe('warning behavior', () => {
|
|
141
|
+
it('should warn on minor version mismatch', () => {
|
|
142
|
+
const result = resolveVersion('4.1.0');
|
|
143
|
+
expect(result.warnings).toBeDefined();
|
|
144
|
+
expect(result.warnings).toHaveLength(1);
|
|
145
|
+
expect(result.warnings?.[0]).toContain('Minor version mismatch');
|
|
146
|
+
});
|
|
147
|
+
it('should not warn on patch version differences', () => {
|
|
148
|
+
const result = resolveVersion('4.0.8');
|
|
149
|
+
expect(result.warnings).toBeUndefined();
|
|
150
|
+
});
|
|
151
|
+
it('should not warn on exact version match', () => {
|
|
152
|
+
const result = resolveVersion('4.0.9');
|
|
153
|
+
expect(result.warnings).toBeUndefined();
|
|
154
|
+
});
|
|
155
|
+
it('should warn with correct version information', () => {
|
|
156
|
+
const result = resolveVersion('4.2.0');
|
|
157
|
+
expect(result.warnings).toBeDefined();
|
|
158
|
+
expect(result.warnings).toHaveLength(1);
|
|
159
|
+
expect(result.warnings?.[0]).toContain('4.2.0');
|
|
160
|
+
expect(result.warnings?.[0]).toContain('4.0.9');
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('edge cases', () => {
|
|
164
|
+
it('should handle version with pre-release identifiers (coerce strips them)', () => {
|
|
165
|
+
const result = resolveVersion('4.0.9-beta.1');
|
|
166
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
167
|
+
expect(result.wantedVersion.version).toBe('4.0.9'); // coerce strips pre-release
|
|
168
|
+
});
|
|
169
|
+
it('should handle version with build metadata (coerce strips them)', () => {
|
|
170
|
+
const result = resolveVersion('4.0.9+build.123');
|
|
171
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
172
|
+
expect(result.wantedVersion.version).toBe('4.0.9'); // coerce strips build metadata
|
|
173
|
+
});
|
|
174
|
+
it('should handle very long version strings (coerce strips them)', () => {
|
|
175
|
+
const longVersion = '4.0.9-beta.1.alpha.2+build.123.456';
|
|
176
|
+
const result = resolveVersion(longVersion);
|
|
177
|
+
expect(result.satisfiesLatest).toBe(true);
|
|
178
|
+
expect(result.wantedVersion.version).toBe('4.0.9'); // coerce strips pre-release and build
|
|
179
|
+
});
|
|
180
|
+
it('should throw error for zero versions without enum values', () => {
|
|
181
|
+
// Version 0.0.0 should throw because there's no enum for major version 0
|
|
182
|
+
expect(() => resolveVersion('0.0.0')).toThrow(VersionError);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
describe('return value structure', () => {
|
|
186
|
+
it('should return object with all required properties', () => {
|
|
187
|
+
const result = resolveVersion('2.1.0');
|
|
188
|
+
expect(result).toHaveProperty('wantedVersion');
|
|
189
|
+
expect(result).toHaveProperty('latestVersion');
|
|
190
|
+
expect(result).toHaveProperty('isLatest');
|
|
191
|
+
expect(result).toHaveProperty('satisfiesLatest');
|
|
192
|
+
expect(result).toHaveProperty('enumVersion');
|
|
193
|
+
expect(typeof result.isLatest).toBe('boolean');
|
|
194
|
+
expect(typeof result.satisfiesLatest).toBe('boolean');
|
|
195
|
+
expect(result.wantedVersion).toBeInstanceOf(SemVer);
|
|
196
|
+
expect(result.latestVersion).toBeInstanceOf(SemVer);
|
|
197
|
+
expect(typeof result.enumVersion).toBe('string');
|
|
198
|
+
});
|
|
199
|
+
it('should have consistent latest version across calls', () => {
|
|
200
|
+
const result1 = resolveVersion('2.0.0');
|
|
201
|
+
const result2 = resolveVersion('4.0.0');
|
|
202
|
+
expect(result1.latestVersion.version).toBe(result2.latestVersion.version);
|
|
203
|
+
expect(result1.latestVersion.version).toBe('4.0.9');
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
//# sourceMappingURL=resolve-version.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-version.test.js","sourceRoot":"","sources":["../../../../src/__tests__/versioning/resolve-version.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,6EAA6E;AAC7E,4EAA4E;AAC5E,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7B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MAAM,CAAC,CAAC;YACpD,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,CAAC,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC5D,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;YAExC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC1E,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/esm/static.js
CHANGED
|
@@ -3,6 +3,6 @@ export const ModuleName = 'msal';
|
|
|
3
3
|
export var MsalModuleVersion;
|
|
4
4
|
(function (MsalModuleVersion) {
|
|
5
5
|
MsalModuleVersion["V2"] = "v2";
|
|
6
|
-
MsalModuleVersion["Latest"] = "4.0
|
|
6
|
+
MsalModuleVersion["Latest"] = "4.1.0";
|
|
7
7
|
})(MsalModuleVersion || (MsalModuleVersion = {}));
|
|
8
8
|
//# sourceMappingURL=static.js.map
|
package/dist/esm/v2/provider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAuthClient, ConsoleLogger } from './client';
|
|
2
2
|
import { MsalModuleVersion } from '../static';
|
|
3
|
-
import resolveVersion from '../resolve-version';
|
|
3
|
+
import { resolveVersion } from '../versioning/resolve-version';
|
|
4
4
|
import { SemanticVersion } from '@equinor/fusion-framework-module';
|
|
5
5
|
export class AuthProvider {
|
|
6
6
|
_config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/v2/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,gBAAgB,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAK9C,OAAO,cAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/v2/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,gBAAgB,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAuCnE,MAAM,OAAO,YAAY;IAqBD;IApBtB,OAAO,CAAa;IAEpB,IAAI,OAAO;QACT,OAAO,IAAI,eAAe,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,kBAAkB;IAClB,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,kBAAkB;IAClB,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAsB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,kBAAkB;IAClB,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,kBAAkB;IAClB,YAAY;QACV,MAAM,MAAM,GAAG,gBAAgB,CAC7B,IAAI,CAAC,OAAO,CAAC,QAAQ,EACrB,IAAI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