@microsoft/agents-hosting 1.6.1 → 1.7.0-beta.1.g8bcd4f11a7

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 (87) hide show
  1. package/dist/package.json +3 -3
  2. package/dist/src/app/streaming/streamingResponse.d.ts +11 -0
  3. package/dist/src/app/streaming/streamingResponse.js +21 -0
  4. package/dist/src/app/streaming/streamingResponse.js.map +1 -1
  5. package/dist/src/auth/MemoryCache.d.ts +2 -1
  6. package/dist/src/auth/MemoryCache.js +7 -1
  7. package/dist/src/auth/MemoryCache.js.map +1 -1
  8. package/dist/src/auth/authConfiguration.d.ts +1 -1
  9. package/dist/src/auth/authConfiguration.js +36 -1
  10. package/dist/src/auth/authConfiguration.js.map +1 -1
  11. package/dist/src/auth/authConstants.d.ts +7 -7
  12. package/dist/src/auth/authConstants.js.map +1 -1
  13. package/dist/src/auth/connectionManager.d.ts +92 -0
  14. package/dist/src/auth/{msalConnectionManager.js → connectionManager.js} +50 -48
  15. package/dist/src/auth/connectionManager.js.map +1 -0
  16. package/dist/src/auth/index.d.ts +5 -3
  17. package/dist/src/auth/index.js +5 -3
  18. package/dist/src/auth/index.js.map +1 -1
  19. package/dist/src/auth/jwt-middleware.d.ts +6 -0
  20. package/dist/src/auth/jwt-middleware.js +32 -1
  21. package/dist/src/auth/jwt-middleware.js.map +1 -1
  22. package/dist/src/auth/msal/msalConnectionManager.d.ts +17 -0
  23. package/dist/src/auth/msal/msalConnectionManager.js +50 -0
  24. package/dist/src/auth/msal/msalConnectionManager.js.map +1 -0
  25. package/dist/src/auth/msal/msalConnectionSettings.d.ts +68 -0
  26. package/dist/src/auth/msal/msalConnectionSettings.js +7 -0
  27. package/dist/src/auth/msal/msalConnectionSettings.js.map +1 -0
  28. package/dist/src/auth/{msalTokenCredential.d.ts → msal/msalTokenCredential.d.ts} +1 -1
  29. package/dist/src/auth/{msalTokenCredential.js → msal/msalTokenCredential.js} +2 -2
  30. package/dist/src/auth/msal/msalTokenCredential.js.map +1 -0
  31. package/dist/src/auth/{msalTokenProvider.d.ts → msal/msalTokenProvider.d.ts} +23 -3
  32. package/dist/src/auth/{msalTokenProvider.js → msal/msalTokenProvider.js} +264 -160
  33. package/dist/src/auth/msal/msalTokenProvider.js.map +1 -0
  34. package/dist/src/auth/settings.d.ts +142 -133
  35. package/dist/src/auth/settings.js +49 -5
  36. package/dist/src/auth/settings.js.map +1 -1
  37. package/dist/src/auth/sidecar/sidecarAuthProvider.d.ts +74 -0
  38. package/dist/src/auth/sidecar/sidecarAuthProvider.js +181 -0
  39. package/dist/src/auth/sidecar/sidecarAuthProvider.js.map +1 -0
  40. package/dist/src/auth/sidecar/sidecarConnectionSettings.d.ts +65 -0
  41. package/dist/src/auth/sidecar/sidecarConnectionSettings.js +7 -0
  42. package/dist/src/auth/sidecar/sidecarConnectionSettings.js.map +1 -0
  43. package/dist/src/auth/sidecar/sidecarHttpClient.d.ts +95 -0
  44. package/dist/src/auth/sidecar/sidecarHttpClient.js +406 -0
  45. package/dist/src/auth/sidecar/sidecarHttpClient.js.map +1 -0
  46. package/dist/src/auth/sidecar/sidecarModels.d.ts +110 -0
  47. package/dist/src/auth/sidecar/sidecarModels.js +48 -0
  48. package/dist/src/auth/sidecar/sidecarModels.js.map +1 -0
  49. package/dist/src/auth/sidecar/sidecarTokenExpiry.d.ts +13 -0
  50. package/dist/src/auth/sidecar/sidecarTokenExpiry.js +39 -0
  51. package/dist/src/auth/sidecar/sidecarTokenExpiry.js.map +1 -0
  52. package/dist/src/cloudAdapter.js +1 -1
  53. package/dist/src/cloudAdapter.js.map +1 -1
  54. package/dist/src/errorHelper.js +96 -0
  55. package/dist/src/errorHelper.js.map +1 -1
  56. package/dist/src/index.d.ts +1 -1
  57. package/dist/src/index.js +2 -1
  58. package/dist/src/index.js.map +1 -1
  59. package/dist/src/oauth/userTokenClient.d.ts +12 -0
  60. package/dist/src/oauth/userTokenClient.js +28 -8
  61. package/dist/src/oauth/userTokenClient.js.map +1 -1
  62. package/package.json +3 -3
  63. package/src/app/streaming/streamingResponse.ts +24 -1
  64. package/src/auth/MemoryCache.ts +7 -1
  65. package/src/auth/authConfiguration.ts +36 -3
  66. package/src/auth/authConstants.ts +7 -7
  67. package/src/auth/{msalConnectionManager.ts → connectionManager.ts} +65 -61
  68. package/src/auth/index.ts +5 -3
  69. package/src/auth/jwt-middleware.ts +31 -1
  70. package/src/auth/msal/msalConnectionManager.ts +55 -0
  71. package/src/auth/msal/msalConnectionSettings.ts +79 -0
  72. package/src/auth/{msalTokenCredential.ts → msal/msalTokenCredential.ts} +2 -1
  73. package/src/auth/{msalTokenProvider.ts → msal/msalTokenProvider.ts} +337 -156
  74. package/src/auth/settings.ts +131 -76
  75. package/src/auth/sidecar/sidecarAuthProvider.ts +234 -0
  76. package/src/auth/sidecar/sidecarConnectionSettings.ts +72 -0
  77. package/src/auth/sidecar/sidecarHttpClient.ts +443 -0
  78. package/src/auth/sidecar/sidecarModels.ts +153 -0
  79. package/src/auth/sidecar/sidecarTokenExpiry.ts +35 -0
  80. package/src/cloudAdapter.ts +1 -1
  81. package/src/errorHelper.ts +110 -0
  82. package/src/index.ts +1 -1
  83. package/src/oauth/userTokenClient.ts +43 -9
  84. package/dist/src/auth/msalConnectionManager.d.ts +0 -64
  85. package/dist/src/auth/msalConnectionManager.js.map +0 -1
  86. package/dist/src/auth/msalTokenCredential.js.map +0 -1
  87. package/dist/src/auth/msalTokenProvider.js.map +0 -1
