@microsoft/agents-hosting 1.4.0-beta.7.g541749904d → 1.4.2
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/dist/package.json +5 -5
- package/dist/src/app/adaptiveCards/activityValueParsers.d.ts +2 -1
- package/dist/src/app/adaptiveCards/adaptiveCardsSearchParams.d.ts +1 -0
- package/dist/src/app/adaptiveCards/adaptiveCardsSearchParams.js +1 -0
- package/dist/src/app/adaptiveCards/adaptiveCardsSearchParams.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +17 -9
- package/dist/src/app/agentApplication.js +94 -80
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/auth/authorizationManager.d.ts +7 -2
- package/dist/src/app/auth/authorizationManager.js +10 -9
- package/dist/src/app/auth/authorizationManager.js.map +1 -1
- package/dist/src/app/auth/handlers/azureBotAuthorization.d.ts +1 -1
- package/dist/src/app/auth/handlers/azureBotAuthorization.js +3 -3
- package/dist/src/app/auth/handlers/azureBotAuthorization.js.map +1 -1
- package/dist/src/app/streaming/streamingResponse.js +3 -3
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/auth/authConfiguration.d.ts +8 -0
- package/dist/src/auth/authConfiguration.js +24 -2
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/jwt-middleware.d.ts +7 -0
- package/dist/src/auth/jwt-middleware.js +14 -3
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/auth/msalConnectionManager.js +3 -2
- package/dist/src/auth/msalConnectionManager.js.map +1 -1
- package/dist/src/auth/msalTokenProvider.js +12 -19
- package/dist/src/auth/msalTokenProvider.js.map +1 -1
- package/dist/src/cloudAdapter.d.ts +4 -0
- package/dist/src/cloudAdapter.js +5 -0
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/turnContext.js +7 -1
- package/dist/src/turnContext.js.map +1 -1
- package/package.json +5 -5
- package/src/app/adaptiveCards/activityValueParsers.ts +1 -1
- package/src/app/adaptiveCards/adaptiveCardsSearchParams.ts +1 -0
- package/src/app/agentApplication.ts +97 -79
- package/src/app/auth/authorizationManager.ts +16 -11
- package/src/app/auth/handlers/azureBotAuthorization.ts +4 -4
- package/src/app/streaming/streamingResponse.ts +3 -3
- package/src/auth/authConfiguration.ts +24 -2
- package/src/auth/jwt-middleware.ts +14 -4
- package/src/auth/msalConnectionManager.ts +3 -3
- package/src/auth/msalTokenProvider.ts +11 -21
- package/src/cloudAdapter.ts +5 -0
- package/src/index.ts +1 -1
- package/src/turnContext.ts +6 -1
package/src/cloudAdapter.ts
CHANGED
|
@@ -126,6 +126,7 @@ export class CloudAdapter extends BaseAdapter {
|
|
|
126
126
|
headers?: HeaderPropagationCollection) {
|
|
127
127
|
if (!identity?.aud) {
|
|
128
128
|
// anonymous
|
|
129
|
+
logger.warn('Missing identity or identity.aud when creating connector client. Using anonymous identity')
|
|
129
130
|
return ConnectorClient.createClientWithToken(
|
|
130
131
|
activity.serviceUrl!,
|
|
131
132
|
null!,
|
|
@@ -318,6 +319,10 @@ export class CloudAdapter extends BaseAdapter {
|
|
|
318
319
|
* @param res - The response to send.
|
|
319
320
|
* @param logic - The logic to execute.
|
|
320
321
|
* @param headerPropagation - Optional function to handle header propagation.
|
|
322
|
+
*
|
|
323
|
+
* @remarks This function supports both authenticated and unauthenticated requests. When the request is not authenticated,
|
|
324
|
+
* the adapter will use anonymous identity. For authenticated requests, the adapter relies on the presence of a user identity
|
|
325
|
+
* on `request.user`. It is strongly recommended to use the `authorizeJWT` middleware to ensure that requests are correctly authenticated.
|
|
321
326
|
*/
|
|
322
327
|
public async process (
|
|
323
328
|
request: Request,
|
package/src/index.ts
CHANGED
package/src/turnContext.ts
CHANGED
|
@@ -330,7 +330,12 @@ export class TurnContext {
|
|
|
330
330
|
* @protected
|
|
331
331
|
*/
|
|
332
332
|
protected copyTo (context: TurnContext): void {
|
|
333
|
-
|
|
333
|
+
// Skip _streamingResponse: it holds a reference to the HTTP response of the original request.
|
|
334
|
+
// Copying it to a cloned context would cause the clone to write to an already-completed response.
|
|
335
|
+
const copyableProperties = Object.keys(this).filter((prop) => prop !== '_streamingResponse')
|
|
336
|
+
for (const prop of copyableProperties) {
|
|
337
|
+
;(context as any)[prop] = (this as any)[prop]
|
|
338
|
+
}
|
|
334
339
|
}
|
|
335
340
|
|
|
336
341
|
/**
|