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-keys] Migrate to TypeSpec #31845

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maorleger
Copy link
Member

Packages impacted by this PR

@azure/keyvault-keys

Issues associated with this PR

Describe the problem that is addressed by this PR

Generates client using TypeSpec, with any workarounds scripted and noted

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR: (Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description.
  • Does this PR need any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here.)
  • Added a changelog (if necessary).

@@ -0,0 +1,83 @@
#!/usr/bin/env node
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end result is that this file should be deleted once all the workarounds are no longer needed

/** ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518 */
ES512 = "ES512",
/** ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518 */
ES256K = "ES256K",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated incorrectly as ES256_K

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment.

/** The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. */
P521 = "P-521",
/** The SECG SECP256K1 elliptic curve. */
P256K = "P-256K",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated incorrectly as P256_K

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cc @MaryGao -- this looks like another example of the enum normalization being different in Modular vs HLC (Azure/autorest.typescript#2832)

Copy link
Member

@MaryGao MaryGao Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is an accepted breaking discussed here and we keep some special chars e.g underscore here between numbers or before/ending with numbers.

If you think the name here is not reasonable, you could use client name to rename.

@@clientName(JsonWebKeyCurveName.P256_K, "P256K", "javascript");

Also we are open to hear feedbacks for this breaking if you have any concern feel free to raise your concern in codegen issue.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

@azure/keyvault-keys

@maorleger maorleger changed the title [keyvault] KeyVault Keys using TypeSpec [keyvault-keys] Migrate to TypeSpec Nov 19, 2024
@maorleger maorleger force-pushed the keyvault-keys-typespec branch from 3fa2212 to 29d03c9 Compare November 19, 2024 23:48
await client.listDeletedKeys(options).next();
await client.listPropertiesOfKeys(options).next();
await client.listPropertiesOfKeyVersions(keyName, options).next();
// TODO: figure out tracing strategy for list operations
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs to be addressed, but it could be that we decide not to trace paged operation logical spans and just emit the http spans

sdk/keyvault/keyvault-keys/package.json Outdated Show resolved Hide resolved
@maorleger maorleger marked this pull request as ready for review November 20, 2024 21:34
@maorleger maorleger requested review from bterlson, a team and timovv as code owners November 20, 2024 21:34
/** The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. */
P521 = "P-521",
/** The SECG SECP256K1 elliptic curve. */
P256K = "P-256K",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cc @MaryGao -- this looks like another example of the enum normalization being different in Modular vs HLC (Azure/autorest.typescript#2832)

sdk/keyvault/keyvault-keys/src/transformations.ts Outdated Show resolved Hide resolved
@maorleger maorleger force-pushed the keyvault-keys-typespec branch 3 times, most recently from 65f5051 to 7812be2 Compare December 10, 2024 23:35
@maorleger maorleger force-pushed the keyvault-keys-typespec branch from 7812be2 to 7858037 Compare January 14, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

4 participants