Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault] - Migrate KeyVault Certificates, Keys and Secrets to Core V2 #21702

Merged
merged 89 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
6ff01a4
Create local copy of IsNode
JonathanCrd Apr 5, 2022
ac194c3
Update swagger config file and package json
JonathanCrd Apr 8, 2022
f4eedc5
Import IsNode from local copy
JonathanCrd Apr 8, 2022
6bfef29
Regen client
JonathanCrd Apr 8, 2022
b46857a
Changes in custom layer
JonathanCrd Apr 11, 2022
bbe22ac
Regen Certificates Client
JonathanCrd Apr 12, 2022
90a8af9
Use latest version of autorest.typescript
JonathanCrd Apr 12, 2022
4ff44a6
Update LRO Certificates
JonathanCrd Apr 14, 2022
64a5b1d
Regenerate KV Certificates to fix nullable issue
JonathanCrd Apr 14, 2022
1e6f384
Update Certificates Custom Layer
JonathanCrd Apr 14, 2022
fd1c368
Update tests for KV Certificates
JonathanCrd Apr 14, 2022
3467ff3
Migrate KV Common to CoreV2 and add extra utils
JonathanCrd Apr 14, 2022
e4e15b3
Build KV Certificates
JonathanCrd Apr 14, 2022
0c35da3
Update dependencies and generate client
JonathanCrd Apr 15, 2022
65540a4
Update KV Keys src
JonathanCrd Apr 15, 2022
d12e533
Update KV Keys Cryptography
JonathanCrd Apr 15, 2022
5247665
Update KV Keys LRO
JonathanCrd Apr 15, 2022
ff4eefc
Update KV Keys Internal Tests
JonathanCrd Apr 15, 2022
9c4c5a6
Update KV Keys Public Utils Tests
JonathanCrd Apr 15, 2022
adbdf44
Update KV Keys public tests
JonathanCrd Apr 16, 2022
59f04bf
Fix build error and rebuild KV Keys
JonathanCrd Apr 16, 2022
900c64a
Adding browser mapping to KV common
JonathanCrd Apr 18, 2022
c472bed
KV Secrets Update Package Version
JonathanCrd Apr 19, 2022
1f04835
KV Secrets Regenerate Client
JonathanCrd Apr 19, 2022
3cdb6af
KV Secrets Update src
JonathanCrd Apr 19, 2022
ef20365
KV Secrets remove context file (no longer generated)
JonathanCrd Apr 19, 2022
2f615b1
KV Secrets Update tests
JonathanCrd Apr 19, 2022
e364e75
KV Secrets build package
JonathanCrd Apr 19, 2022
b742e57
Update KV Secrets constants
JonathanCrd Apr 19, 2022
1cce6ea
Import IsNode and delay from core-util
JonathanCrd Apr 20, 2022
56fd603
rush update and build
JonathanCrd Apr 20, 2022
c09a9aa
Update swagger openapi-type flag
JonathanCrd Apr 20, 2022
fd996c7
Fix import in KV Common
JonathanCrd Apr 20, 2022
962680e
Fix tests
JonathanCrd Apr 20, 2022
dc65647
Merge branch 'main' into CoreV2-KeyVault-Certificates
JonathanCrd Apr 21, 2022
62a3c47
Update authentication scopes for Secrets
JonathanCrd Apr 22, 2022
359767b
Add XHRhttpClient
JonathanCrd Apr 22, 2022
4694988
Fix Secrets tests and update recordings
JonathanCrd Apr 26, 2022
9fcc858
Remove challengeAuthenticationCallbacks from Admin
JonathanCrd Apr 26, 2022
3d089c1
Fix Certificates Tests
JonathanCrd Apr 28, 2022
0d958f3
Fix Keys Tests
JonathanCrd Apr 29, 2022
72d120c
Merge branch 'main' into CoreV2-KeyVault-Certificates
JonathanCrd Apr 29, 2022
fd3a3d8
Rush update
JonathanCrd Apr 30, 2022
b3a9f9b
Fix lint errors
JonathanCrd Apr 30, 2022
2ef7ea9
Updating credentials in before each
JonathanCrd May 2, 2022
5b85738
Fixing user agent CI tests
JonathanCrd May 2, 2022
585d5a9
Fixing CI
JonathanCrd May 2, 2022
30f0b45
Revert changes recording certificate's secret perm
JonathanCrd May 3, 2022
f9dd77b
Update failing browser recording
JonathanCrd May 3, 2022
9d2b60b
Use Test Credential in Secrets
JonathanCrd May 5, 2022
7e623c9
Merge branch 'main' into CoreV2-KeyVault-Certificates
JonathanCrd May 5, 2022
5745d9b
rush update
JonathanCrd May 5, 2022
7ff871d
Fix Certificates Browser tests
JonathanCrd May 6, 2022
e732bbd
Merge remote-tracking branch 'upstream/main' into CoreV2-KeyVault-Cer…
JonathanCrd May 6, 2022
c32cd6e
Rush update
JonathanCrd May 6, 2022
37a6737
Update Keys Package.json
JonathanCrd May 6, 2022
ccbcfac
Use TestCredentials in Keys Tests
JonathanCrd May 6, 2022
6baf5f8
Format files in Keys
JonathanCrd May 6, 2022
a846241
Update Keys to new recorder
JonathanCrd May 27, 2022
4360827
Removed fixed auth scopes and fix bug in challenge
JonathanCrd May 27, 2022
d2d7a16
Update Recordings
JonathanCrd May 27, 2022
26b4f7f
Removed hardcoded auth scopes from packages
JonathanCrd May 28, 2022
46ff726
Merge branch 'main' into CoreV2-KeyVault-Certificates
JonathanCrd May 28, 2022
ed11d9e
rush update
JonathanCrd May 28, 2022
84cc639
Fix Analyze CI Step
JonathanCrd May 28, 2022
9f65a8f
Fixing btoa issue in Node
JonathanCrd May 28, 2022
4474357
Modify test case for scope in challenge
JonathanCrd Jun 7, 2022
618f208
Merge remote-tracking branch 'upstream/main' into CoreV2-KeyVault-Cer…
JonathanCrd Jun 7, 2022
03ecc10
rush update
JonathanCrd Jun 7, 2022
b4f175d
Sort imports
JonathanCrd Jun 7, 2022
95992dd
add ./default to scope test
JonathanCrd Jun 7, 2022
f8c7e90
Fix linter CI error
JonathanCrd Jun 8, 2022
ef22b3f
Format KV Keys
JonathanCrd Jun 8, 2022
4b6edac
Update browser recordings containing "" body
JonathanCrd Jun 9, 2022
135b82a
Merge remote-tracking branch 'upstream/main' into CoreV2-KeyVault-Cer…
JonathanCrd Jun 9, 2022
19f0dfc
Update pnpm-lock.yaml
JonathanCrd Jun 9, 2022
0e1b1eb
Add Core HTTP Compat to KV Keys
JonathanCrd Jun 9, 2022
4014b39
Add Core-http-compat to KV Certificates
JonathanCrd Jun 9, 2022
aba2d4e
Add Core-http-compat to KV Secrets
JonathanCrd Jun 9, 2022
878fb94
Merge remote-tracking branch 'upstream/main' into CoreV2-KeyVault-Cer…
JonathanCrd Jun 9, 2022
71766f3
Rush update
JonathanCrd Jun 9, 2022
8769bcc
Rebuild packages
JonathanCrd Jun 9, 2022
4f40171
Addressing comments
JonathanCrd Jun 10, 2022
0887e34
Merge remote-tracking branch 'upstream/main' into CoreV2-KeyVault-Cer…
JonathanCrd Jun 10, 2022
9c419e9
Update pnpm-lock.yaml
JonathanCrd Jun 10, 2022
bba9952
Add Challenge Authentication tests in all packages
JonathanCrd Jun 10, 2022
f6e65aa
Depend on GA version of @azure/core-util
JonathanCrd Jun 11, 2022
60e9911
Merge branch 'main' into CoreV2-KeyVault-Certificates
timovv Jun 14, 2022
70ef94c
Remove ExtendedCommonClientOptions exports from all packages
timovv Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6,772 changes: 3,451 additions & 3,321 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sdk/keyvault/keyvault-admin/src/accessControlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import {
ListRoleDefinitionsPageSettings,
SetRoleDefinitionOptions,
} from "./accessControlModels";
import { LATEST_API_VERSION, authenticationScopes } from "./constants";
import { KeyVaultClient } from "./generated/keyVaultClient";
import { LATEST_API_VERSION } from "./constants";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { RoleAssignmentsListForScopeOptionalParams } from "./generated/models";
import { TokenCredential } from "@azure/core-auth";
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
import { createChallengeCallbacks } from "./challengeAuthenticationCallbacks";
import { createChallengeCallbacks } from "../../keyvault-common/src/";
import { logger } from "./log";
import { mappings } from "./mappings";
import { tracingClient } from "./tracing";
Expand Down Expand Up @@ -89,7 +89,7 @@ export class KeyVaultAccessControlClient {
this.client.pipeline.addPolicy(
bearerTokenAuthenticationPolicy({
credential,
scopes: authenticationScopes,
scopes: [],
timovv marked this conversation as resolved.
Show resolved Hide resolved
challengeCallbacks: createChallengeCallbacks(),
})
);
Expand Down
6 changes: 3 additions & 3 deletions sdk/keyvault/keyvault-admin/src/backupClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
KeyVaultRestoreResult,
KeyVaultSelectiveKeyRestoreResult,
} from "./backupClientModels";
import { LATEST_API_VERSION, authenticationScopes } from "./constants";
import { KeyVaultAdminPollOperationState } from "./lro/keyVaultAdminPoller";
import { KeyVaultBackupOperationState } from "./lro/backup/operation";
import { KeyVaultBackupPoller } from "./lro/backup/poller";
Expand All @@ -19,10 +18,11 @@ import { KeyVaultRestoreOperationState } from "./lro/restore/operation";
import { KeyVaultRestorePoller } from "./lro/restore/poller";
import { KeyVaultSelectiveKeyRestoreOperationState } from "./lro/selectiveKeyRestore/operation";
import { KeyVaultSelectiveKeyRestorePoller } from "./lro/selectiveKeyRestore/poller";
import { LATEST_API_VERSION } from "./constants";
import { PollerLike } from "@azure/core-lro";
import { TokenCredential } from "@azure/core-auth";
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
import { createChallengeCallbacks } from "./challengeAuthenticationCallbacks";
import { createChallengeCallbacks } from "../../keyvault-common/src/";
import { logger } from "./log";
import { mappings } from "./mappings";