@@ -2,7 +2,19 @@
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { ConnectionMapItem } from './msalConnectionManager';
5
+ import type { MsalConnectionSettings } from './msal/msalConnectionSettings';
6
+ import type { SidecarConnectionSettings } from './sidecar/sidecarConnectionSettings';
7
+ export type { MsalConnectionSettings } from './msal/msalConnectionSettings';
8
+ export type { SidecarConnectionSettings } from './sidecar/sidecarConnectionSettings';
9
+ /**
10
+ * A single entry in the connections map used to route an inbound activity
11
+ * (matched by audience and/or serviceUrl) to a named connection.
12
+ */
13
+ export interface ConnectionMapItem {
14
+ serviceUrl: string;
15
+ audience?: string;
16
+ connection: string;
17
+ }
6
18
  export declare const DEFAULT_CONNECTION_MAP: ConnectionMapItem;
7
19
  export type ConnectionKeys = keyof Omit<AuthConfiguration, 'connections' | 'connectionsMap'>;
8
20
  export type ConnectionMapKeys = keyof ConnectionMapItem;
@@ -15,29 +27,40 @@ export interface LoadEnv {
15
27
  export declare function loadEnvSettings(callback: (key: string, value: string) => void): LoadEnv;
16
28
  export declare function applyDefaultSettings(config: AuthConfiguration): {
17
29
  /**
18
- * The tenant ID for the authentication configuration.
19
- */
20
- tenantId?: string;
21
- /**
22
- * The client ID for the authentication configuration. Required in production.
30
+ * The connection registry: a map of connection name to that connection's settings.
31
+ *
32
+ * @remarks
33
+ * Each value is the {@link ConnectionSettings} for one connection (typed as {@link AuthConfiguration}
34
+ * for backward compatibility; only the connection-settings subset is consumed). An `AuthProvider` is
35
+ * created per entry by `AuthProviderFactory`, dispatched by `authType`.
23
36
  */
24
- clientId?: string;
37
+ connections?: Map<string, AuthConfiguration>;
25
38
  /**
26
- * The client secret for the authentication configuration.
39
+ * A list of connection map items to map service URLs to connection names.
27
40
  */
41
+ connectionsMap?: ConnectionMapItem[];
28
42
  clientSecret?: string;
43
+ certPemFile?: string;
44
+ certKeyFile?: string;
45
+ sendX5C?: boolean;
46
+ FICClientId?: string;
47
+ WIDAssertionFile?: string;
48
+ azureRegion?: string;
49
+ federatedTokenFile?: string;
50
+ idpmResource?: string;
51
+ federatedClientId?: string;
29
52
  /**
30
- * The path to the certificate PEM file.
53
+ * The tenant ID for the authentication configuration.
31
54
  */
32
- certPemFile?: string;
55
+ tenantId?: string;
33
56
  /**
34
- * The path to the certificate key file.
57
+ * The client ID for the authentication configuration. Required in production.
35
58
  */
36
- certKeyFile?: string;
59
+ clientId?: string;
37
60
  /**
38
- * Indicates whether to send the X5C param or not (for SNI authentication).
61
+ * The authentication type for the connection.
39
62
  */
40
- sendX5C?: boolean;
63
+ authType?: AuthType | string;
41
64
  /**
42
65
  * A list of valid issuers for the authentication configuration.
43
66
  */
@@ -46,12 +69,6 @@ export declare function applyDefaultSettings(config: AuthConfiguration): {
46
69
  * The connection name for the authentication configuration.
47
70
  */
48
71
  connectionName?: string;
49
- /**
50
- * @deprecated Use federatedClientId instead.
51
- *
52
- * The FIC (First-Party Integration Channel) client ID.
53
- */
54
- FICClientId?: string;
55
72
  /**
56
73
  * @deprecated Use authorityEndpoint instead.
57
74
  *
@@ -63,51 +80,6 @@ export declare function applyDefaultSettings(config: AuthConfiguration): {
63
80
  * see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
64
81
  */
65
82
  authority?: string;
66
- /**
67
- * @deprecated Use scopes instead.
68
- */
69
- scope?: string;
70
- /**
71
- * A map of connection names to their respective authentication configurations.
72
- */
73
- connections?: Map<string, AuthConfiguration>;
74
- /**
75
- * A list of connection map items to map service URLs to connection names.
76
- */
77
- connectionsMap?: ConnectionMapItem[];
78
- /**
79
- * An optional alternative blueprint Connection name used when constructing a connector client.
80
- */
81
- altBlueprintConnectionName?: string;
82
- /**
83
- * @deprecated Use `authType` set to `'WorkloadIdentity'` and `federatedTokenFile` instead.
84
- *
85
- * The path to K8s provided token.
86
- */
87
- WIDAssertionFile?: string;
88
- /**
89
- * The Azure region for ESTS-R regional token acquisition (e.g. 'westus', 'eastus').
90
- * When set, MSAL routes token requests to the specified regional endpoint.
91
- * See https://learn.microsoft.com/en-us/entra/msal/javascript/node/regional-authorities for details.
92
- */
93
- azureRegion?: string;
94
- /**
95
- * The authentication type for the connection.
96
- */
97
- authType?: AuthType | string;
98
- /**
99
- * The path to the federated token file used for Workload Identity authentication.
100
- */
101
- federatedTokenFile?: string;
102
- /**
103
- * Sets the resource URL for Identity Proxy Manager (IDPM).
104
- *
105
- * @remarks
106
- * Set this to the appropriate resource identifier when the application is running in an environment,
107
- * such as a Foundry container, that exposes Managed Identity through a container-specific IMDS endpoint.
108
- * This setting is only meaningful when using Identity Proxy Manager (AuthType.IdentityProxyManager) for authentication.
109
- */
110
- idpmResource?: string;
111
83
  /**
112
84
  * Entra Authentication Endpoint to use.
113
85
  *
@@ -118,13 +90,36 @@ export declare function applyDefaultSettings(config: AuthConfiguration): {
118
90
  */
119
91
  authorityEndpoint?: string;
120
92
  /**
121
- * The federated client ID for the authentication configuration, used for workload identity federation scenarios.
93
+ * @deprecated Use scopes instead.
122
94
  */
123
- federatedClientId?: string;
95
+ scope?: string;
124
96
  /**
125
97
  * The scopes for the authentication configuration.
126
98
  */
127
99
  scopes?: string[];
100
+ /**
101
+ * An optional alternative blueprint Connection name used when constructing a connector client.
102
+ *
103
+ * @remarks
104
+ * Equivalent to the .NET `AlternateBlueprintConnectionName` connection setting. {@link alternateBlueprintConnectionName}
105
+ * is an alias of this property that matches the .NET name exactly; when both are provided this property takes precedence.
106
+ */
107
+ altBlueprintConnectionName?: string;
108
+ /**
109
+ * Alias of {@link altBlueprintConnectionName} named to match the .NET `AlternateBlueprintConnectionName`
110
+ * connection setting exactly.
111
+ *
112
+ * @remarks
113
+ * Provided for stricter .NET parity. The two properties are kept in sync during configuration normalization;
114
+ * {@link altBlueprintConnectionName} takes precedence when both are set.
115
+ */
116
+ alternateBlueprintConnectionName?: string;
117
+ sidecarBaseUrl?: string;
118
+ serviceName?: string;
119
+ blueprintServiceName?: string;
120
+ bypassLocalNetworkRestriction?: boolean;
121
+ requestTimeout?: number;
122
+ retryCount?: number;
128
123
  };
129
124
  /**
130
125
  * A type representing a parser settings object.
@@ -196,9 +191,16 @@ export declare const envParserUtils: {
196
191
  */
197
192
  export declare function resolveAuthority(authority?: string, tenantId?: string): string;
198
193
  /**
199
- * Represents the authentication configuration.
194
+ * Connection-level settings common to every authentication provider.
195
+ *
196
+ * @remarks
197
+ * Mirrors the .NET `Microsoft.Agents.Authentication.ConnectionSettingsBase` abstract class: these are
198
+ * the credential-agnostic properties shared by all connection types. Provider-specific settings
199
+ * extend this base (see {@link MsalConnectionSettings} for MSAL and {@link SidecarConnectionSettings}
200
+ * for the Entra sidecar). The active provider for a connection is selected
201
+ * by {@link ConnectionSettingsBase.authType | authType}; see `AuthProviderFactory`.
200
202
  */
201
- export interface AuthConfiguration {
203
+ export interface ConnectionSettingsBase {
202
204
  /**
203
205
  * The tenant ID for the authentication configuration.
204
206
  */
@@ -208,21 +210,9 @@ export interface AuthConfiguration {
208
210
  */
209
211
  clientId?: string;
210
212
  /**
211
- * The client secret for the authentication configuration.
212
- */
213
- clientSecret?: string;
214
- /**
215
- * The path to the certificate PEM file.
216
- */
217
- certPemFile?: string;
218
- /**
219
- * The path to the certificate key file.
220
- */
221
- certKeyFile?: string;
222
- /**
223
- * Indicates whether to send the X5C param or not (for SNI authentication).
213
+ * The authentication type for the connection.
224
214
  */
225
- sendX5C?: boolean;
215
+ authType?: AuthType | string;
226
216
  /**
227
217
  * A list of valid issuers for the authentication configuration.
228
218
  */
@@ -231,12 +221,6 @@ export interface AuthConfiguration {
231
221
  * The connection name for the authentication configuration.
232
222
  */
233
223
  connectionName?: string;
234
- /**
235
- * @deprecated Use federatedClientId instead.
236
- *
237
- * The FIC (First-Party Integration Channel) client ID.
238
- */
239
- FICClientId?: string;
240
224
  /**
241
225
  * @deprecated Use authorityEndpoint instead.
242
226
  *
@@ -249,67 +233,83 @@ export interface AuthConfiguration {
249
233
  */
250
234
  authority?: string;
251
235
  /**
252
- * @deprecated Use scopes instead.
236
+ * Entra Authentication Endpoint to use.
237
+ *
238
+ * @remarks
239
+ * If not populated the Entra Public Cloud endpoint is assumed.
240
+ * This example of Public Cloud Endpoint is https://login.microsoftonline.com
241
+ * see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
253
242
  */
254
- scope?: string;
243
+ authorityEndpoint?: string;
255
244
  /**
256
- * A map of connection names to their respective authentication configurations.
245
+ * @deprecated Use scopes instead.
257
246
  */
258
- connections?: Map<string, AuthConfiguration>;
247
+ scope?: string;
259
248
  /**
260
- * A list of connection map items to map service URLs to connection names.
249
+ * The scopes for the authentication configuration.
261
250
  */
262
- connectionsMap?: ConnectionMapItem[];
251
+ scopes?: string[];
263
252
  /**
264
253
  * An optional alternative blueprint Connection name used when constructing a connector client.
265
- */
266
- altBlueprintConnectionName?: string;
267
- /**
268
- * @deprecated Use `authType` set to `'WorkloadIdentity'` and `federatedTokenFile` instead.
269
254
  *
270
- * The path to K8s provided token.
271
- */
272
- WIDAssertionFile?: string;
273
- /**
274
- * The Azure region for ESTS-R regional token acquisition (e.g. 'westus', 'eastus').
275
- * When set, MSAL routes token requests to the specified regional endpoint.
276
- * See https://learn.microsoft.com/en-us/entra/msal/javascript/node/regional-authorities for details.
277
- */
278
- azureRegion?: string;
279
- /**
280
- * The authentication type for the connection.
281
- */
282
- authType?: AuthType | string;
283
- /**
284
- * The path to the federated token file used for Workload Identity authentication.
255
+ * @remarks
256
+ * Equivalent to the .NET `AlternateBlueprintConnectionName` connection setting. {@link alternateBlueprintConnectionName}
257
+ * is an alias of this property that matches the .NET name exactly; when both are provided this property takes precedence.
285
258
  */
286
- federatedTokenFile?: string;
259
+ altBlueprintConnectionName?: string;
287
260
  /**
288
- * Sets the resource URL for Identity Proxy Manager (IDPM).
261
+ * Alias of {@link altBlueprintConnectionName} named to match the .NET `AlternateBlueprintConnectionName`
262
+ * connection setting exactly.
289
263
  *
290
264
  * @remarks
291
- * Set this to the appropriate resource identifier when the application is running in an environment,
292
- * such as a Foundry container, that exposes Managed Identity through a container-specific IMDS endpoint.
293
- * This setting is only meaningful when using Identity Proxy Manager (AuthType.IdentityProxyManager) for authentication.
265
+ * Provided for stricter .NET parity. The two properties are kept in sync during configuration normalization;
266
+ * {@link altBlueprintConnectionName} takes precedence when both are set.
294
267
  */
295
- idpmResource?: string;
268
+ alternateBlueprintConnectionName?: string;
269
+ }
270
+ /**
271
+ * The complete settings for a single connection, across every provider.
272
+ *
273
+ * @remarks
274
+ * This is the per-connection unit that an `AuthProvider` consumes: it combines the common base
275
+ * ({@link ConnectionSettingsBase}) with the MSAL settings ({@link MsalConnectionSettings}) and the
276
+ * Entra sidecar settings ({@link SidecarConnectionSettings}). The active provider for a connection is
277
+ * selected by `authType`, so only the subset of these properties relevant to that provider is used.
278
+ *
279
+ * Conceptually this is the consumer-facing counterpart to the {@link AuthConfiguration} *container*:
280
+ * each value in {@link AuthConfiguration.connections} is the settings for one connection. It parallels
281
+ * the .NET `IConnectionSettings` (a single connection's settings) as distinct from the connection
282
+ * registry. {@link AuthConfiguration} extends this type for backward compatibility (it doubles as the
283
+ * settings for the legacy single connection).
284
+ */
285
+ export interface ConnectionSettings extends MsalConnectionSettings, SidecarConnectionSettings {
286
+ }
287
+ /**
288
+ * Represents the authentication configuration.
289
+ *
290
+ * @remarks
291
+ * The agent-level authentication container. It owns the connection registry
292
+ * (`connections`/`connectionsMap`) and, for backward compatibility, also extends
293
+ * {@link ConnectionSettings} so the legacy single-connection shape (a flat config with `clientId`,
294
+ * `clientSecret`, etc.) keeps working — in that mode the top-level object *is* the one connection's
295
+ * settings. The active provider for each connection is dispatched by `authType` via
296
+ * `AuthProviderFactory`, so a single connection only uses the subset of these properties relevant to
297
+ * its provider.
298
+ */
299
+ export interface AuthConfiguration extends ConnectionSettings {
296
300
  /**
297
- * Entra Authentication Endpoint to use.
301
+ * The connection registry: a map of connection name to that connection's settings.
298
302
  *
299
303
  * @remarks
300
- * If not populated the Entra Public Cloud endpoint is assumed.
301
- * This example of Public Cloud Endpoint is https://login.microsoftonline.com
302
- * see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
303
- */
304
- authorityEndpoint?: string;
305
- /**
306
- * The federated client ID for the authentication configuration, used for workload identity federation scenarios.
304
+ * Each value is the {@link ConnectionSettings} for one connection (typed as {@link AuthConfiguration}
305
+ * for backward compatibility; only the connection-settings subset is consumed). An `AuthProvider` is
306
+ * created per entry by `AuthProviderFactory`, dispatched by `authType`.
307
307
  */
308
- federatedClientId?: string;
308
+ connections?: Map<string, AuthConfiguration>;
309
309
  /**
310
- * The scopes for the authentication configuration.
310
+ * A list of connection map items to map service URLs to connection names.
311
311
  */
312
- scopes?: string[];
312
+ connectionsMap?: ConnectionMapItem[];
313
313
  }
314
314
  /**
315
315
  * Supported authentication types for agent connections.
@@ -322,6 +322,15 @@ export declare enum AuthType {
322
322
  SystemManagedIdentity = "SystemManagedIdentity",
323
323
  FederatedCredentials = "FederatedCredentials",
324
324
  WorkloadIdentity = "WorkloadIdentity",
325
- IdentityProxyManager = "IdentityProxyManager"
325
+ IdentityProxyManager = "IdentityProxyManager",
326
+ EntraAuthSideCar = "EntraAuthSideCar"
326
327
  }
327
- export {};
328
+ /**
329
+ * Resolves the authentication type for a given authentication configuration.
330
+ * @remarks
331
+ * The function checks various properties of the `authConfig` object to determine the appropriate authentication type.
332
+ * It returns a string representing the resolved authentication type or 'unknown' if it cannot be determined.
333
+ * @param authConfig The authentication configuration object.
334
+ * @returns The resolved authentication type as a string or 'unknown' if it cannot be determined.
335
+ */
336
+ export declare function resolveAuthType(authConfig?: AuthConfiguration): AuthType | string;
@@ -9,7 +9,10 @@ exports.loadEnvSettings = loadEnvSettings;
9
9
  exports.applyDefaultSettings = applyDefaultSettings;
10
10
  exports.envParser = envParser;
11
11
  exports.resolveAuthority = resolveAuthority;
12
+ exports.resolveAuthType = resolveAuthType;
12
13
  const agents_telemetry_1 = require("@microsoft/agents-telemetry");
14
+ const agents_activity_1 = require("@microsoft/agents-activity");
15
+ const errorHelper_1 = require("../errorHelper");
13
16
  const logger = (0, agents_telemetry_1.debug)('agents:authConfiguration');
14
17
  const DEFAULT_CONNECTION = 'serviceConnection';
15
18
  const AUTHORITY_DEFAULT = 'https://login.microsoftonline.com';
@@ -26,7 +29,7 @@ function loadEnvSettings(callback) {
26
29
  return env;
27
30
  }
28
31
  function applyDefaultSettings(config) {
29
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
30
33
  const settings = { ...config };
31
34
  (_a = settings.authorityEndpoint) !== null && _a !== void 0 ? _a : (settings.authorityEndpoint = (_b = settings.authority) !== null && _b !== void 0 ? _b : AUTHORITY_DEFAULT);
32
35
  (_c = settings.issuers) !== null && _c !== void 0 ? _c : (settings.issuers = getDefaultIssuers((_d = settings.tenantId) !== null && _d !== void 0 ? _d : '', settings.authorityEndpoint));
@@ -40,13 +43,18 @@ function applyDefaultSettings(config) {
40
43
  if (settings.authorityEndpoint) {
41
44
  settings.authority = settings.authorityEndpoint;
42
45
  }
43
- if (!settings.clientId && ((_g = process.env.NODE_ENV) === null || _g === void 0 ? void 0 : _g.toLowerCase()) === 'production') {
44
- throw new Error('ClientId required in production');
46
+ // .NET parity alias: keep altBlueprintConnectionName and alternateBlueprintConnectionName in sync.
47
+ (_g = settings.altBlueprintConnectionName) !== null && _g !== void 0 ? _g : (settings.altBlueprintConnectionName = settings.alternateBlueprintConnectionName);
48
+ if (settings.altBlueprintConnectionName) {
49
+ settings.alternateBlueprintConnectionName = settings.altBlueprintConnectionName;
45
50
  }
46
- const defaultConnections = ((_h = settings.connections) === null || _h === void 0 ? void 0 : _h.size)
51
+ if (!settings.clientId && ((_h = process.env.NODE_ENV) === null || _h === void 0 ? void 0 : _h.toLowerCase()) === 'production') {
52
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ClientIdRequiredInProduction);
53
+ }
54
+ const defaultConnections = ((_j = settings.connections) === null || _j === void 0 ? void 0 : _j.size)
47
55
  ? settings.connections
48
56
  : new Map([[DEFAULT_CONNECTION, { ...settings }]]);
49
- const defaultConnectionsMap = ((_j = settings.connectionsMap) === null || _j === void 0 ? void 0 : _j.length)
57
+ const defaultConnectionsMap = ((_k = settings.connectionsMap) === null || _k === void 0 ? void 0 : _k.length)
50
58
  ? settings.connectionsMap
51
59
  : [exports.DEFAULT_CONNECTION_MAP];
52
60
  settings.connections = defaultConnections;
@@ -154,5 +162,41 @@ var AuthType;
154
162
  AuthType["FederatedCredentials"] = "FederatedCredentials";
155
163
  AuthType["WorkloadIdentity"] = "WorkloadIdentity";
156
164
  AuthType["IdentityProxyManager"] = "IdentityProxyManager";
165
+ AuthType["EntraAuthSideCar"] = "EntraAuthSideCar";
157
166
  })(AuthType || (exports.AuthType = AuthType = {}));
167
+ /**
168
+ * Resolves the authentication type for a given authentication configuration.
169
+ * @remarks
170
+ * The function checks various properties of the `authConfig` object to determine the appropriate authentication type.
171
+ * It returns a string representing the resolved authentication type or 'unknown' if it cannot be determined.
172
+ * @param authConfig The authentication configuration object.
173
+ * @returns The resolved authentication type as a string or 'unknown' if it cannot be determined.
174
+ */
175
+ function resolveAuthType(authConfig) {
176
+ if (!authConfig) {
177
+ return 'none';
178
+ }
179
+ if (authConfig.authType) {
180
+ return authConfig.authType;
181
+ }
182
+ if (authConfig.WIDAssertionFile !== undefined) {
183
+ return AuthType.WorkloadIdentity;
184
+ }
185
+ if (authConfig.federatedClientId !== undefined || authConfig.FICClientId !== undefined) {
186
+ return AuthType.FederatedCredentials;
187
+ }
188
+ if (authConfig.clientSecret !== undefined) {
189
+ return AuthType.ClientSecret;
190
+ }
191
+ if (authConfig.certPemFile !== undefined && authConfig.certKeyFile !== undefined) {
192
+ return AuthType.Certificate;
193
+ }
194
+ if (authConfig.clientSecret === undefined && authConfig.certPemFile === undefined && authConfig.certKeyFile === undefined) {
195
+ return AuthType.UserManagedIdentity;
196
+ }
197
+ if (authConfig.idpmResource !== undefined) {
198
+ return AuthType.IdentityProxyManager;
199
+ }
200
+ return 'unknown';
201
+ }
158
202
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/auth/settings.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBH,0CAaC;AAED,oDAgCC;AAmBD,8BAwBC;AA4BD,4CAQC;AA/ID,kEAAmD;AAGnD,MAAM,MAAM,GAAG,IAAA,wBAAK,EAAC,0BAA0B,CAAC,CA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AS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { AuthConfiguration } from '../authConfiguration';
6
+ import { AuthProvider } from '../authProvider';
7
+ /**
8
+ * Authentication provider that delegates token acquisition to the Microsoft Entra Agent ID
9
+ * sidecar (agent container). This replaces MSAL at the connection layer, using the sidecar's
10
+ * `/AuthorizationHeaderUnauthenticated/{serviceName}` endpoint for app-only and agentic identity
11
+ * flows. The sidecar performs the full Blueprint→Instance→User chain internally; no MSAL exchange is
12
+ * performed in-process.
13
+ */
14
+ export declare class SidecarAuthProvider implements AuthProvider {
15
+ readonly connectionSettings?: AuthConfiguration;
16
+ private readonly _settings;
17
+ private readonly _httpClient;
18
+ private readonly _tokenCache;
19
+ /**
20
+ * Creates a new {@link SidecarAuthProvider}.
21
+ * @param connectionSettings The connection authentication configuration.
22
+ */
23
+ constructor(connectionSettings?: AuthConfiguration);
24
+ /**
25
+ * Acquires an app-only access token from the sidecar.
26
+ * @param scope The scope for the token.
27
+ */
28
+ getAccessToken(scope: string): Promise<string>;
29
+ /**
30
+ * Acquires an app-only access token from the sidecar.
31
+ * @param authConfig The authentication configuration. Ignored by the sidecar provider, which
32
+ * owns the credential and derives the token from its configured service name; accepted only to
33
+ * satisfy the {@link AuthProvider} overload.
34
+ * @param scope The scope for the token.
35
+ */
36
+ getAccessToken(authConfig: AuthConfiguration, scope: string): Promise<string>;
37
+ /**
38
+ * Acquires the Blueprint (agent application) token from the sidecar.
39
+ * @param tenantId The tenant ID.
40
+ * @param agentAppInstanceId The agent instance ID (from the inbound activity); maps to `AgentIdentity`.
41
+ */
42
+ getAgenticApplicationToken(tenantId: string, agentAppInstanceId: string): Promise<string>;
43
+ /**
44
+ * Acquires the autonomous agent (instance) token from the sidecar for the configured resource.
45
+ * @param tenantId The tenant ID.
46
+ * @param agentAppInstanceId The agent instance ID (from the inbound activity); maps to `AgentIdentity`.
47
+ */
48
+ getAgenticInstanceToken(tenantId: string, agentAppInstanceId: string): Promise<string>;
49
+ /**
50
+ * Acquires the agentic user token from the sidecar for the configured resource.
51
+ * @param tenantId The tenant ID.
52
+ * @param agentAppInstanceId The agent instance ID (from the inbound activity); maps to `AgentIdentity`.
53
+ * @param upn The agentic user identifier. A GUID is sent as `AgentUserId`; otherwise as `AgentUsername`.
54
+ * @param scopes The OAuth scopes to request.
55
+ */
56
+ getAgenticUserToken(tenantId: string, agentAppInstanceId: string, upn: string, scopes: string[]): Promise<string>;
57
+ /**
58
+ * On-behalf-of token exchange — not supported by the sidecar provider in Phase 1.
59
+ */
60
+ acquireTokenOnBehalfOf(scopes: string[], oboAssertion: string): Promise<string>;
61
+ acquireTokenOnBehalfOf(authConfig: AuthConfiguration, scopes: string[], oboAssertion: string): Promise<string>;
62
+ /**
63
+ * Checks sidecar availability via the `/healthz` endpoint.
64
+ * @returns `true` when the sidecar is reachable and healthy.
65
+ */
66
+ isHealthy(): Promise<boolean>;
67
+ private ensureConnectionSettings;
68
+ private getCachedToken;
69
+ private cacheGet;
70
+ private cacheSet;
71
+ private pruneExpiredEntries;
72
+ private evictNearestExpiry;
73
+ private static buildCacheKey;
74
+ }