From 3887399947fdde69583b53405846af83e9003531 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Wed, 23 Sep 2020 00:05:05 -0700 Subject: [PATCH 01/10] Extend tsconfig in cosmos, identity from base config --- sdk/cosmosdb/cosmos/tsconfig.json | 14 ++----- sdk/identity/identity/tsconfig.json | 58 ++++------------------------- 2 files changed, 11 insertions(+), 61 deletions(-) diff --git a/sdk/cosmosdb/cosmos/tsconfig.json b/sdk/cosmosdb/cosmos/tsconfig.json index ac0425d109e9..d57433339043 100644 --- a/sdk/cosmosdb/cosmos/tsconfig.json +++ b/sdk/cosmosdb/cosmos/tsconfig.json @@ -1,24 +1,18 @@ { + "extends": "../../../tsconfig.package", "compilerOptions": { - "declaration": true, - "declarationMap": true, "module": "esnext", - "moduleResolution": "node", - "importHelpers": true, + "strict": false, "noImplicitAny": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, + "noImplicitReturns": false, + "noFallthroughCasesInSwitch": false, "outDir": "dist-esm", "preserveConstEnums": true, "removeComments": false, "target": "es6", - "sourceMap": true, - "inlineSources": true, "newLine": "LF", "resolveJsonModule": true, "composite": true, - "noUnusedLocals": true, - "noUnusedParameters": true, "stripInternal": true, "rootDir": "src" }, diff --git a/sdk/identity/identity/tsconfig.json b/sdk/identity/identity/tsconfig.json index 37081195b9c1..b4b1163d62db 100644 --- a/sdk/identity/identity/tsconfig.json +++ b/sdk/identity/identity/tsconfig.json @@ -1,58 +1,14 @@ { + "extends": "../../../tsconfig.package", "compilerOptions": { - /* Basic Options */ - "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, - "module": "es6" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true /* Generates corresponding '.d.ts' file. */, - "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "target": "es6", + "lib": ["DOM"], "declarationDir": "./types", - "sourceMap": true /* Generates corresponding '.map' file. */, - "inlineSources": true, - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist-esm" /* Redirect output structure to the directory. */, - // "rootDir": "." /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, - // "composite": true, /* Enable project compilation */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - "importHelpers": true /* Import emit helpers from 'tslib'. */, - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ - "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [] /* List of root folders whose combined content represents the structure of the project at runtime. */, - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + "outDir": "./dist-esm", "resolveJsonModule": true, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "forceConsistentCasingInFileNames": true + "noUnusedLocals": false, + "noUnusedParameters": false, + "noImplicitReturns": false }, "include": ["src/**/*", "test/**/*"], "exclude": ["test/manual*/**/*", "node_modules"] From 432ba014c70482a5b4a9bac0d5c4b59594530399 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Thu, 24 Sep 2020 14:52:10 +0800 Subject: [PATCH 02/10] identity noImplicitReturns tslint fixes --- sdk/identity/identity/test/internal/identityClient.spec.ts | 2 ++ sdk/identity/identity/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/identity/identity/test/internal/identityClient.spec.ts b/sdk/identity/identity/test/internal/identityClient.spec.ts index cde857eb8026..afb485016885 100644 --- a/sdk/identity/identity/test/internal/identityClient.spec.ts +++ b/sdk/identity/identity/test/internal/identityClient.spec.ts @@ -105,6 +105,8 @@ describe("IdentityClient", function() { assert(new IdentityClient({ authorityHost: "https://correct.url" })); delete process.env.AZURE_AUTHORITY_HOST; + + return; }); it("returns a usable error when the authentication response doesn't contain a body", async () => { diff --git a/sdk/identity/identity/tsconfig.json b/sdk/identity/identity/tsconfig.json index b4b1163d62db..8edc5cc101eb 100644 --- a/sdk/identity/identity/tsconfig.json +++ b/sdk/identity/identity/tsconfig.json @@ -8,7 +8,7 @@ "resolveJsonModule": true, "noUnusedLocals": false, "noUnusedParameters": false, - "noImplicitReturns": false + "noImplicitReturns": true }, "include": ["src/**/*", "test/**/*"], "exclude": ["test/manual*/**/*", "node_modules"] From 6dd2c863955c893ea8b9aedca450d0e47173a219 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Thu, 24 Sep 2020 15:14:24 +0800 Subject: [PATCH 03/10] identity noUnusedParameters tslint fixes --- sdk/identity/identity/review/identity.api.md | 4 ++-- .../authorizationCodeCredential.browser.ts | 14 ++------------ .../src/credentials/azureCliCredential.browser.ts | 4 ++-- .../identity/src/credentials/azureCliCredential.ts | 2 +- .../clientCertificateCredential.browser.ts | 12 ++---------- .../credentials/deviceCodeCredential.browser.ts | 12 ++---------- .../credentials/environmentCredential.browser.ts | 4 ++-- .../credentials/interactiveBrowserCredential.ts | 5 +---- .../managedIdentityCredential.browser.ts | 10 ++-------- .../visualStudioCodeCredential.browser.ts | 7 ++----- .../src/credentials/visualStudioCodeCredential.ts | 5 +---- sdk/identity/identity/tsconfig.json | 2 +- 12 files changed, 20 insertions(+), 61 deletions(-) diff --git a/sdk/identity/identity/review/identity.api.md b/sdk/identity/identity/review/identity.api.md index 8acaeb7b504c..7c623c338a25 100644 --- a/sdk/identity/identity/review/identity.api.md +++ b/sdk/identity/identity/review/identity.api.md @@ -134,7 +134,7 @@ export { GetTokenOptions } // @public export class InteractiveBrowserCredential implements TokenCredential { constructor(options?: InteractiveBrowserCredentialOptions); - getToken(scopes: string | string[], options?: GetTokenOptions): Promise; + getToken(scopes: string | string[]): Promise; } // @public @@ -172,7 +172,7 @@ export class UsernamePasswordCredential implements TokenCredential { // @public export class VisualStudioCodeCredential implements TokenCredential { constructor(options?: VisualStudioCodeCredentialOptions); - getToken(scopes: string | string[], options?: GetTokenOptions): Promise; + getToken(scopes: string | string[]): Promise; } // @public diff --git a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts index db071506261a..6cf5e8af8313 100644 --- a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts @@ -28,22 +28,12 @@ export class AuthorizationCodeCredential implements TokenCredential { redirectUri: string, options?: TokenCredentialOptions ); - constructor( - tenantId: string | "common", - clientId: string, - clientSecretOrAuthorizationCode: string, - authorizationCodeOrRedirectUri: string, - redirectUriOrOptions: string | TokenCredentialOptions | undefined, - options?: TokenCredentialOptions - ) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - public getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts index 26846879d885..0f44493029fe 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts @@ -11,12 +11,12 @@ const BrowserNotSupportedError = new Error("AzureCliCredential is not supported const logger = credentialLogger("AzureCliCredential"); export class AzureCliCredential implements TokenCredential { - constructor(options?: TokenCredentialOptions) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.ts b/sdk/identity/identity/src/credentials/azureCliCredential.ts index 9414fe2028a2..fc84a7e1c05f 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.ts @@ -41,7 +41,7 @@ export class AzureCliCredential implements TokenCredential { `az account get-access-token --output json --resource ${resource}`, { cwd: getSafeWorkingDir() }, (error, stdout, stderr) => { - resolve({ stdout: stdout, stderr: stderr }); + resolve({ stdout: stdout, stderr: stderr, error }); } ); } catch (err) { diff --git a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts index 45ade7b02d53..133c06ede26e 100644 --- a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts @@ -13,20 +13,12 @@ const BrowserNotSupportedError = new Error( const logger = credentialLogger("ClientCertificateCredential"); export class ClientCertificateCredential implements TokenCredential { - constructor( - tenantId: string, - clientId: string, - certificatePath: string, - options?: TokenCredentialOptions - ) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - public getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts index eefb62c8556a..6b535bc708b5 100644 --- a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts @@ -12,20 +12,12 @@ const BrowserNotSupportedError = new Error("DeviceCodeCredential is not supporte const logger = credentialLogger("DeviceCodeCredential"); export class DeviceCodeCredential implements TokenCredential { - constructor( - tenantId: string | "organizations", - clientId: string, - userPromptCallback: DeviceCodePromptCallback, - options?: TokenCredentialOptions - ) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - public getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts index 4480d5096a54..1b63957c3003 100644 --- a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts @@ -13,12 +13,12 @@ const BrowserNotSupportedError = new Error( const logger = credentialLogger("EnvironmentCredential"); export class EnvironmentCredential implements TokenCredential { - constructor(options?: TokenCredentialOptions) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts index 66b284e49e85..f6accc225a80 100644 --- a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts +++ b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts @@ -98,10 +98,7 @@ export class InteractiveBrowserCredential implements TokenCredential { * @param options The options used to configure any requests this * TokenCredential implementation might make. */ - public getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public getToken(scopes: string | string[]): Promise { const scopeArray = typeof scopes === "object" ? scopes : [scopes]; return this.acquireTokenFromBrowser(scopeArray); diff --git a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts index cf2a0bf1d5b2..458bbc6671da 100644 --- a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts @@ -15,18 +15,12 @@ const logger = credentialLogger("ManagedIdentityCredential"); export class ManagedIdentityCredential implements TokenCredential { constructor(clientId: string, options?: TokenCredentialOptions); constructor(options?: TokenCredentialOptions); - constructor( - clientIdOrOptions: string | TokenCredentialOptions | undefined, - options?: TokenCredentialOptions - ) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - public async getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public async getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts index bcca54b30ab3..9c6d151088df 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts @@ -13,15 +13,12 @@ const BrowserNotSupportedError = new Error( const logger = credentialLogger("VisualStudioCodeCredential"); export class VisualStudioCodeCredential implements TokenCredential { - constructor(options?: TokenCredentialOptions) { + constructor() { logger.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } - public getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public getToken(): Promise { logger.getToken.info(formatError(BrowserNotSupportedError)); throw BrowserNotSupportedError; } diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts index 27d29816b953..0f240d1d744a 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts @@ -140,10 +140,7 @@ export class VisualStudioCodeCredential implements TokenCredential { * @param options The options used to configure any requests this * `TokenCredential` implementation might make. */ - public async getToken( - scopes: string | string[], - options?: GetTokenOptions - ): Promise { + public async getToken(scopes: string | string[]): Promise { await this.prepareOnce(); if (!keytar) { throw new CredentialUnavailable( diff --git a/sdk/identity/identity/tsconfig.json b/sdk/identity/identity/tsconfig.json index 8edc5cc101eb..6e19b898013f 100644 --- a/sdk/identity/identity/tsconfig.json +++ b/sdk/identity/identity/tsconfig.json @@ -7,7 +7,7 @@ "outDir": "./dist-esm", "resolveJsonModule": true, "noUnusedLocals": false, - "noUnusedParameters": false, + "noUnusedParameters": true, "noImplicitReturns": true }, "include": ["src/**/*", "test/**/*"], From f8fb6a8cc6eb656af9f33b6cbd3947aa6f0454d8 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Thu, 24 Sep 2020 15:59:28 +0800 Subject: [PATCH 04/10] identity noUnusedLocals tslint fixes --- .../authorizationCodeCredential.browser.ts | 2 +- .../credentials/azureCliCredential.browser.ts | 3 +-- .../clientCertificateCredential.browser.ts | 3 +-- .../deviceCodeCredential.browser.ts | 4 +--- .../src/credentials/deviceCodeCredential.ts | 12 +++++------ .../environmentCredential.browser.ts | 3 +-- .../interactiveBrowserCredential.ts | 21 ++----------------- .../managedIdentityCredential.browser.ts | 2 +- .../visualStudioCodeCredential.browser.ts | 3 +-- .../credentials/visualStudioCodeCredential.ts | 2 +- sdk/identity/identity/tsconfig.json | 2 +- 11 files changed, 16 insertions(+), 41 deletions(-) diff --git a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts index 6cf5e8af8313..f73b5f686340 100644 --- a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { TokenCredentialOptions } from "../client/identityClient"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts index 0f44493029fe..2690fd20beb4 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts @@ -3,8 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { AccessToken, TokenCredential, GetTokenOptions } from "@azure/core-http"; -import { TokenCredentialOptions } from "../client/identityClient"; +import { AccessToken, TokenCredential } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; const BrowserNotSupportedError = new Error("AzureCliCredential is not supported in the browser."); diff --git a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts index 133c06ede26e..dca922615bb0 100644 --- a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts @@ -3,8 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { TokenCredentialOptions } from "../client/identityClient"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; const BrowserNotSupportedError = new Error( diff --git a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts index 6b535bc708b5..f380b6605b16 100644 --- a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts @@ -3,9 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { DeviceCodePromptCallback } from "./deviceCodeCredential"; -import { TokenCredentialOptions } from "../client/identityClient"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; const BrowserNotSupportedError = new Error("DeviceCodeCredential is not supported in the browser."); diff --git a/sdk/identity/identity/src/credentials/deviceCodeCredential.ts b/sdk/identity/identity/src/credentials/deviceCodeCredential.ts index ef6520f4a4a3..5bb0efc12931 100644 --- a/sdk/identity/identity/src/credentials/deviceCodeCredential.ts +++ b/sdk/identity/identity/src/credentials/deviceCodeCredential.ts @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AccessToken, TokenCredential, GetTokenOptions, delay } from "@azure/core-http"; -import { TokenCredentialOptions, IdentityClient } from "../client/identityClient"; +import { AccessToken, TokenCredential, GetTokenOptions } from "@azure/core-http"; +import { TokenCredentialOptions } from "../client/identityClient"; import { createSpan } from "../util/tracing"; -import { credentialLogger, formatSuccess } from "../util/logging"; -import { AuthenticationError, AuthenticationErrorName } from "../client/errors"; +import { credentialLogger } from "../util/logging"; +import { AuthenticationErrorName } from "../client/errors"; import { CanonicalCode } from "@opentelemetry/api"; import { PublicClientApplication, DeviceCodeRequest } from "@azure/msal-node"; @@ -55,7 +55,6 @@ export function defaultDeviceCodePromptCallback(deviceCodeInfo: DeviceCodeInfo): * that the user can enter into https://microsoft.com/devicelogin. */ export class DeviceCodeCredential implements TokenCredential { - private identityClient: IdentityClient; private pca: PublicClientApplication; private tenantId: string; private clientId: string; @@ -79,7 +78,6 @@ export class DeviceCodeCredential implements TokenCredential { userPromptCallback: DeviceCodePromptCallback = defaultDeviceCodePromptCallback, options?: TokenCredentialOptions ) { - this.identityClient = new IdentityClient(options); this.tenantId = tenantId; this.clientId = clientId; this.userPromptCallback = userPromptCallback; @@ -117,7 +115,7 @@ export class DeviceCodeCredential implements TokenCredential { * TokenCredential implementation might make. */ getToken(scopes: string | string[], options?: GetTokenOptions): Promise { - const { span, options: newOptions } = createSpan("DeviceCodeCredential-getToken", options); + const { span } = createSpan("DeviceCodeCredential-getToken", options); const scopeArray = typeof scopes === "object" ? scopes : [scopes]; diff --git a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts index 1b63957c3003..b252c44e9afc 100644 --- a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts @@ -3,8 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { AccessToken, TokenCredential, GetTokenOptions } from "@azure/core-http"; -import { TokenCredentialOptions } from "../client/identityClient"; +import { AccessToken, TokenCredential } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; const BrowserNotSupportedError = new Error( diff --git a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts index f6accc225a80..76f98e420601 100644 --- a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts +++ b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts @@ -3,10 +3,9 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { InteractiveBrowserCredentialOptions } from "./interactiveBrowserCredentialOptions"; -import { credentialLogger, formatError } from "../util/logging"; -import { TokenCredentialOptions, IdentityClient } from "../client/identityClient"; +import { credentialLogger } from "../util/logging"; import { DefaultTenantId, DeveloperSignOnClientId } from "../constants"; import { Socket } from "net"; @@ -15,29 +14,16 @@ const SERVER_PORT = process.env.PORT || 80; import express from "express"; import { PublicClientApplication, TokenCache, AuthorizationCodeRequest } from "@azure/msal-node"; import open from "open"; -import path from "path"; import http from "http"; -const BrowserNotSupportedError = new Error( - "InteractiveBrowserCredential is not supported in Node.js." -); const logger = credentialLogger("InteractiveBrowserCredential"); -interface AuthenticationRecord { - authority?: string; - homeAccountId: string; - environment: string; - tenantId: string; - username: string; -} - /** * Enables authentication to Azure Active Directory inside of the web browser * using the interactive login flow, either via browser redirects or a popup * window. This credential is not currently supported in Node.js. */ export class InteractiveBrowserCredential implements TokenCredential { - private identityClient: IdentityClient; private pca: PublicClientApplication; private msalCacheManager: TokenCache; private tenantId: string; @@ -45,16 +31,13 @@ export class InteractiveBrowserCredential implements TokenCredential { private persistenceEnabled: boolean; private redirectUri: string; private authorityHost: string; - private authenticationRecord: AuthenticationRecord | undefined; constructor(options?: InteractiveBrowserCredentialOptions) { - this.identityClient = new IdentityClient(options); this.tenantId = (options && options.tenantId) || DefaultTenantId; this.clientId = (options && options.clientId) || DeveloperSignOnClientId; // Future update: this is for persistent caching this.persistenceEnabled = false; - this.authenticationRecord = undefined; if (options && options.redirectUri) { if (typeof options.redirectUri === "string") { diff --git a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts index 458bbc6671da..f42856ac0c4a 100644 --- a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-http"; +import { AccessToken, TokenCredential } from "@azure/core-http"; import { TokenCredentialOptions } from "../client/identityClient"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts index 9c6d151088df..77840e30a279 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts @@ -3,8 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { TokenCredentialOptions } from "../client/identityClient"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; const BrowserNotSupportedError = new Error( diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts index 0f240d1d744a..9401131be397 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; +import { TokenCredential, AccessToken } from "@azure/core-http"; import { TokenCredentialOptions, IdentityClient } from "../client/identityClient"; import fs from "fs"; import os from "os"; diff --git a/sdk/identity/identity/tsconfig.json b/sdk/identity/identity/tsconfig.json index 6e19b898013f..dcb1741a3708 100644 --- a/sdk/identity/identity/tsconfig.json +++ b/sdk/identity/identity/tsconfig.json @@ -6,7 +6,7 @@ "declarationDir": "./types", "outDir": "./dist-esm", "resolveJsonModule": true, - "noUnusedLocals": false, + "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true }, From 17eacfbccf9fb2482bbdba7f3141d4160f5d1778 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 02:04:12 +0800 Subject: [PATCH 05/10] Restore options param to getToken method --- sdk/identity/identity/review/identity.api.md | 2 +- .../src/credentials/interactiveBrowserCredential.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/identity/identity/review/identity.api.md b/sdk/identity/identity/review/identity.api.md index 7c623c338a25..797ee1e7d980 100644 --- a/sdk/identity/identity/review/identity.api.md +++ b/sdk/identity/identity/review/identity.api.md @@ -134,7 +134,7 @@ export { GetTokenOptions } // @public export class InteractiveBrowserCredential implements TokenCredential { constructor(options?: InteractiveBrowserCredentialOptions); - getToken(scopes: string | string[]): Promise; + getToken(scopes: string | string[], options?: GetTokenOptions): Promise; } // @public diff --git a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts index 76f98e420601..e9f3563c8e74 100644 --- a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts +++ b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, AccessToken } from "@azure/core-http"; +import { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-http"; import { InteractiveBrowserCredentialOptions } from "./interactiveBrowserCredentialOptions"; import { credentialLogger } from "../util/logging"; import { DefaultTenantId, DeveloperSignOnClientId } from "../constants"; @@ -81,7 +81,11 @@ export class InteractiveBrowserCredential implements TokenCredential { * @param options The options used to configure any requests this * TokenCredential implementation might make. */ - public getToken(scopes: string | string[]): Promise { + public getToken( + scopes: string | string[], + //@ts-ignore + options?: GetTokenOptions + ): Promise { const scopeArray = typeof scopes === "object" ? scopes : [scopes]; return this.acquireTokenFromBrowser(scopeArray); From 5a08123814d3bbc4c694477fb6faa690c6e96ed6 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 03:30:51 +0800 Subject: [PATCH 06/10] Use _options param in getToken method --- sdk/identity/identity/review/identity.api.md | 2 +- sdk/identity/identity/src/credentials/azureCliCredential.ts | 2 +- .../src/credentials/interactiveBrowserCredential.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/identity/identity/review/identity.api.md b/sdk/identity/identity/review/identity.api.md index 797ee1e7d980..7257f9f4d72e 100644 --- a/sdk/identity/identity/review/identity.api.md +++ b/sdk/identity/identity/review/identity.api.md @@ -134,7 +134,7 @@ export { GetTokenOptions } // @public export class InteractiveBrowserCredential implements TokenCredential { constructor(options?: InteractiveBrowserCredentialOptions); - getToken(scopes: string | string[], options?: GetTokenOptions): Promise; + getToken(scopes: string | string[], _options?: GetTokenOptions): Promise; } // @public diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.ts b/sdk/identity/identity/src/credentials/azureCliCredential.ts index fc84a7e1c05f..5471fa9f8b52 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.ts @@ -34,7 +34,7 @@ export class AzureCliCredential implements TokenCredential { * Gets the access token from Azure CLI * @param resource The resource to use when getting the token */ - protected async getAzureCliAccessToken(resource: string) { + protected async getAzureCliAccessToken(resource: string): Promise { return new Promise((resolve, reject) => { try { child_process.exec( diff --git a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts index e9f3563c8e74..b2ebb3c4e3e3 100644 --- a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts +++ b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts @@ -83,8 +83,7 @@ export class InteractiveBrowserCredential implements TokenCredential { */ public getToken( scopes: string | string[], - //@ts-ignore - options?: GetTokenOptions + _options?: GetTokenOptions ): Promise { const scopeArray = typeof scopes === "object" ? scopes : [scopes]; @@ -108,13 +107,14 @@ export class InteractiveBrowserCredential implements TokenCredential { let listen: http.Server | undefined; let socketToDestroy: Socket | undefined; - function cleanup() { + function cleanup(): void { if (listen) { listen.close(); } if (socketToDestroy) { socketToDestroy.destroy(); } + return; } // Create Express App and Routes From 84d7f75c9e1e60596d3aee056f90358b98f9a99d Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 11:37:25 +0800 Subject: [PATCH 07/10] Restore options param for getToken method --- sdk/identity/identity/review/identity.api.md | 2 +- .../identity/src/credentials/visualStudioCodeCredential.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/identity/identity/review/identity.api.md b/sdk/identity/identity/review/identity.api.md index 7257f9f4d72e..57ad0c12e570 100644 --- a/sdk/identity/identity/review/identity.api.md +++ b/sdk/identity/identity/review/identity.api.md @@ -172,7 +172,7 @@ export class UsernamePasswordCredential implements TokenCredential { // @public export class VisualStudioCodeCredential implements TokenCredential { constructor(options?: VisualStudioCodeCredentialOptions); - getToken(scopes: string | string[]): Promise; + getToken(scopes: string | string[], _options?: GetTokenOptions): Promise; } // @public diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts index 9401131be397..4edfb1f12778 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TokenCredential, AccessToken } from "@azure/core-http"; +import { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-http"; import { TokenCredentialOptions, IdentityClient } from "../client/identityClient"; import fs from "fs"; import os from "os"; @@ -140,7 +140,10 @@ export class VisualStudioCodeCredential implements TokenCredential { * @param options The options used to configure any requests this * `TokenCredential` implementation might make. */ - public async getToken(scopes: string | string[]): Promise { + public async getToken( + scopes: string | string[], + _options?: GetTokenOptions + ): Promise { await this.prepareOnce(); if (!keytar) { throw new CredentialUnavailable( From fbc0688402c9fe73a5109dc7b0f5ff77d613af87 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 22:52:15 +0800 Subject: [PATCH 08/10] Removed redundant compilerOptions --- sdk/identity/identity/tsconfig.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/identity/identity/tsconfig.json b/sdk/identity/identity/tsconfig.json index dcb1741a3708..a7b400342680 100644 --- a/sdk/identity/identity/tsconfig.json +++ b/sdk/identity/identity/tsconfig.json @@ -5,10 +5,7 @@ "lib": ["DOM"], "declarationDir": "./types", "outDir": "./dist-esm", - "resolveJsonModule": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true + "resolveJsonModule": true }, "include": ["src/**/*", "test/**/*"], "exclude": ["test/manual*/**/*", "node_modules"] From 1c576275c03ea07a2a0db66b43e276482d29083a Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 22:57:17 +0800 Subject: [PATCH 09/10] update getAzureCliAccessToken return type --- sdk/identity/identity/review/identity.api.md | 6 +++++- sdk/identity/identity/src/credentials/azureCliCredential.ts | 4 +++- sdk/identity/identity/test/mockAzureCliCredentialClient.ts | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sdk/identity/identity/review/identity.api.md b/sdk/identity/identity/review/identity.api.md index 57ad0c12e570..5e46d43d5c36 100644 --- a/sdk/identity/identity/review/identity.api.md +++ b/sdk/identity/identity/review/identity.api.md @@ -48,7 +48,11 @@ export enum AzureAuthorityHosts { // @public export class AzureCliCredential implements TokenCredential { - protected getAzureCliAccessToken(resource: string): Promise; + protected getAzureCliAccessToken(resource: string): Promise<{ + stdout: string; + stderr: string; + error: Error | null; + }>; getToken(scopes: string | string[], options?: GetTokenOptions): Promise; } diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.ts b/sdk/identity/identity/src/credentials/azureCliCredential.ts index 5471fa9f8b52..fbd8d8b2d2ed 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.ts @@ -34,7 +34,9 @@ export class AzureCliCredential implements TokenCredential { * Gets the access token from Azure CLI * @param resource The resource to use when getting the token */ - protected async getAzureCliAccessToken(resource: string): Promise { + protected async getAzureCliAccessToken( + resource: string + ): Promise<{ stdout: string; stderr: string; error: Error | null }> { return new Promise((resolve, reject) => { try { child_process.exec( diff --git a/sdk/identity/identity/test/mockAzureCliCredentialClient.ts b/sdk/identity/identity/test/mockAzureCliCredentialClient.ts index fe349e50fd5d..222b378ca5bb 100644 --- a/sdk/identity/identity/test/mockAzureCliCredentialClient.ts +++ b/sdk/identity/identity/test/mockAzureCliCredentialClient.ts @@ -24,9 +24,11 @@ export class MockAzureCliCredentialClient extends AzureCliCredential { * command. * @param resource The resources to use when accessing token */ - protected getAzureCliAccessToken(_resource: string): Promise<{ stdout: string; stderr: string }> { + protected getAzureCliAccessToken( + _resource: string + ): Promise<{ stdout: string; stderr: string; error: Error | null }> { return new Promise((resolve) => { - resolve({ stdout: this.stdout, stderr: this.stderr }); + resolve({ stdout: this.stdout, stderr: this.stderr, error: null }); }); } } From 18f18b64b5d1c70388143570d4cd2328d1b19b41 Mon Sep 17 00:00:00 2001 From: Mohsin Mehmood Date: Fri, 25 Sep 2020 23:05:51 +0800 Subject: [PATCH 10/10] Remove eslint-disable no-unused-vars comment --- .../src/credentials/authorizationCodeCredential.browser.ts | 2 -- .../identity/src/credentials/azureCliCredential.browser.ts | 2 -- .../src/credentials/clientCertificateCredential.browser.ts | 2 -- .../identity/src/credentials/deviceCodeCredential.browser.ts | 2 -- .../identity/src/credentials/environmentCredential.browser.ts | 2 -- .../identity/src/credentials/interactiveBrowserCredential.ts | 2 -- .../src/credentials/managedIdentityCredential.browser.ts | 2 -- .../src/credentials/visualStudioCodeCredential.browser.ts | 2 -- .../identity/src/credentials/visualStudioCodeCredential.ts | 2 -- 9 files changed, 18 deletions(-) diff --git a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts index f73b5f686340..a15d10568e4a 100644 --- a/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/authorizationCodeCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken } from "@azure/core-http"; import { TokenCredentialOptions } from "../client/identityClient"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts index 2690fd20beb4..0392517e365e 100644 --- a/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/azureCliCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { AccessToken, TokenCredential } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts index dca922615bb0..1bfaaab5a8be 100644 --- a/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/clientCertificateCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts index f380b6605b16..0b7ff7f9b716 100644 --- a/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/deviceCodeCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts index b252c44e9afc..fef81c8658f1 100644 --- a/sdk/identity/identity/src/credentials/environmentCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/environmentCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { AccessToken, TokenCredential } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts index b2ebb3c4e3e3..91c8389d81e4 100644 --- a/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts +++ b/sdk/identity/identity/src/credentials/interactiveBrowserCredential.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-http"; import { InteractiveBrowserCredentialOptions } from "./interactiveBrowserCredentialOptions"; import { credentialLogger } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts index f42856ac0c4a..30d82e0dc79a 100644 --- a/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/managedIdentityCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { AccessToken, TokenCredential } from "@azure/core-http"; import { TokenCredentialOptions } from "../client/identityClient"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts index 77840e30a279..9cb4b1315a21 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken } from "@azure/core-http"; import { credentialLogger, formatError } from "../util/logging"; diff --git a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts index 4edfb1f12778..2891ba16d653 100644 --- a/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts +++ b/sdk/identity/identity/src/credentials/visualStudioCodeCredential.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars */ - import { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-http"; import { TokenCredentialOptions, IdentityClient } from "../client/identityClient"; import fs from "fs";