diff --git a/libraries/botframework-connector/package.json b/libraries/botframework-connector/package.json index fb77db9772..0d582b8220 100644 --- a/libraries/botframework-connector/package.json +++ b/libraries/botframework-connector/package.json @@ -30,6 +30,7 @@ "@azure/identity": "^2.0.4", "@azure/ms-rest-js": "^2.7.0", "@azure/msal-node": "^1.2.0", + "@azure/core-http": "^3.0.2", "axios": "^0.25.0", "base64url": "^3.0.0", "botbuilder-stdlib": "4.1.6", diff --git a/libraries/botframework-connector/src/auth/tokenCredentials.ts b/libraries/botframework-connector/src/auth/tokenCredentials.ts index 8f814e3522..9614344345 100644 --- a/libraries/botframework-connector/src/auth/tokenCredentials.ts +++ b/libraries/botframework-connector/src/auth/tokenCredentials.ts @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { HttpHeaders, Constants, WebResourceLike, ServiceClientCredentials } from "@azure/core-http"; +import { HttpHeaders, Constants, WebResourceLike, ServiceClientCredentials } from '@azure/core-http'; const HeaderConstants = Constants.HeaderConstants; -const DEFAULT_AUTHORIZATION_SCHEME = "Bearer"; +const DEFAULT_AUTHORIZATION_SCHEME = 'Bearer'; /** * A credentials object that uses a token string and a authorzation scheme to authenticate. @@ -16,13 +16,13 @@ export class TokenCredentials implements ServiceClientCredentials { /** * Creates a new TokenCredentials object. * - * @constructor + * @class * @param {string} token The token. * @param {string} [authorizationScheme] The authorization scheme. */ constructor(token: string, authorizationScheme: string = DEFAULT_AUTHORIZATION_SCHEME) { if (!token) { - throw new Error("token cannot be null or undefined."); + throw new Error('token cannot be null or undefined.'); } this.token = token; this.authorizationScheme = authorizationScheme; @@ -32,14 +32,11 @@ export class TokenCredentials implements ServiceClientCredentials { * Signs a request with the Authentication header. * * @param {WebResourceLike} webResource The WebResourceLike to be signed. - * @return {Promise} The signed request object. + * @returns {Promise} The signed request object. */ signRequest(webResource: WebResourceLike) { if (!webResource.headers) webResource.headers = new HttpHeaders(); - webResource.headers.set( - HeaderConstants.AUTHORIZATION, - `${this.authorizationScheme} ${this.token}` - ); + webResource.headers.set(HeaderConstants.AUTHORIZATION, `${this.authorizationScheme} ${this.token}`); return Promise.resolve(webResource); } } diff --git a/libraries/tests.uischema b/libraries/tests.uischema index 54655146ff..9d11eb27e8 100644 --- a/libraries/tests.uischema +++ b/libraries/tests.uischema @@ -8,7 +8,8 @@ "triggers", "generator", "selector", - "schema" + "schema", + "dialogs" ], "label": "Adaptive dialog", "order": [ diff --git a/package.json b/package.json index 43e806c8af..06bfab54f9 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "**/botbuilder-azure/@azure/core-auth/@azure/core-tracing": "1.0.0-preview.9", "**/request/tough-cookie": "^4.1.3", "**/request-promise/tough-cookie": "^4.1.3", - "**/request-promise-native/tough-cookie": "^4.1.3" + "**/request-promise-native/tough-cookie": "^4.1.3", + "@azure/core-util": "1.5.0" }, "devDependencies": { "@azure/logger": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index 7ada2c0944..7f20900b87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -136,30 +136,7 @@ "@opentelemetry/api" "^0.10.2" tslib "^2.0.0" -"@azure/core-util@^1.0.0-beta.1": - version "1.0.0-beta.1" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.0.0-beta.1.tgz#2efd2c74b4b0a38180369f50fe274a3c4cd36e98" - integrity sha512-pS6cup979/qyuyNP9chIybK2qVkJ3MarbY/bx3JcGKE6An6dRweLnsfJfU2ydqUI/B51Rjnn59ajHIhCUTwWZw== - dependencies: - tslib "^2.0.0" - -"@azure/core-util@^1.1.0": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.6.1.tgz#fea221c4fa43c26543bccf799beb30c1c7878f5a" - integrity sha512-h5taHeySlsV9qxuK64KZxy4iln1BtMYlNt5jbuEFN3UFSAd1EwKg/Gjl5a6tZ/W8t6li3xPnutOx7zbDyXnPmQ== - dependencies: - "@azure/abort-controller" "^1.0.0" - tslib "^2.2.0" - -"@azure/core-util@^1.1.1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.3.2.tgz#3f8cfda1e87fac0ce84f8c1a42fcd6d2a986632d" - integrity sha512-2bECOUh88RvL1pMZTcc6OzfobBeWDBf5oBbhjIhT1MV9otMVWCzpOJkkiKtrnO88y5GGBelgY8At73KGAdbkeQ== - dependencies: - "@azure/abort-controller" "^1.0.0" - tslib "^2.2.0" - -"@azure/core-util@^1.2.0": +"@azure/core-util@1.5.0", "@azure/core-util@^1.0.0-beta.1", "@azure/core-util@^1.1.0", "@azure/core-util@^1.1.1", "@azure/core-util@^1.2.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.5.0.tgz#ffe49c3e867044da67daeb8122143fa065e1eb0e" integrity sha512-GZBpVFDtQ/15hW1OgBcRdT4Bl7AEpcEZqLfbAvOtm1CQUncKWiYapFHVD588hmlV27NbOOtSm3cnLF3lvoHi4g==