@equinor/fusion-framework-module-msal 10.0.2 → 11.0.0-next.1

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +17 -368
  3. package/dist/esm/MsalConfigurator.js +176 -88
  4. package/dist/esm/MsalConfigurator.js.map +1 -1
  5. package/dist/esm/__tests__/MsalConfigurator.test.js +75 -0
  6. package/dist/esm/__tests__/MsalConfigurator.test.js.map +1 -1
  7. package/dist/esm/__tests__/create-proxy-provider.test.js +53 -0
  8. package/dist/esm/__tests__/create-proxy-provider.test.js.map +1 -0
  9. package/dist/esm/__tests__/mock/create-mock-user-from-token.test.js +39 -0
  10. package/dist/esm/__tests__/mock/create-mock-user-from-token.test.js.map +1 -0
  11. package/dist/esm/__tests__/mock/msal-mock.test.js +451 -0
  12. package/dist/esm/__tests__/mock/msal-mock.test.js.map +1 -0
  13. package/dist/esm/index.js +5 -0
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/mock/MsalMockClient.js +484 -0
  16. package/dist/esm/mock/MsalMockClient.js.map +1 -0
  17. package/dist/esm/mock/MsalMockConfigurator.js +239 -0
  18. package/dist/esm/mock/MsalMockConfigurator.js.map +1 -0
  19. package/dist/esm/mock/create-mock-token.js +60 -0
  20. package/dist/esm/mock/create-mock-token.js.map +1 -0
  21. package/dist/esm/mock/create-mock-user-from-token.js +40 -0
  22. package/dist/esm/mock/create-mock-user-from-token.js.map +1 -0
  23. package/dist/esm/mock/create-msal-mock-client.js +20 -0
  24. package/dist/esm/mock/create-msal-mock-client.js.map +1 -0
  25. package/dist/esm/mock/decode-jwt-segment.js +22 -0
  26. package/dist/esm/mock/decode-jwt-segment.js.map +1 -0
  27. package/dist/esm/mock/index.js +31 -0
  28. package/dist/esm/mock/index.js.map +1 -0
  29. package/dist/esm/mock/module.js +38 -0
  30. package/dist/esm/mock/module.js.map +1 -0
  31. package/dist/esm/msal-config-schema.js +37 -0
  32. package/dist/esm/msal-config-schema.js.map +1 -0
  33. package/dist/esm/telemetry-config-schema.js +16 -0
  34. package/dist/esm/telemetry-config-schema.js.map +1 -0
  35. package/dist/esm/version.js +1 -1
  36. package/dist/esm/version.js.map +1 -1
  37. package/dist/esm/versioning/resolve-version.js +0 -1
  38. package/dist/esm/versioning/resolve-version.js.map +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/dist/types/MsalConfigurator.d.ts +96 -20
  41. package/dist/types/__tests__/create-proxy-provider.test.d.ts +1 -0
  42. package/dist/types/__tests__/mock/create-mock-user-from-token.test.d.ts +1 -0
  43. package/dist/types/__tests__/mock/msal-mock.test.d.ts +1 -0
  44. package/dist/types/index.d.ts +5 -0
  45. package/dist/types/mock/MsalMockClient.d.ts +282 -0
  46. package/dist/types/mock/MsalMockConfigurator.d.ts +186 -0
  47. package/dist/types/mock/create-mock-token.d.ts +54 -0
  48. package/dist/types/mock/create-mock-user-from-token.d.ts +25 -0
  49. package/dist/types/mock/create-msal-mock-client.d.ts +14 -0
  50. package/dist/types/mock/decode-jwt-segment.d.ts +13 -0
  51. package/dist/types/mock/index.d.ts +30 -0
  52. package/dist/types/mock/module.d.ts +35 -0
  53. package/dist/types/msal-config-schema.d.ts +64 -0
  54. package/dist/types/telemetry-config-schema.d.ts +8 -0
  55. package/dist/types/version.d.ts +1 -1
  56. package/docs/api-reference.md +85 -0
  57. package/docs/auth-code-flow.md +86 -0
  58. package/docs/migration-v2-to-v4.md +115 -0
  59. package/docs/testing.md +191 -0
  60. package/docs/troubleshooting.md +17 -0
  61. package/docs/version-management.md +67 -0
  62. package/package.json +12 -5
  63. package/src/MsalConfigurator.ts +202 -115
  64. package/src/__tests__/MsalConfigurator.test.ts +106 -0
  65. package/src/__tests__/create-proxy-provider.test.ts +77 -0
  66. package/src/__tests__/mock/create-mock-user-from-token.test.ts +46 -0
  67. package/src/__tests__/mock/msal-mock.test.ts +613 -0
  68. package/src/index.ts +6 -0
  69. package/src/mock/MsalMockClient.ts +618 -0
  70. package/src/mock/MsalMockConfigurator.ts +305 -0
  71. package/src/mock/create-mock-token.ts +92 -0
  72. package/src/mock/create-mock-user-from-token.ts +46 -0
  73. package/src/mock/create-msal-mock-client.ts +25 -0
  74. package/src/mock/decode-jwt-segment.ts +22 -0
  75. package/src/mock/index.ts +30 -0
  76. package/src/mock/module.ts +54 -0
  77. package/src/msal-config-schema.ts +81 -0
  78. package/src/telemetry-config-schema.ts +25 -0
  79. package/src/version.ts +1 -1
  80. package/src/versioning/resolve-version.ts +0 -1
  81. package/vitest.config.ts +1 -1
  82. package/.changeset/msal-auth-provider-fix.md +0 -7
