Skip to content

Commit 708a026

Browse files
maorlegerpjpatel12
authored andcommitted
[keyvault] Add customization for JS enum names (Azure#32422)
As part of the migration to TypeSpec, JavaScript would like to remove its hand-authored enums, replacing them with autogenerated enums where possible. To maintain backwards compatibility with the already-GA'd naming conventions, this PR adds customization so the new generated enums match the existing ones.
1 parent 816f8d6 commit 708a026

File tree

1 file changed

+32
-0
lines changed
  • specification/keyvault/Security.KeyVault.Keys

1 file changed

+32
-0
lines changed

specification/keyvault/Security.KeyVault.Keys/client.tsp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,35 @@ using KeyVault;
6262
@@clientName(JsonWebKey.dp, "DP", "go");
6363
@@clientName(JsonWebKey.dq, "DQ", "go");
6464
@@clientName(JsonWebKey.qi, "QI", "go");
65+
66+
// JS configuration
67+
@@clientName(JsonWebKeyCurveName.P256_K, "P256K", "javascript");
68+
@@clientName(JsonWebKeySignatureAlgorithm.RSNULL, "Rsnull", "javascript");
69+
@@clientName(JsonWebKeySignatureAlgorithm.ES256_K, "ES256K", "javascript");
70+
@@clientName(JsonWebKeyEncryptionAlgorithm.RSA_OAEP, "RSAOaep", "javascript");
71+
@@clientName(JsonWebKeyEncryptionAlgorithm.RSA_OAEP256,
72+
"RSAOaep256",
73+
"javascript"
74+
);
75+
@@clientName(JsonWebKeyEncryptionAlgorithm.RSA1_5, "RSA15", "javascript");
76+
@@clientName(JsonWebKeyEncryptionAlgorithm.A128_GCM, "A128GCM", "javascript");
77+
@@clientName(JsonWebKeyEncryptionAlgorithm.A192_GCM, "A192GCM", "javascript");
78+
@@clientName(JsonWebKeyEncryptionAlgorithm.A256_GCM, "A256GCM", "javascript");
79+
@@clientName(JsonWebKeyEncryptionAlgorithm.A128_KW, "A128KW", "javascript");
80+
@@clientName(JsonWebKeyEncryptionAlgorithm.A192_KW, "A192KW", "javascript");
81+
@@clientName(JsonWebKeyEncryptionAlgorithm.A256_KW, "A256KW", "javascript");
82+
@@clientName(JsonWebKeyEncryptionAlgorithm.A128_CBC, "A128CBC", "javascript");
83+
@@clientName(JsonWebKeyEncryptionAlgorithm.A192_CBC, "A192CBC", "javascript");
84+
@@clientName(JsonWebKeyEncryptionAlgorithm.A256_CBC, "A256CBC", "javascript");
85+
@@clientName(JsonWebKeyEncryptionAlgorithm.A128_CBCPAD,
86+
"A128Cbcpad",
87+
"javascript"
88+
);
89+
@@clientName(JsonWebKeyEncryptionAlgorithm.A192_CBCPAD,
90+
"A192Cbcpad",
91+
"javascript"
92+
);
93+
@@clientName(JsonWebKeyEncryptionAlgorithm.A256_CBCPAD,
94+
"A256Cbcpad",
95+
"javascript"
96+
);

0 commit comments

Comments
 (0)