Expand Down Expand Up @@ -92,7 +92,7 @@ export class KeyVaultBackupClient {
this.client.pipeline.addPolicy(
bearerTokenAuthenticationPolicy({
credential,
scopes: authenticationScopes,
scopes: [],
challengeCallbacks: createChallengeCallbacks(),
})
);
Expand Down
133 changes: 0 additions & 133 deletions sdk/keyvault/keyvault-admin/src/challengeAuthenticationCallbacks.ts

This file was deleted.

5 changes: 0 additions & 5 deletions sdk/keyvault/keyvault-admin/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ export const LATEST_API_VERSION = "7.3";
* Supported API versions
*/
export type SUPPORTED_API_VERSIONS = "7.2" | "7.3";

/**
* Authentication scopes
*/
export const authenticationScopes = ["https://managedhsm.azure.net/.default"];
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { assert } from "@azure/test-utils";
import { createChallengeCallbacks } from "../../src/challengeAuthenticationCallbacks";
import { createChallengeCallbacks } from "../../../keyvault-common/src/";
import {
AuthorizeRequestOptions,
ChallengeCallbacks,
Expand Down Expand Up @@ -118,15 +118,15 @@ describe("Challenge based authentication tests", function () {
request,
response: {
headers: createHttpHeaders({
"WWW-Authenticate": `Bearer scope="cae_scope"`,
"WWW-Authenticate": `Bearer resource="cae_scope"`,
}),
request,
status: 200,
},
scopes: [],
});

assert.sameMembers(getAccessTokenScopes, ["cae_scope"]);
assert.sameMembers(getAccessTokenScopes, ["cae_scope/.default"]);
});

it("passes the tenantId if provided", async () => {
Expand Down
9 changes: 7 additions & 2 deletions sdk/keyvault/keyvault-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-http": "^2.0.0",
"@azure/core-client": "^1.5.0",
"@azure/core-http-compat": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-lro": "^2.2.0",
"@azure/core-paging": "^1.1.1",
"@azure/core-util": "^1.0.0-beta.1",
"@azure/core-tracing": "^1.0.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
Expand All @@ -119,8 +123,9 @@
"@azure/identity": "^2.1.0-beta.2",
"@azure/keyvault-secrets": "^4.2.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "7.18.11",
"@microsoft/api-extractor": "^7.18.11",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"@types/sinon": "^9.0.4",
Expand Down
Loading