@@ -0,0 +1,239 @@
1
+ import { MsalConfigurator } from '../MsalConfigurator';
2
+ import { MsalMockClient } from './MsalMockClient';
3
+ import { createMockUserFromToken } from './create-mock-user-from-token';
4
+ /**
5
+ * The client configuration used when a test declares none.
6
+ *
7
+ * @remarks
8
+ * `MsalClientConfig.auth.clientId` is required, so a mock still needs a client
9
+ * configuration to exist. Supplying a default is what lets an application boot
10
+ * under test without declaring credentials it does not have.
11
+ */
12
+ const defaultMockClientConfig = {
13
+ auth: {
14
+ clientId: 'fusion-mock-client',
15
+ tenantId: 'fusion-mock-tenant',
16
+ },
17
+ };
18
+ /**
19
+ * The real MSAL configurator, backed by an in-process client.
20
+ *
21
+ * @remarks
22
+ * Nothing else changes: the same builder API, the same validation and the same
23
+ * `MsalProvider` are used. Only the boundary that would contact Entra ID is
24
+ * substituted, through the same
25
+ * {@link MsalConfigurator._createClient | _createClient} seam the real
26
+ * configurator builds its own client from — and from the same
27
+ * {@link MsalConfigurator._createClientConfig | _createClientConfig}, so
28
+ * `setClientConfig` means exactly what it means in production.
29
+ *
30
+ * A user named `Test User` is signed in by default, so an application boots
31
+ * without declaring anything.
32
+ *
33
+ * @example Name the signed-in user
34
+ * ```typescript
35
+ * enableMsalMock(configurator, (builder) => {
36
+ * builder.setAccount({ name: 'Ada Lovelace', username: 'ada@equinor.com' });
37
+ * });
38
+ * ```
39
+ *
40
+ * @example Configure the client exactly as in production
41
+ * ```typescript
42
+ * enableMsalMock(configurator, (builder) => {
43
+ * builder.setClientConfig({ auth: { clientId: 'my-app', tenantId: 'my-tenant' } });
44
+ * });
45
+ * ```
46
+ *
47
+ * @example Take full control of authentication
48
+ * ```typescript
49
+ * enableMsalMock(configurator, (builder) => {
50
+ * builder.setClient(new MyOwnMsalClient());
51
+ * });
52
+ * ```
53
+ */
54
+ export class MsalMockConfigurator extends MsalConfigurator {
55
+ /**
56
+ * Declares the user to sign in.
57
+ *
58
+ * @remarks
59
+ * Who is signed in is session state, not client configuration — which is what
60
+ * lets {@link MsalMockClient} take the same argument the real client takes: a
61
+ * client is configured with *what it talks to*, never with *who is signed in*.
62
+ *
63
+ * The user is therefore recorded on the configuration as `mock.account`, not
64
+ * on this builder, and is signed in on whichever client the module ends up
65
+ * authenticating through — wherever that client was built:
66
+ *
67
+ * - The client this builder builds, normally. The user is in place before
68
+ * `MsalProvider.initialize` runs, which is what makes the provider's own
69
+ * start-up path observable: with `signedOut` and `setRequiresAuth(true)`, a
70
+ * test sees the real automatic login run.
71
+ * - The **host's** client when the module is hoisted onto a host
72
+ * application's provider, because none is built here. An application inside
73
+ * a portal shares the portal's session, so this changes who the host sees
74
+ * signed in too, as it would in production.
75
+ * - A client supplied through {@link MsalConfigurator.setClient | setClient},
76
+ * when that client is a {@link MsalMockClient}.
77
+ *
78
+ * Throws when that client cannot represent a declared user, rather than
79
+ * failing quietly — a silent no-op is the whole failure mode this exists to
80
+ * prevent.
81
+ *
82
+ * Pass `null` when nobody is signed in, or `{ signedOut: true }` to keep an
83
+ * identity without a session — a later login then resolves as that user.
84
+ *
85
+ * @param account - The user, or an ordinary config-builder callback resolving it.
86
+ * @returns The builder, for chaining.
87
+ *
88
+ * @example Derive the user from the modules in scope
89
+ * ```typescript
90
+ * builder.setAccount(async ({ hasModule }) => ({
91
+ * name: hasModule('app') ? 'App User' : 'Portal User',
92
+ * }));
93
+ * ```
94
+ */
95
+ setAccount(account) {
96
+ this._set('mock.account', account);
97
+ return this;
98
+ }
99
+ /**
100
+ * Declares the token to return, independent of who is signed in.
101
+ *
102
+ * @remarks
103
+ * Use this when a backend mock validates its own tokens (specific claims, an
104
+ * audience, or a signature) — the client then returns this token verbatim
105
+ * instead of fabricating one from the signed-in user's fields.
106
+ *
107
+ * @param token - A JWT (e.g. from `createMockToken`, or issued by an external mock).
108
+ * @param skipResolve - When `true`, override only the token and leave an account
109
+ * declared through {@link setAccount} untouched. Defaults to `false`, which also signs
110
+ * in the user described by the token's claims, via {@link createMockUserFromToken}.
111
+ * @returns The builder, for chaining.
112
+ *
113
+ * @example Sign in as whoever the token names
114
+ * ```typescript
115
+ * builder.setToken(token);
116
+ * ```
117
+ *
118
+ * @example Keep a separately declared account, but return this exact token
119
+ * ```typescript
120
+ * builder.setAccount({ name: 'Ada Lovelace' }).setToken(token, true);
121
+ * ```
122
+ */
123
+ setToken(token, skipResolve = false) {
124
+ this._set('mock.token', token);
125
+ // skipResolve defaults to false - most callers want the token's claims to name who is signed in
126
+ if (!skipResolve) {
127
+ this.setAccount(createMockUserFromToken(token));
128
+ }
129
+ return this;
130
+ }
131
+ /**
132
+ * Resolves the client the module authenticates through, wherever it was built.
133
+ *
134
+ * @remarks
135
+ * Shared by {@link setAccount} and {@link setToken} application: neither can
136
+ * assume the scope declaring mock state is the scope that built the client,
137
+ * which is exactly what is not true when an application is tested inside a
138
+ * portal. The host built that client, in a scope this builder never sees, so
139
+ * the client has to be located rather than assumed.
140
+ *
141
+ * @param config - The validated configuration, carrying the client when one was built.
142
+ * @param init - The builder arguments, carrying the host reference when hoisted.
143
+ * @param action - Describes what could not be applied, for the thrown error.
144
+ * @returns The resolved mock client.
145
+ * @throws When the resolved client is not a {@link MsalMockClient}.
146
+ */
147
+ #getClient(config, init, action) {
148
+ const host = init?.ref?.auth;
149
+ const client = config.client ?? host?.client;
150
+ // Reject a real client because mock state cannot be applied to it.
151
+ if (!(client instanceof MsalMockClient)) {
152
+ throw new Error(`MsalMockConfigurator: cannot ${action}, because this module does not authenticate through a mock client. Declare it where that client is configured instead.`);
153
+ }
154
+ return client;
155
+ }
156
+ /**
157
+ * Signs the declared user in on the client the module authenticates through.
158
+ *
159
+ * @param account - The user to sign in, or `null` when nobody is.
160
+ * @param config - The validated configuration, carrying the client when one was built.
161
+ * @param init - The builder arguments, carrying the host reference when hoisted.
162
+ * @throws When the resolved client is not a {@link MsalMockClient}.
163
+ */
164
+ #signIn(account, config, init) {
165
+ this.#getClient(config, init, 'sign a user in').setUser(account);
166
+ }
167
+ /**
168
+ * Assembles the configuration, then signs the declared user in.
169
+ *
170
+ * @remarks
171
+ * Stands a client configuration in first when this builder is the one that
172
+ * will build a client: `MsalClientConfig.auth.clientId` is required to build
173
+ * any client at all and a test has no real credentials to declare. It then
174
+ * flows through the very same
175
+ * {@link MsalConfigurator._createClientConfig | _createClientConfig}
176
+ * enrichment the real client is built from, and anything declared through
177
+ * {@link MsalConfigurator.setClientConfig | setClientConfig} wins — exactly as
178
+ * in production.
179
+ *
180
+ * Doing that here rather than in the constructor is deliberate: a hoisted
181
+ * module authenticates through the host and builds no client, so it must not
182
+ * look configured either.
183
+ *
184
+ * The user is read from `rawConfig`, because the schema strips `mock` when it
185
+ * validates — the key exists to carry a test's declaration through the
186
+ * builder, never to reach the provider.
187
+ *
188
+ * @param rawConfig - The raw configuration to process.
189
+ * @param init - The builder arguments, carrying the host reference when hoisted.
190
+ * @returns The processed and validated configuration.
191
+ */
192
+ async _processConfig(rawConfig, init) {
193
+ // Supply mock credentials only when this builder owns client construction.
194
+ if (!this._isHoisted(init) && !this.getClientConfig()) {
195
+ this.setClientConfig(defaultMockClientConfig);
196
+ }
197
+ const config = await super._processConfig(rawConfig, init);
198
+ // `null` is a declaration in its own right — nobody is signed in — so only
199
+ // an absent one means the test said nothing about the user
200
+ const account = rawConfig.mock?.account;
201
+ // Apply even null because null explicitly requests a signed-out mock state.
202
+ if (account !== undefined) {
203
+ this.#signIn(account, config, init);
204
+ }
205
+ // Applied after the account so a token declared alongside `skipResolve: true`
206
+ // overrides whatever `setUser` above just fabricated.
207
+ const token = rawConfig.mock?.token;
208
+ // absent means the test declared no token override; leave the client generating its own
209
+ if (token !== undefined) {
210
+ this.#getClient(config, init, 'set a token').setToken(token);
211
+ }
212
+ return config;
213
+ }
214
+ /**
215
+ * Builds an in-process client.
216
+ *
217
+ * @remarks
218
+ * Called only when no client was set, so
219
+ * {@link MsalConfigurator.setClient | setClient} still replaces authentication
220
+ * outright.
221
+ *
222
+ * Deliberately does not delegate to `super`, which would build a real
223
+ * `MsalClient` and contact Entra ID. It is never reached when the module is
224
+ * hoisted onto a host application's provider, because the base configurator
225
+ * gates client creation on {@link MsalConfigurator._isHoisted | _isHoisted} —
226
+ * a mock client built there would shadow the host's client, the exact scenario
227
+ * an application-inside-a-portal test exists to cover.
228
+ *
229
+ * Knows nothing about who is signed in: a client is built from what it talks
230
+ * to, and the declared user is applied to it afterwards.
231
+ *
232
+ * @param config - The validated configuration the client is built from.
233
+ * @returns A client resolving tokens in-process.
234
+ */
235
+ async _createClient(config) {
236
+ return new MsalMockClient(this._createClientConfig(config) ?? defaultMockClientConfig);
237
+ }
238
+ }
239
+ //# sourceMappingURL=MsalMockConfigurator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MsalMockConfigurator.js","sourceRoot":"","sources":["../../../src/mock/MsalMockConfigurator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAgCxE;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAqB;IAChD,IAAI,EAAE;QACJ,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE,oBAAoB;KAC/B;CACF,CAAC;AAEF;;;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SAAqB,EACrB,IAAgC;QAEhC,2EAA2E;QAC3E,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YACtD,IAAI,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE3D,2EAA2E;QAC3E,2DAA2D;QAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;QACxC,4EAA4E;QAC5E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,8EAA8E;QAC9E,sDAAsD;QACtD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC;QACpC,wFAAwF;QACxF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACgB,KAAK,CAAC,aAAa,CAAC,MAAkB;QACvD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,uBAAuB,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Encodes a value as base64url without padding, as used in JWT segments.
3
+ *
4
+ * @param value - Raw string to encode.
5
+ * @returns The base64url representation.
6
+ */
7
+ const base64Url = (value) => {
8
+ // btoa operates on latin1; encodeURIComponent round-trip keeps non-ASCII names intact
9
+ const bytes = new TextEncoder().encode(value);
10
+ let binary = '';
11
+ // Iterate over encoded bytes so Unicode claims are preserved before base64url encoding.
12
+ for (const byte of bytes) {
13
+ binary += String.fromCharCode(byte);
14
+ }
15
+ return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
16
+ };
17
+ /**
18
+ * Creates a structurally valid, unsigned JWT for use in tests.
19
+ *
20
+ * The token has three base64url segments and decodes to the supplied claims, so
21
+ * code that splits, decodes, or inspects token claims behaves exactly as it does
22
+ * in production. The signature segment is a fixed placeholder — the token is
23
+ * **not** cryptographically valid and will be rejected by any real service.
24
+ *
25
+ * @remarks
26
+ * Timestamps default to a fixed issue time and a one-hour lifetime so repeated
27
+ * runs produce byte-identical tokens. A test that needs an expired token can set
28
+ * `exp` in the past.
29
+ *
30
+ * @param claims - Claims to embed in the token payload.
31
+ * @returns An unsigned JWT string in `header.payload.signature` form.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const token = createMockToken({ name: 'Test User', scp: 'Files.Read' });
36
+ * const [, payload] = token.split('.');
37
+ * JSON.parse(decodeJwtSegment(payload)).name; // 'Test User'
38
+ * ```
39
+ */
40
+ export const createMockToken = (claims = {}) => {
41
+ const header = { alg: 'none', typ: 'JWT' };
42
+ // Fixed default clock keeps generated tokens byte-identical between runs
43
+ const issuedAt = claims.iat ?? 1_700_000_000;
44
+ const payload = {
45
+ iss: 'https://login.microsoftonline.com/fusion-test-tenant/v2.0',
46
+ aud: 'fusion-test-client',
47
+ tid: 'fusion-test-tenant',
48
+ oid: 'fusion-test-user',
49
+ iat: issuedAt,
50
+ nbf: issuedAt,
51
+ exp: issuedAt + 3600,
52
+ ...claims,
53
+ };
54
+ return [
55
+ base64Url(JSON.stringify(header)),
56
+ base64Url(JSON.stringify(payload)),
57
+ 'fusion-test-signature',
58
+ ].join('.');
59
+ };
60
+ //# sourceMappingURL=create-mock-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mock-token.js","sourceRoot":"","sources":["../../../src/mock/create-mock-token.ts"],"names":[],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ACd,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { decodeJwtSegment } from './decode-jwt-segment';
2
+ /**
3
+ * Derives a {@link MsalMockUser} from a JWT's payload claims, so a token minted
4
+ * outside this module (e.g. by a backend's own mock) can drive who the mock
5
+ * signs in as.
6
+ *
7
+ * @remarks
8
+ * Maps the standard Entra ID claims Fusion applications read — `name`,
9
+ * `preferred_username`, `oid`, `tid`, `scp` — onto the matching
10
+ * {@link MsalMockUser} fields. Identity only: it does not affect which token
11
+ * the client returns — use {@link MsalMockConfigurator.setToken} for that.
12
+ *
13
+ * @param token - A JWT (e.g. from {@link createMockToken}, or issued by an
14
+ * external mock) with a base64url-encoded payload segment.
15
+ * @returns A mock user built from the token's claims.
16
+ * @throws When the token has no payload segment (`header.payload.signature`).
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * enableMsalMock(configurator, (builder) => {
21
+ * builder.setAccount(createMockUserFromToken(token));
22
+ * });
23
+ * ```
24
+ */
25
+ export const createMockUserFromToken = (token) => {
26
+ const [, payload] = token.split('.');
27
+ // fail loudly rather than signing in an empty/garbage user from a malformed token
28
+ if (!payload) {
29
+ throw new Error('createMockUserFromToken: expected a JWT with a payload segment (header.payload.signature)');
30
+ }
31
+ const claims = JSON.parse(decodeJwtSegment(payload));
32
+ return {
33
+ name: claims.name,
34
+ username: claims.preferred_username,
35
+ userId: claims.oid,
36
+ tenantId: claims.tid,
37
+ scopes: claims.scp?.split(' '),
38
+ };
39
+ };
40
+ //# sourceMappingURL=create-mock-user-from-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mock-user-from-token.js","sourceRoot":"","sources":["../../../src/mock/create-mock-user-from-token.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAgB,EAAE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,kFAAkF;IAClF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAoB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtE,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,kBAAkB;QACnC,MAAM,EAAE,MAAM,CAAC,GAAG;QAClB,QAAQ,EAAE,MAAM,CAAC,GAAG;QACpB,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;KAC/B,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { MsalMockClient } from './MsalMockClient';
2
+ /**
3
+ * Convenience helper that creates a mock client instance.
4
+ *
5
+ * @remarks
6
+ * The class form is preferred for a more familiar configuration pattern.
7
+ *
8
+ * @param config - The same client configuration the real client is built from.
9
+ * @param user - Optional user to sign in, applied after construction.
10
+ * @returns A client that resolves tokens in-process.
11
+ */
12
+ export const createMsalMockClient = (config, user) => {
13
+ const client = new MsalMockClient(config);
14
+ // Apply the optional identity after construction so the helper matches setUser semantics.
15
+ if (user) {
16
+ client.setUser(user);
17
+ }
18
+ return client;
19
+ };
20
+ //# sourceMappingURL=create-msal-mock-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-msal-mock-client.js","sourceRoot":"","sources":["../../../src/mock/create-msal-mock-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAwB,EACxB,IAAmB,EACN,EAAE;IACf,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,0FAA0F;IAC1F,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Decodes a base64url segment of a {@link createMockToken} JWT back to its JSON string.
3
+ *
4
+ * @remarks
5
+ * Plain `atob` alone mangles non-ASCII claims: it treats its output as latin1,
6
+ * while segments are UTF-8 encoded. This reverses that encoding and also
7
+ * restores the standard base64 alphabet/padding `atob` expects.
8
+ *
9
+ * @param segment - A base64url segment, e.g. from splitting a JWT on `.`.
10
+ * @returns The decoded UTF-8 string.
11
+ */
12
+ export function decodeJwtSegment(segment) {
13
+ const base64 = segment
14
+ .replace(/-/g, '+')
15
+ .replace(/_/g, '/')
16
+ .padEnd(segment.length + ((4 - (segment.length % 4)) % 4), '=');
17
+ const binary = atob(base64);
18
+ const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
19
+ return new TextDecoder().decode(bytes);
20
+ }
21
+ export default decodeJwtSegment;
22
+ //# sourceMappingURL=decode-jwt-segment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode-jwt-segment.js","sourceRoot":"","sources":["../../../src/mock/decode-jwt-segment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Mock MSAL for tests: real provider, real configurator, fake client.
3
+ *
4
+ * @remarks
5
+ * Substituting the client is the smallest change that removes Entra ID from a test.
6
+ * Everything above it — scope resolution, silent-first token acquisition, account
7
+ * handling, proxy providers, telemetry — is the production code path.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { enableMsalMock } from '@equinor/fusion-framework-module-msal/mock';
12
+ *
13
+ * // default mock user
14
+ * enableMsalMock(configurator);
15
+ *
16
+ * // or a specific one
17
+ * enableMsalMock(configurator, (builder) => {
18
+ * builder.setAccount({ name: 'Ada Lovelace', signedOut: true });
19
+ * });
20
+ * ```
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ export { MsalMockClient } from './MsalMockClient';
25
+ export { createMsalMockClient } from './create-msal-mock-client';
26
+ export { MsalMockConfigurator } from './MsalMockConfigurator';
27
+ export { enableMsalMock, msalMockModule } from './module';
28
+ export { createMockToken } from './create-mock-token';
29
+ export { createMockUserFromToken } from './create-mock-user-from-token';
30
+ export { decodeJwtSegment } from './decode-jwt-segment';
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mock/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAyB,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,eAAe,EAAwB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { module } from '../module';
2
+ import { MsalMockConfigurator } from './MsalMockConfigurator';
3
+ /**
4
+ * The MSAL module with a mock client instead of a live connection to Entra ID.
5
+ *
6
+ * @remarks
7
+ * Only `configure` differs from the real module. `initialize` is the production
8
+ * one, untouched, so proxy providers, host-provider hoisting and provider
9
+ * initialization all behave exactly as they do in production — and a test
10
+ * observes the real start-up path rather than a rehearsal of it.
11
+ */
12
+ export const msalMockModule = {
13
+ ...module,
14
+ configure: () => new MsalMockConfigurator(),
15
+ };
16
+ /**
17
+ * Enables MSAL against a mock client, so a test needs no credentials and no network.
18
+ *
19
+ * @remarks
20
+ * Registered last, this replaces whichever auth module the configurator already
21
+ * carries, so it works on a `FrameworkConfigurator` that pre-registers the real one.
22
+ *
23
+ * @param configurator - The modules configurator to register on.
24
+ * @param configure - Optional callback to override the default mock client.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * enableMsalMock(configurator, (builder) => {
29
+ * builder.setAccount({ name: 'Ada Lovelace' });
30
+ * });
31
+ * ```
32
+ */
33
+ export const enableMsalMock = (
34
+ // biome-ignore lint/suspicious/noExplicitAny: must be any to support all module types
35
+ configurator, configure) => {
36
+ configurator.addConfig({ module: msalMockModule, configure });
37
+ };
38
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/mock/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmB,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,GAAG,MAAM;IACT,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,oBAAoB,EAAE;CAC5C,CAAC;AAUF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;AAC5B,sFAAsF;AACtF,YAA4C,EAC5C,SAA4B,EACtB,EAAE;IACR,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAEzD,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import z from 'zod';
2
+ import semver from 'semver';
3
+ import { CacheLookupPolicy } from '@azure/msal-browser';
4
+ import { TelemetryConfigSchema } from './telemetry-config-schema';
5
+ /**
6
+ * Zod schema for MSAL module configuration validation.
7
+ *
8
+ * @remarks
9
+ * Kept in its own module so the configuration can be extended at its source.
10
+ * The schema itself describes what reaches `MsalProvider` and strips anything
11
+ * else; keys a variant of this module needs only while the configuration is
12
+ * being built are declared on {@link MsalConfigExtension} instead.
13
+ */
14
+ export const MsalConfigSchema = z.object({
15
+ client: z.custom().optional(),
16
+ provider: z.custom().optional(),
17
+ requiresAuth: z.boolean().optional(),
18
+ redirectUri: z.string().optional(),
19
+ loginHint: z.string().optional(),
20
+ authCode: z.string().optional(),
21
+ cacheLookupPolicy: z
22
+ .custom((val) => typeof val === 'number' &&
23
+ Object.values(CacheLookupPolicy).includes(val))
24
+ .optional(),
25
+ version: z.string().transform((value, ctx) => {
26
+ const coerced = semver.coerce(value);
27
+ // `semver.coerce` returns `null` for an unparseable version; without this guard it
28
+ // would silently become the literal string "null" instead of failing validation.
29
+ if (!coerced) {
30
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid MSAL module version' });
31
+ return z.NEVER;
32
+ }
33
+ return coerced.version;
34
+ }),
35
+ telemetry: TelemetryConfigSchema,
36
+ });
37
+ //# sourceMappingURL=msal-config-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msal-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,CAAC,CAAC;YACtF,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC;IACzB,CAAC,CAAC;IACF,SAAS,EAAE,qBAAqB;CACjC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import z from 'zod';
2
+ import { version } from './version';
3
+ /**
4
+ * Zod schema for telemetry configuration validation.
5
+ *
6
+ * @internal
7
+ */
8
+ export const TelemetryConfigSchema = z.object({
9
+ provider: z.custom().optional(),
10
+ metadata: z.record(z.string(), z.unknown()).optional().default({
11
+ module: 'msal',
12
+ version,
13
+ }),
14
+ scope: z.array(z.string()).optional().default(['framework', 'authentication']),
15
+ });
16
+ //# sourceMappingURL=telemetry-config-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-config-schema.js","sourceRoot":"","sources":["../../src/telemetry-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAsB,CAAC,QAAQ,EAAE;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QAC7D,MAAM,EAAE,MAAM;QACd,OAAO;KACR,CAAC;IACF,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;CAC/E,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '10.0.2';
2
+ export const version = '11.0.0-next.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC"}
@@ -24,7 +24,6 @@ import { version as latestVersionString } from '../version';
24
24
  * ```
25
25
  */
26
26
  function mapVersionToEnumVersion(version) {
27
- console.log('Resolving version:', version);
28
27
  const coercedVersion = semver.coerce(version);
29
28
  // An uncoercible version string cannot be mapped to a module version
30
29
  if (!coercedVersion) {
@@ -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;;;;;;;;;;;;;;;;;;;;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,qEAAqE;IACrE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,gFAAgF;IAChF,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/C,OAAO,iBAAiB,CAAC,EAAE,CAAC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