Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
05dbcae
changes on kv-secret
sadasant Jan 21, 2022
95fdb72
kv-keys
sadasant Jan 21, 2022
7532b47
kv-certificates
sadasant Jan 21, 2022
d918606
certificates and admin
sadasant Jan 21, 2022
ec27c17
fixing paths on public tests to not reference anything that isnt public
sadasant Jan 21, 2022
6509b15
additional fix necessary in KeyVault Keys
sadasant Jan 21, 2022
eb1c60c
deriving the SERVICE_VERSION from the serviceVersions array in the sa…
sadasant Jan 26, 2022
686afcf
inlining the InternalTestClient
sadasant Jan 26, 2022
41c0483
Merge remote-tracking branch 'Azure/main' into fix14955
sadasant Jan 26, 2022
d833da3
lint fix
sadasant Jan 27, 2022
7d7f743
inlining the restore operation
sadasant Jan 27, 2022
e72fa95
[Perf] Decrease default perf test duration to 1 second (#19995)
timovv Jan 27, 2022
515f4c9
Fix issues of ProxyOptions doesn't passed to client when initialized …
EmmaZhu Jan 27, 2022
398c393
Post release automated changes for azure-arm-deploymentmanager (#20089)
azure-sdk Jan 27, 2022
c4fea7f
Implemented a backoff mechanism for the AutoRefreshTokenCredential (#…
petrsvihlik Jan 27, 2022
0fc2cda
Enable storage-queue sample execution (#20097)
EmmaZhu Jan 27, 2022
4edb8fe
[Agrifood Farming] Regenerate with latest codegen (#20059)
joheredi Jan 27, 2022
3a148ec
[Schema Registry Avro] Support backward compatibility for old preambl…
deyaaeldeen Jan 27, 2022
e9a3ec0
[Unified recorder] String sanitizer support + sanitizer refactor (#19…
timovv Jan 27, 2022
e8569bb
[KeyVault] - Added immutable flag to key release policy (#20090)
maorleger Jan 27, 2022
b3b2744
fix the local time zone bug in the test (#20096)
KarishmaGhiya Jan 28, 2022
5a793ee
Update CredScanSuppression.json (#20098)
qiaozha Jan 28, 2022
72a7f15
[sort-imports] enforce ```sort-imports``` rule in ```eventhubs-checkp…
bzhang0 Jan 28, 2022
98d66af
Set "TestProxy: true" for template and identity pipelines (#20122)
HarshaNalluru Jan 28, 2022
82345de
enforce sort-imports (#20119)
bzhang0 Jan 28, 2022
8d063af
using error.name instead of instanceof
sadasant Jan 28, 2022
5f004f3
Merge remote-tracking branch 'Azure/main' into fix14955
sadasant Jan 28, 2022
f92122e
formatting in schema registry
sadasant Jan 28, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { env, Recorder } from "@azure-tools/test-recorder";
import { AbortController } from "@azure/abort-controller";

import { KeyVaultAccessControlClient } from "../../src";
import { assertThrowsAbortError, getServiceVersion } from "../utils/common";
import { authenticate } from "../utils/authentication";
import { assertThrowsAbortError, getServiceVersion } from "./utils/common";
import { authenticate } from "./utils/authentication";

describe("Aborting KeyVaultAccessControlClient's requests", () => {
let client: KeyVaultAccessControlClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
KeyVaultRoleDefinition,
KnownKeyVaultDataAction,
} from "../../src";
import { authenticate } from "../utils/authentication";
import { supportsTracing } from "../utils/supportsTracing";
import { getServiceVersion } from "../utils/common";
import { authenticate } from "./utils/authentication";
import { supportsTracing } from "./utils/supportsTracing";
import { getServiceVersion } from "./utils/common";

describe("KeyVaultAccessControlClient", () => {
let client: KeyVaultAccessControlClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Recorder } from "@azure-tools/test-recorder";
import { AbortController } from "@azure/abort-controller";

import { KeyVaultBackupClient } from "../../src";
import { authenticate } from "../utils/authentication";
import { testPollerProperties } from "../utils/recorder";
import { assertThrowsAbortError, getSasToken, getServiceVersion } from "../utils/common";
import { authenticate } from "./utils/authentication";
import { testPollerProperties } from "./utils/recorder";
import { assertThrowsAbortError, getSasToken, getServiceVersion } from "./utils/common";

describe("Aborting KeyVaultBackupClient's requests", () => {
let client: KeyVaultBackupClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ chai.use(chaiAsPromised);
import { isPlaybackMode, Recorder } from "@azure-tools/test-recorder";

import { KeyVaultBackupClient } from "../../src";
import { authenticate } from "../utils/authentication";
import { testPollerProperties } from "../utils/recorder";
import { getSasToken, getServiceVersion } from "../utils/common";
import { authenticate } from "./utils/authentication";
import { testPollerProperties } from "./utils/recorder";
import { getSasToken, getServiceVersion } from "./utils/common";
import { delay } from "@azure/core-util";
import { assert } from "chai";
import { KeyClient } from "@azure/keyvault-keys";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { KeyClient } from "@azure/keyvault-keys";
import { v4 as uuidv4 } from "uuid";
import { Context } from "mocha";

import { KeyVaultAccessControlClient, KeyVaultBackupClient } from "../../src";
import { KeyVaultAccessControlClient, KeyVaultBackupClient } from "../../../src";
import { uniqueString } from "./recorder";
import { getEnvironmentVariable, getServiceVersion } from "./common";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { assert } from "chai";
import { env } from "@azure-tools/test-recorder";
import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils";
import { LATEST_API_VERSION, SUPPORTED_API_VERSIONS } from "../../src/constants";
import { LATEST_API_VERSION, SUPPORTED_API_VERSIONS } from "../../../src/constants";

export async function assertThrowsAbortError(cb: () => Promise<any>): Promise<void> {
let passed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { assert } from "chai";
import { Context } from "mocha";
import { createSandbox } from "sinon";
import { env, Recorder } from "@azure-tools/test-recorder";
import { getServiceVersion } from "../utils/utils.common";
import { getServiceVersion } from "../public/utils/common";

import {
AuthenticationChallengeCache,
Expand All @@ -14,9 +14,9 @@ import {
challengeBasedAuthenticationPolicy,
} from "../../../keyvault-common/src";
import { CertificateClient } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "../public/utils/recorderUtils";
import { authenticate } from "../public/utils/testAuthentication";
import TestClient from "../public/utils/testClient";
import { WebResource } from "@azure/core-http";
import { ClientSecretCredential } from "@azure/identity";

Expand Down
10 changes: 5 additions & 5 deletions sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import { ClientSecretCredential } from "@azure/identity";
import { isNode } from "@azure/core-http";

import { CertificateClient } from "../../src";
import { assertThrowsAbortError } from "../utils/utils.common";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { assertThrowsAbortError } from "./utils/common";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - create, read, update and delete", () => {
const prefix = `CRUD${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
10 changes: 5 additions & 5 deletions sdk/keyvault/keyvault-certificates/test/public/list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-r
import { isNode } from "@azure/core-http";

import { CertificateClient } from "../../src";
import { assertThrowsAbortError } from "../utils/utils.common";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { assertThrowsAbortError } from "./utils/common";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

const { expect } = chai;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { PollerStoppedError } from "@azure/core-lro";
import { env, Recorder } from "@azure-tools/test-recorder";

import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - LRO - create", () => {
const certificatePrefix = `lroCreate${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { PollerStoppedError } from "@azure/core-lro";
import { env, Recorder } from "@azure-tools/test-recorder";

import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - lro - delete", () => {
const certificatePrefix = `lroDelete${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
DefaultCertificatePolicy,
KeyVaultCertificateWithPolicy,
} from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - LRO - certificate operation", () => {
const certificatePrefix = `lroOperation${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { env, Recorder } from "@azure-tools/test-recorder";
import { PollerStoppedError } from "@azure/core-lro";

import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src";
import { assertThrowsAbortError } from "../utils/utils.common";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { assertThrowsAbortError } from "./utils/common";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - LRO - recoverDelete", () => {
const certificatePrefix = `lroRecover${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { ClientSecretCredential } from "@azure/identity";

import { CertificateClient } from "../../src";
import { base64ToUint8Array, stringToUint8Array } from "../../src/utils";
import { testPollerProperties } from "../utils/recorderUtils";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - merge and import certificates", () => {
const prefix = `merge${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-r
import { isNode } from "@azure/core-http";

import { CertificateClient } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { assertThrowsAbortError } from "../utils/utils.common";
import { authenticate } from "../utils/testAuthentication";
import { getServiceVersion } from "../utils/utils.common";
import TestClient from "../utils/testClient";
import { testPollerProperties } from "./utils/recorderUtils";
import { assertThrowsAbortError } from "./utils/common";
import { authenticate } from "./utils/testAuthentication";
import { getServiceVersion } from "./utils/common";
import TestClient from "./utils/testClient";

describe("Certificates client - restore certificates and recover backups", () => {
const prefix = `backupRestore${env.CERTIFICATE_NAME || "CertificateName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { env } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils";
import { LATEST_API_VERSION, CertificateClientOptions } from "../../src/certificatesModels";
import { CertificateClientOptions } from "../../../src";

export function getKeyvaultName(): string {
const keyVaultEnvVarName = "KEYVAULT_NAME";
Expand Down Expand Up @@ -43,7 +43,7 @@ export const serviceVersions = ["7.0", "7.1", "7.2", "7.3-preview"] as const;
* @returns - The service version to test
*/
export function getServiceVersion(): NonNullable<CertificateClientOptions["serviceVersion"]> {
return env.SERVICE_VERSION || LATEST_API_VERSION;
return env.SERVICE_VERSION || serviceVersions[serviceVersions.length - 1];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { AbortSignalLike } from "@azure/abort-controller";
import { PollOperationState, PollOperation } from "@azure/core-lro";
import { OperationOptions } from "@azure/core-http";
import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../src/certificatesModels";
import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../../src";

/**
* Options sent to the beginRestoreCertificateBackup method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
makeRestoreCertificateBackupPollOperation,
TestCertificateClientInterface,
} from "./operation";
import { KeyVaultCertificate } from "../../../../src/certificatesModels";
import { KeyVaultCertificate } from "../../../../../src";

export interface RestoreCertificateBackupPollerOptions {
client: TestCertificateClientInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the MIT license.

import { ClientSecretCredential } from "@azure/identity";
import { CertificateClient } from "../../src";
import { CertificateClient } from "../../../src";
import { uniqueString } from "./recorderUtils";
import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder";
import { getServiceVersion } from "./utils.common";
import { getServiceVersion } from "./common";
import TestClient from "./testClient";
import { Context } from "mocha";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { CertificateClient, KeyVaultCertificate } from "../../src";
import { CertificateClient, KeyVaultCertificate } from "../../../src";
import { PollerLike, PollOperationState } from "@azure/core-lro";
import { RestoreCertificateBackupPoller } from "./lro/restore/poller";
import { BeginRestoreCertificateBackupOptions } from "./lro/restore/operation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import {
KeyClient,
KeyVaultKey,
} from "../../src";
import { getKey, stringToUint8Array, uint8ArrayToString } from "../utils/crypto";
import { getKey, stringToUint8Array, uint8ArrayToString } from "../public/utils/crypto";
import { isNode } from "@azure/core-http";
import { AesCryptographyProvider } from "../../src/cryptography/aesCryptographyProvider";
import TestClient from "../utils/testClient";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../public/utils/testClient";
import { authenticate } from "../public/utils/testAuthentication";
import { env, Recorder } from "@azure-tools/test-recorder";
import { RemoteCryptographyProvider } from "../../src/cryptography/remoteCryptographyProvider";
import { ClientSecretCredential } from "@azure/identity";
import { getServiceVersion } from "../utils/utils.common";
import { getServiceVersion } from "../public/utils/common";

describe("AesCryptographyProvider browser tests", function () {
it("uses the browser replacement when running in the browser", async function (this: Context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
challengeBasedAuthenticationPolicy,
} from "../../../keyvault-common/src";
import { KeyClient } from "../../src";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { getServiceVersion } from "../utils/utils.common";
import { authenticate } from "../public/utils/testAuthentication";
import TestClient from "../public/utils/testClient";
import { getServiceVersion } from "../public/utils/common";
import { HttpHeaders, isNode, WebResource } from "@azure/core-http";
import { ClientSecretCredential } from "@azure/identity";
import sinon from "sinon";
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-keys/test/internal/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "../../src";
import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider";
import { JsonWebKey } from "../../src";
import { stringToUint8Array } from "../utils/crypto";
import { stringToUint8Array } from "../public/utils/crypto";
import { CryptographyProvider } from "../../src/cryptography/models";
import { RemoteCryptographyProvider } from "../../src/cryptography/remoteCryptographyProvider";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { assert } from "chai";
import { Context } from "mocha";
import { isNode } from "@azure/core-http";
import { KeyClient } from "../../src";
import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common";
import { testPollerProperties } from "../utils/recorderUtils";
import { assertThrowsAbortError, getServiceVersion } from "../public/utils/common";
import { testPollerProperties } from "../public/utils/recorderUtils";
import { env, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { authenticate } from "../public/utils/testAuthentication";
import TestClient from "../public/utils/testClient";
import { RestoreKeyBackupPoller } from "../public/utils/lro/restore/poller";

describe("Keys client - restore keys and recover backups", () => {
const keyPrefix = `backupRestore${env.KEY_NAME || "KeyName"}`;
Expand Down Expand Up @@ -118,10 +119,12 @@ describe("Keys client - restore keys and recover backups", () => {
// This test implementation of a restore poller only applies for backups that have been recently deleted.
// Backups might not be ready to be restored in an unknown amount of time.
// If this is useful to you, please open an issue at: https://github.com/Azure/azure-sdk-for-js/issues
const restorePoller = await testClient.beginRestoreKeyBackup(
backup as Uint8Array,
testPollerProperties
);
const restorePoller = new RestoreKeyBackupPoller({
backup: backup!,
client,
intervalInMs: testPollerProperties.intervalInMs,
});

const restoredKey = await restorePoller.pollUntilDone();

assert.equal(restoredKey.name, keyName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { HttpClient, HttpOperationResponse, WebResourceLike, HttpHeaders } from
import { ClientSecretCredential } from "@azure/identity";
import { env } from "@azure-tools/test-recorder";
import { versionsToTest } from "@azure/test-utils";
import { serviceVersions } from "../utils/utils.common";
import { serviceVersions } from "../public/utils/common";

describe("The Keys client should set the serviceVersion", () => {
const keyVaultUrl = `https://keyVaultName.vault.azure.net`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
getKeyPropertiesFromKeyItem,
keyRotationTransformations,
} from "../../src/transformations";
import { stringToUint8Array } from "../utils/crypto";
import { stringToUint8Array } from "../public/utils/crypto";

describe("Transformations", () => {
const releasePolicy = {
Expand Down
8 changes: 4 additions & 4 deletions sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { Recorder } from "@azure-tools/test-recorder";
import { ClientSecretCredential } from "@azure/identity";

import { CryptographyClient, KeyVaultKey, KeyClient } from "../../src";
import { authenticate } from "../utils/testAuthentication";
import { stringToUint8Array, uint8ArrayToString } from "../utils/crypto";
import TestClient from "../utils/testClient";
import { getServiceVersion, onVersions } from "../utils/utils.common";
import { authenticate } from "./utils/testAuthentication";
import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto";
import TestClient from "./utils/testClient";
import { getServiceVersion, onVersions } from "./utils/common";
import { isNode } from "@azure/core-http";

onVersions({ minVer: "7.2" }).describe(
Expand Down
Loading