-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
I have updated the PR description with the latest changes |
sdk/keyvault/keyvault-certificates/test/internal/lroUnexpectedErrors.spec.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-certificates/test/internal/serviceVersionParameter.spec.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/src/cryptography/remoteCryptographyProvider.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-secrets/test/internal/serviceVersionParameter.spec.ts
Outdated
Show resolved
Hide resolved
@@ -260,32 +260,34 @@ export interface ErrorModel { | |||
readonly message?: string; | |||
} | |||
|
|||
export { ExtendedCommonClientOptions } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it re-exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, the only place where this is being exported is in index.ts
on line 197.
CommonClientOptions
from Core-http was also being exported there, I just renamed it to the equivalent in CoreV2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is breaking then but I wonder what was the point of re-exporting the old interface in the first place. I am thinking of biting the bullet and removing the re-export even though that is also a breaking change. @xirzec what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, PipelineOptions
from core-http (which has been removed in this PR) was being exported too in the same way as ExtendedCommonClientOptions
.
You can find it here:
https://github.com/JonathanCrd/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-certificates/review/keyvault-certificates.api.md?plain=1#L433
I'm also curious why this behavior, however, wouldn't it be a breaking change anyway since PipelineOptions
is no longer being exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to get this PR merged in the coming days, but want to resolve this first. I did a bit of digging to try and understand the impact of the change. PipelineOptions
was initially exported in this commit from 3 years back and hasn't been touched since. At the time of that commit, the CertificateClient constructor took PipelineOptions
as a parameter, so you can see why the export was required then. This was extracted out to a CertificateClientOptions
by Daniel here, which is what we have now.
I don't see the point in exporting the new ExtendedCommonClientOptions
as is here -- let's remove that at least. If we were to remove the export of PipelineOptions
, would we still be able to release this as a minor? I can think of some hackery that might be less breaking (re-exporting ExtendedCommonClientOptions
as PipelineOptions
...) but that doesn't sit very well with me since we're effectively giving the type an incorrect name.
Thoughts, @deyaaeldeen, @xirzec, @joheredi (and anybody else)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To wrap this up: After an offline discussion, we're in agreement it would be ok to remove the export of PipelineOptions
and still release this as a minor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
This PR finishing updating all of KeyVault to use CoreV2 and removes all their dependencies to the old core. For more information about this type of migrations refer to this wiki.
Since these 3 packages depends on common, they needed to be migrated at the same time. The following is a summary of the main changes:
Dependencies and generation changes:
core-http
and replaced them with theircore-client
,core-rest-pipeline
andcore-auth
equivalent.isNode
anddelay
are now imported fromcore-utils
preview, since Admin client already depends on it.core-http-compat
as a dependency to useExtendedCommonClientOptions
in all packages instead ofCommonClientOptions
fromcore-client
.Authentication changes:
SigningPolic
from all packages.bearerTokenAuthenticationPolicy
to authenticate.isTokenCredential
from imports.constants.ts
parsedChallenge.resource
.Convenience layer changes:
Next
keyword in them. For example:getDeletedSecret(continuationToken, options )
togetDeletedSecretNext(vaultURI, continuationToken, options)
.Test changes:
Recorder updates:
All of the packages build correctly, and tests pass as well.
Related PRs
Checklists