-
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
[Identity] Migrated to samples v2 #19085
Conversation
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 always only thought of dependencyOverrides
as being to override dependency version selectors and not to inject them, but this should totally work and is honestly quite clever.
I have one comment about how the build errors might be fixed, and another about why we need to import from the identity package name and not from ../src
.
import { ClientSecretCredential } from "../src"; | ||
import { KeyClient } from "@azure/keyvault-keys"; |
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.
Two comments here:
- We need to still be importing from
@azure/identity
here. Adding it to thepaths
entry in tsconfig should enable this, so you don't need to import from source for that to resolve (as you can think ofpaths
as adding a manual module resolution entry to the TypeScript compiler). - We will also need an entry for
@azure/keyvault-keys
. I never thought to usedependencyOverrides
for this purpose, but it should totally work if we also add apaths
entry for it! I think something like"@azure/keyvault-keys": ["../../keyvault/keyvault-keys/src/index"]
should work nicely.
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.
So, I updated the references to @azure/identity
on the samples, but "@azure/keyvault-keys": ["../../keyvault/keyvault-keys/src/index"]
didn’t work. We talked over teams and we realized that adding keyvault on paths would alter significantly how the dist
folder appears (it grabs a large part of the repository structure, to group these two projects under the same root).
and a cleanup related to keys on the package.json
@@ -10,7 +10,7 @@ Key links: | |||
- [Package (npm)](https://www.npmjs.com/package/@azure/identity) | |||
- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/identity) | |||
- [Product documentation](https://azure.microsoft.com/services/active-directory/) | |||
- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples) | |||
- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2) |
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 think other versions could be added in the future so do we want the customer to pick and choose the right version for them?
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.
Ohh interesting! — Though I’d rather not think too much about it at the moment 🙏 I took a peek and it made me question other things. Makes me feel it’s a scope leak and could lead to a rabbit hole.
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 took a peek and it made me question other things.
@sadasant interesting, anything you could share that could help with future migrations?
@@ -1,6 +1,10 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// Licensed under the MIT license. | |||
|
|||
/** | |||
* @summary Authenticates with a client and a client's secret. |
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.
The word client is overloaded in this context and could be confusing. Should we use "application" instead?
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.
"App Registration"?
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.
Updated! Please let me know how it looks 👍
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.
Very nice. I have just a couple of comments on the @summary
tags.
@@ -1,6 +1,10 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// Licensed under the MIT license. | |||
|
|||
/** | |||
* @summary Authenticates with a client and a client's secret. |
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.
"App Registration"?
Co-authored-by: Will Temple <[email protected]>
@@ -1,6 +1,10 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// Licensed under the MIT license. | |||
|
|||
/** | |||
* @summary Authenticates with a client and a app registration's secret. |
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.
could you update this summary as well?
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.
Oh now I think I should have said Authenticates with an app registration’s client Id and secret
. I’ll update it!
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.
How does this look? 9f525fc
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.
Looks good, thanks!
Mitryakh/network 2022 01 01 (Azure#19412) * Adds base for updating Microsoft.Network from version stable/2021-08-01 to version 2022-01-01 * Updates readme * Updates API version in new specs and examples * Updated Explicit proxy settings by adding one boolean field to it (Azure#19011) * API for provider port (Azure#19041) * Update readme.md * Create expressRouteProviderPort.json * Create expressRouteProviderPortList.json * Create expressRouteProviderPort.json * Update custom-words.txt * Update expressRouteProviderPort.json * Update expressRouteProviderPortList.json * Update expressRouteProviderPort.json * Add WAF match variable operators (Azure#18925) ### webapplicationfirewall.json * Add GreaterThanOrEquals operator and Any operator to custom rule match conditions in WAF policy spec * Add VirtualHub Router autoscale configuration (Azure#19131) Co-authored-by: Andrii Kalinichenko <[email protected]> * Adding rule priority to Tls Proxy routing rule object model (Azure#19135) Co-authored-by: Vinay Mundada <[email protected]> * swagger changes for new ssl policies (Azure#19183) * Update Swagger Spec for VMSS Packet Capture (Azure#19202) * Update Swagger Spec for VMSS Packet Capture * Remove extra line * Update Swagger spec for Connection Monitor VMSS (Azure#19203) * Adding new endpoint in ConnectionMonitor * Changing ConnectionMonitor endpoints order * Add flushConnection to NSG (Azure#19085) * Merge NetworkManger into 2022-01-01 (Azure#19169) * Merge NetworkManger into 2022-01-01 * Remove EffectiveVnet APIs * Remove SecurityUser Resource * update readme * Fix as comments * fix as comments * remove network group type * Add new parameter noInternetAdvertise to CustomIPPrefix (Azure#19340) * fix * fix Co-authored-by: Weiheng Li <[email protected]> * Route Server Integration feature swagger changes (Azure#19215) * Route Server Integration feature swagger changes * prettier run changes * updating api version in examples file * fixing test errors * fixing test errors * fixing modelvalidation errors * fixing test errors * fixing modelvalidation errors * changes based on review comments * fixing lintdiff failure * updating examples * update wrong enum value for customipprefix (Azure#19382) * fix * fix * fix Co-authored-by: Weiheng Li <[email protected]> * Updated ExplicitProxySettings to ExplicitProxy on Firewall Policy ver2022-01-01 (Azure#19299) Co-authored-by: Gizachew Eshetie <[email protected]> * Add resource type (Azure#19434) Co-authored-by: Andrii Kalinichenko <[email protected]> * Fix prettier errors (Azure#19462) Co-authored-by: Andrii Kalinichenko <[email protected]> Co-authored-by: uditmisra52 <[email protected]> Co-authored-by: jashsing-mic <[email protected]> Co-authored-by: Anurag Kishore <[email protected]> Co-authored-by: AndriiKalinichenko <[email protected]> Co-authored-by: Andrii Kalinichenko <[email protected]> Co-authored-by: Vinay Jayant Mundada <[email protected]> Co-authored-by: Vinay Mundada <[email protected]> Co-authored-by: kaushik-ms <[email protected]> Co-authored-by: snagpal99 <[email protected]> Co-authored-by: kumaam <[email protected]> Co-authored-by: Satya-anshu <[email protected]> Co-authored-by: yanfa317 <[email protected]> Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Anchal Kapoor <[email protected]> Co-authored-by: Gizachew-Eshetie <[email protected]> Co-authored-by: Gizachew Eshetie <[email protected]>
I’m following the migration guide to move Identity to the samples v2: https://github.com/Azure/azure-sdk-for-js/wiki/Samples-v2-Migration-Guide
Important: Added the
dependencyOverrides
in order to require@azure/keyvault-keys
on the samples, since Identity can’t depend on@azure/keyvault-keys
(it would get recursive).Fixes #14474