diff --git a/sdk/security/arm-security/CHANGELOG.md b/sdk/security/arm-security/CHANGELOG.md index 18ccbd2091ee..25d8273c162f 100644 --- a/sdk/security/arm-security/CHANGELOG.md +++ b/sdk/security/arm-security/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History + +## 5.1.0-beta.1 (2022-05-19) + +**Features** -## 5.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Enum KnownSettingName has a new value WdatpUnifiedSolution + + ## 5.0.0 (2022-03-30) **Features** diff --git a/sdk/security/arm-security/_meta.json b/sdk/security/arm-security/_meta.json index c47a1003ea69..6cddabb77bcd 100644 --- a/sdk/security/arm-security/_meta.json +++ b/sdk/security/arm-security/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3c1da29166fe1306071c939ac1344b092bafd0ce", + "commit": "c30890a6a6e85f10b3c6dbfc16bdb619b61122a1", "readme": "specification/security/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\security\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/security/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", - "use": "@autorest/typescript@6.0.0-alpha.18.20220329.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/security/arm-security/package.json b/sdk/security/arm-security/package.json index 6966564a276c..ec825a608105 100644 --- a/sdk/security/arm-security/package.json +++ b/sdk/security/arm-security/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SecurityCenter.", - "version": "5.0.1", + "version": "5.1.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/security/arm-security", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-security?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/security/arm-security/review/arm-security.api.md b/sdk/security/arm-security/review/arm-security.api.md index 9cb47bc36105..addbf0ab16c6 100644 --- a/sdk/security/arm-security/review/arm-security.api.md +++ b/sdk/security/arm-security/review/arm-security.api.md @@ -2976,7 +2976,9 @@ export enum KnownSettingName { // (undocumented) Wdatp = "WDATP", // (undocumented) - WdatpExcludeLinuxPublicPreview = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" + WdatpExcludeLinuxPublicPreview = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + // (undocumented) + WdatpUnifiedSolution = "WDATP_UNIFIED_SOLUTION" } // @public diff --git a/sdk/security/arm-security/src/models/index.ts b/sdk/security/arm-security/src/models/index.ts index d1c8614ffa3d..c94f342bc84f 100644 --- a/sdk/security/arm-security/src/models/index.ts +++ b/sdk/security/arm-security/src/models/index.ts @@ -971,7 +971,7 @@ export interface SecurityAssessmentPartnerData { secret: string; } -/** Represents a list of machine groups and set of rules that are recommended by Azure Security Center to be allowed */ +/** Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed */ export interface AdaptiveApplicationControlGroups { value?: AdaptiveApplicationControlGroup[]; } @@ -1971,9 +1971,9 @@ export type ComplianceResult = Resource & { readonly resourceStatus?: ResourceStatus; }; -/** Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. */ +/** Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. */ export type Pricing = Resource & { - /** The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. */ + /** The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. */ pricingTier?: PricingTier; /** The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. */ subPlan?: string; @@ -2646,7 +2646,7 @@ export type SecuritySolutionsReferenceData = Resource & template: string; }; -/** Represents a security solution external to Azure Security Center which sends information to an OMS workspace and whose data is displayed by Azure Security Center. */ +/** Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. */ export type ExternalSecuritySolution = Resource & ExternalSecuritySolutionKindAutoGenerated & Location & {}; @@ -3147,7 +3147,7 @@ export type ServerVulnerabilityProperties = AdditionalData & { readonly vendorReferences?: VendorReference[]; }; -/** The logic app action that should be triggered. To learn more about Security Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore */ +/** The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore */ export type AutomationActionLogicApp = AutomationAction & { /** Polymorphic discriminator, which specifies the different types this object can be */ actionType: "LogicApp"; @@ -3157,7 +3157,7 @@ export type AutomationActionLogicApp = AutomationAction & { uri?: string; }; -/** The target Event Hub to which event data will be exported. To learn more about Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore */ +/** The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore */ export type AutomationActionEventHub = AutomationAction & { /** Polymorphic discriminator, which specifies the different types this object can be */ actionType: "EventHub"; @@ -3172,7 +3172,7 @@ export type AutomationActionEventHub = AutomationAction & { connectionString?: string; }; -/** The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore */ +/** The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore */ export type AutomationActionWorkspace = AutomationAction & { /** Polymorphic discriminator, which specifies the different types this object can be */ actionType: "Workspace"; @@ -3690,9 +3690,9 @@ export type ResourceStatus = string; /** Known values of {@link PricingTier} that the service accepts. */ export enum KnownPricingTier { - /** Get free Azure security center experience with basic security features */ + /** Get free Microsoft Defender for Cloud experience with basic security features */ Free = "Free", - /** Get the standard Azure security center experience with advanced security features */ + /** Get the standard Microsoft Defender for Cloud experience with advanced security features */ Standard = "Standard" } @@ -3701,8 +3701,8 @@ export enum KnownPricingTier { * {@link KnownPricingTier} can be used interchangeably with PricingTier, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Free**: Get free Azure security center experience with basic security features \ - * **Standard**: Get the standard Azure security center experience with advanced security features + * **Free**: Get free Microsoft Defender for Cloud experience with basic security features \ + * **Standard**: Get the standard Microsoft Defender for Cloud experience with advanced security features */ export type PricingTier = string; @@ -4589,11 +4589,11 @@ export type Threats = string; /** Known values of {@link AssessmentType} that the service accepts. */ export enum KnownAssessmentType { - /** Azure Security Center managed assessments */ + /** Microsoft Defender for Cloud managed assessments */ BuiltIn = "BuiltIn", - /** User defined policies that are automatically ingested from Azure Policy to Azure Security Center */ + /** User defined policies that are automatically ingested from Azure Policy to Microsoft Defender for Cloud */ CustomPolicy = "CustomPolicy", - /** User assessments pushed directly by the user or other third party to Azure Security Center */ + /** User assessments pushed directly by the user or other third party to Microsoft Defender for Cloud */ CustomerManaged = "CustomerManaged", /** An assessment that was created by a verified 3rd party if the user connected it to ASC */ VerifiedPartner = "VerifiedPartner" @@ -4604,9 +4604,9 @@ export enum KnownAssessmentType { * {@link KnownAssessmentType} can be used interchangeably with AssessmentType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **BuiltIn**: Azure Security Center managed assessments \ - * **CustomPolicy**: User defined policies that are automatically ingested from Azure Policy to Azure Security Center \ - * **CustomerManaged**: User assessments pushed directly by the user or other third party to Azure Security Center \ + * **BuiltIn**: Microsoft Defender for Cloud managed assessments \ + * **CustomPolicy**: User defined policies that are automatically ingested from Azure Policy to Microsoft Defender for Cloud \ + * **CustomerManaged**: User assessments pushed directly by the user or other third party to Microsoft Defender for Cloud \ * **VerifiedPartner**: An assessment that was created by a verified 3rd party if the user connected it to ASC */ export type AssessmentType = string; @@ -4971,9 +4971,9 @@ export type ExpandControlsEnum = string; /** Known values of {@link ControlType} that the service accepts. */ export enum KnownControlType { - /** Azure Security Center managed assessments */ + /** Microsoft Defender for Cloud managed assessments */ BuiltIn = "BuiltIn", - /** Non Azure Security Center managed assessments */ + /** Non Microsoft Defender for Cloud managed assessments */ Custom = "Custom" } @@ -4982,8 +4982,8 @@ export enum KnownControlType { * {@link KnownControlType} can be used interchangeably with ControlType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **BuiltIn**: Azure Security Center managed assessments \ - * **Custom**: Non Azure Security Center managed assessments + * **BuiltIn**: Microsoft Defender for Cloud managed assessments \ + * **Custom**: Non Microsoft Defender for Cloud managed assessments */ export type ControlType = string; @@ -5368,6 +5368,7 @@ export enum KnownSettingName { Mcas = "MCAS", Wdatp = "WDATP", WdatpExcludeLinuxPublicPreview = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + WdatpUnifiedSolution = "WDATP_UNIFIED_SOLUTION", Sentinel = "Sentinel" } @@ -5379,6 +5380,7 @@ export enum KnownSettingName { * **MCAS** \ * **WDATP** \ * **WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW** \ + * **WDATP_UNIFIED_SOLUTION** \ * **Sentinel** */ export type SettingName = string; diff --git a/sdk/security/arm-security/src/models/parameters.ts b/sdk/security/arm-security/src/models/parameters.ts index 1ca7f7480b44..0971889a2a77 100644 --- a/sdk/security/arm-security/src/models/parameters.ts +++ b/sdk/security/arm-security/src/models/parameters.ts @@ -1010,7 +1010,7 @@ export const alertSimulatorRequestBody: OperationParameter = { export const apiVersion14: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-07-01", + defaultValue: "2022-05-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/security/arm-security/src/operations/pricings.ts b/sdk/security/arm-security/src/operations/pricings.ts index a89af1e257a5..9957b4ce9fdd 100644 --- a/sdk/security/arm-security/src/operations/pricings.ts +++ b/sdk/security/arm-security/src/operations/pricings.ts @@ -34,7 +34,7 @@ export class PricingsImpl implements Pricings { } /** - * Lists Security Center pricing configurations in the subscription. + * Lists Microsoft Defender for Cloud pricing configurations in the subscription. * @param options The options parameters. */ list(options?: PricingsListOptionalParams): Promise { @@ -42,7 +42,7 @@ export class PricingsImpl implements Pricings { } /** - * Gets a provided Security Center pricing configuration in the subscription. + * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. * @param pricingName name of the pricing configuration * @param options The options parameters. */ @@ -57,7 +57,7 @@ export class PricingsImpl implements Pricings { } /** - * Updates a provided Security Center pricing configuration in the subscription. + * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. * @param pricingName name of the pricing configuration * @param pricing Pricing object * @param options The options parameters. diff --git a/sdk/security/arm-security/src/operations/secureScores.ts b/sdk/security/arm-security/src/operations/secureScores.ts index bd34e4e27c61..017754ad8b3d 100644 --- a/sdk/security/arm-security/src/operations/secureScores.ts +++ b/sdk/security/arm-security/src/operations/secureScores.ts @@ -36,7 +36,7 @@ export class SecureScoresImpl implements SecureScores { } /** - * List secure scores for all your Security Center initiatives within your current scope. + * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. * @param options The options parameters. */ public list( @@ -78,7 +78,7 @@ export class SecureScoresImpl implements SecureScores { } /** - * List secure scores for all your Security Center initiatives within your current scope. + * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. * @param options The options parameters. */ private _list( @@ -88,8 +88,8 @@ export class SecureScoresImpl implements SecureScores { } /** - * Get secure score for a specific Security Center initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. + * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. + * For the ASC Default initiative, use 'ascScore'. * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the * sample request below. * @param options The options parameters. diff --git a/sdk/security/arm-security/src/operations/settings.ts b/sdk/security/arm-security/src/operations/settings.ts index 710b095ffea5..05fac13160e0 100644 --- a/sdk/security/arm-security/src/operations/settings.ts +++ b/sdk/security/arm-security/src/operations/settings.ts @@ -39,7 +39,7 @@ export class SettingsImpl implements Settings { } /** - * Settings about different configurations in security center + * Settings about different configurations in Microsoft Defender for Cloud * @param options The options parameters. */ public list( @@ -81,7 +81,7 @@ export class SettingsImpl implements Settings { } /** - * Settings about different configurations in security center + * Settings about different configurations in Microsoft Defender for Cloud * @param options The options parameters. */ private _list( @@ -91,7 +91,7 @@ export class SettingsImpl implements Settings { } /** - * Settings of different configurations in security center + * Settings of different configurations in Microsoft Defender for Cloud * @param settingName The name of the setting * @param options The options parameters. */ @@ -106,7 +106,7 @@ export class SettingsImpl implements Settings { } /** - * updating settings about different configurations in security center + * updating settings about different configurations in Microsoft Defender for Cloud * @param settingName The name of the setting * @param setting Setting object * @param options The options parameters. diff --git a/sdk/security/arm-security/src/operationsInterfaces/pricings.ts b/sdk/security/arm-security/src/operationsInterfaces/pricings.ts index 913551099d5a..14dc0160e6ed 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/pricings.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/pricings.ts @@ -19,12 +19,12 @@ import { /** Interface representing a Pricings. */ export interface Pricings { /** - * Lists Security Center pricing configurations in the subscription. + * Lists Microsoft Defender for Cloud pricing configurations in the subscription. * @param options The options parameters. */ list(options?: PricingsListOptionalParams): Promise; /** - * Gets a provided Security Center pricing configuration in the subscription. + * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. * @param pricingName name of the pricing configuration * @param options The options parameters. */ @@ -33,7 +33,7 @@ export interface Pricings { options?: PricingsGetOptionalParams ): Promise; /** - * Updates a provided Security Center pricing configuration in the subscription. + * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. * @param pricingName name of the pricing configuration * @param pricing Pricing object * @param options The options parameters. diff --git a/sdk/security/arm-security/src/operationsInterfaces/secureScores.ts b/sdk/security/arm-security/src/operationsInterfaces/secureScores.ts index a7a0e56cfed2..316216383ab6 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/secureScores.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/secureScores.ts @@ -18,15 +18,15 @@ import { /** Interface representing a SecureScores. */ export interface SecureScores { /** - * List secure scores for all your Security Center initiatives within your current scope. + * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. * @param options The options parameters. */ list( options?: SecureScoresListOptionalParams ): PagedAsyncIterableIterator; /** - * Get secure score for a specific Security Center initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. + * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. + * For the ASC Default initiative, use 'ascScore'. * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the * sample request below. * @param options The options parameters. diff --git a/sdk/security/arm-security/src/operationsInterfaces/settings.ts b/sdk/security/arm-security/src/operationsInterfaces/settings.ts index 28c3ca38bfce..2d2a5bbb1773 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/settings.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/settings.ts @@ -21,14 +21,14 @@ import { /** Interface representing a Settings. */ export interface Settings { /** - * Settings about different configurations in security center + * Settings about different configurations in Microsoft Defender for Cloud * @param options The options parameters. */ list( options?: SettingsListOptionalParams ): PagedAsyncIterableIterator; /** - * Settings of different configurations in security center + * Settings of different configurations in Microsoft Defender for Cloud * @param settingName The name of the setting * @param options The options parameters. */ @@ -37,7 +37,7 @@ export interface Settings { options?: SettingsGetOptionalParams ): Promise; /** - * updating settings about different configurations in security center + * updating settings about different configurations in Microsoft Defender for Cloud * @param settingName The name of the setting * @param setting Setting object * @param options The options parameters. diff --git a/sdk/security/arm-security/src/securityCenter.ts b/sdk/security/arm-security/src/securityCenter.ts index 3967c4a6e986..b5647d3df46a 100644 --- a/sdk/security/arm-security/src/securityCenter.ts +++ b/sdk/security/arm-security/src/securityCenter.ts @@ -7,6 +7,7 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { MdeOnboardingsImpl, @@ -143,7 +144,7 @@ export class SecurityCenter extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-security/5.0.1`; + const packageDetails = `azsdk-js-arm-security/5.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -162,6 +163,29 @@ export class SecurityCenter extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + } // Parameter assignments this.subscriptionId = subscriptionId; diff --git a/sdk/security/arm-security/test/sampleTest.ts b/sdk/security/arm-security/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/security/arm-security/test/sampleTest.ts +++ b/sdk/security/arm-security/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/security/arm-security/tsconfig.json b/sdk/security/arm-security/tsconfig.json index 3f5144384125..3e6ae96443f3 100644 --- a/sdk/security/arm-security/tsconfig.json +++ b/sdk/security/arm-security/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-security": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"