Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions sdk/policyinsights/arm-policyinsights/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# Release History

## 6.0.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 6.0.0-beta.1 (2022-03-31)

## 6.0.0-beta.2 (2022-09-30)

**Features**

- Added operation PolicyRestrictions.checkAtManagementGroupScope
- Added Interface Attestation
- Added Interface CheckManagementGroupRestrictionsRequest
- Added Interface PolicyMetadataProperties
- Added Interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams
- Added Type Alias PolicyEventsResourceType
- Added Type Alias PolicyRestrictionsCheckAtManagementGroupScopeResponse
Expand Down
2 changes: 1 addition & 1 deletion sdk/policyinsights/arm-policyinsights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
Expand Down
8 changes: 4 additions & 4 deletions sdk/policyinsights/arm-policyinsights/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "3c1da29166fe1306071c939ac1344b092bafd0ce",
"commit": "4994cbed850f3726721ec6fd3235a474e8d08fcc",
"readme": "specification/policyinsights/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\\policyinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --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/policyinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.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.4.3",
"use": "@autorest/typescript@6.0.0-rc.1"
}
31 changes: 13 additions & 18 deletions sdk/policyinsights/arm-policyinsights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -28,7 +28,7 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-policyinsights.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@microsoft/api-extractor": "7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
Expand All @@ -40,9 +40,13 @@
"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"
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights",
"repository": {
Expand Down Expand Up @@ -93,9 +97,8 @@
"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:browser": "echo skipped",
"docs": "echo skipped"
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
Expand All @@ -106,13 +109,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights?view=azure-node-preview"
}
}
"autoPublish": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';

// @public
export type Attestation = Resource & {
readonly systemData?: SystemData;
policyAssignmentId: string;
policyDefinitionReferenceId?: string;
export interface Attestation extends Resource {
assessmentDate?: Date;
comments?: string;
complianceState?: ComplianceState;
evidence?: AttestationEvidence[];
expiresOn?: Date;
readonly lastComplianceStateChangeAt?: Date;
metadata?: Record<string, unknown>;
owner?: string;
comments?: string;
evidence?: AttestationEvidence[];
policyAssignmentId: string;
policyDefinitionReferenceId?: string;
readonly provisioningState?: string;
readonly lastComplianceStateChangeAt?: Date;
};
readonly systemData?: SystemData;
}

// @public
export interface AttestationEvidence {
Expand Down Expand Up @@ -312,13 +314,9 @@ export enum KnownComplianceState {

// @public
export enum KnownCreatedByType {
// (undocumented)
Application = "Application",
// (undocumented)
Key = "Key",
// (undocumented)
ManagedIdentity = "ManagedIdentity",
// (undocumented)
User = "User"
}

Expand All @@ -331,27 +329,22 @@ export enum KnownFieldRestrictionResult {

// @public
export enum KnownPolicyEventsResourceType {
// (undocumented)
Default = "default"
}

// @public
export enum KnownPolicyStatesResource {
// (undocumented)
Default = "default",
// (undocumented)
Latest = "latest"
}

// @public
export enum KnownPolicyStatesSummaryResourceType {
// (undocumented)
Latest = "latest"
}

// @public
export enum KnownPolicyTrackedResourcesResourceType {
// (undocumented)
Default = "default"
}

Expand Down Expand Up @@ -715,10 +708,10 @@ export interface PolicyMetadataOperations {
}

// @public
export type PolicyMetadataProperties = PolicyMetadataSlimProperties & {
export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties {
readonly description?: string;
readonly requirements?: string;
};
}

// @public
export interface PolicyMetadataSlimProperties {
Expand Down
21 changes: 17 additions & 4 deletions sdk/policyinsights/arm-policyinsights/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ export interface ErrorDefinitionAutoGenerated2 {
}

/** The properties of the policy metadata. */
export type PolicyMetadataProperties = PolicyMetadataSlimProperties & {
export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties {
/**
* The description of the policy metadata.
* NOTE: This property will not be serialized. It can only be populated by the server.
Expand All @@ -1124,10 +1124,10 @@ export type PolicyMetadataProperties = PolicyMetadataSlimProperties & {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly requirements?: string;
};
}

/** An attestation resource. */
export type Attestation = Resource & {
export interface Attestation extends Resource {
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
* NOTE: This property will not be serialized. It can only be populated by the server.
Expand Down Expand Up @@ -1157,7 +1157,11 @@ export type Attestation = Resource & {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly lastComplianceStateChangeAt?: Date;
};
/** The time the evidence was assessed */
assessmentDate?: Date;
/** Additional metadata for this attestation */
metadata?: Record<string, unknown>;
}

/** Parameter group */
export interface QueryOptions {
Expand All @@ -1183,6 +1187,7 @@ export interface QueryOptions {

/** Known values of {@link PolicyTrackedResourcesResourceType} that the service accepts. */
export enum KnownPolicyTrackedResourcesResourceType {
/** Default */
Default = "default"
}

Expand Down Expand Up @@ -1215,9 +1220,13 @@ export type ResourceDiscoveryMode = string;

/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key"
}

Expand All @@ -1235,6 +1244,7 @@ export type CreatedByType = string;

/** Known values of {@link PolicyEventsResourceType} that the service accepts. */
export enum KnownPolicyEventsResourceType {
/** Default */
Default = "default"
}

Expand All @@ -1249,7 +1259,9 @@ export type PolicyEventsResourceType = string;

/** Known values of {@link PolicyStatesResource} that the service accepts. */
export enum KnownPolicyStatesResource {
/** Default */
Default = "default",
/** Latest */
Latest = "latest"
}

Expand All @@ -1265,6 +1277,7 @@ export type PolicyStatesResource = string;

/** Known values of {@link PolicyStatesSummaryResourceType} that the service accepts. */
export enum KnownPolicyStatesSummaryResourceType {
/** Latest */
Latest = "latest"
}

Expand Down
13 changes: 13 additions & 0 deletions sdk/policyinsights/arm-policyinsights/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2589,6 +2589,19 @@ export const Attestation: coreClient.CompositeMapper = {
type: {
name: "DateTime"
}
},
assessmentDate: {
serializedName: "properties.assessmentDate",
type: {
name: "DateTime"
}
},
metadata: {
serializedName: "properties.metadata",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export const parameters2: OperationParameter = {
export const apiVersion4: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-01-01",
defaultValue: "2022-09-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
PolicyTrackedResourcesImpl,
Expand Down Expand Up @@ -80,6 +81,29 @@ export class PolicyInsightsClient 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;

Expand Down
Loading