azure-sdk-for-net
azure-sdk-for-net copied to clipboard
Make all credential types mockable
While reading through https://github.com/Azure/azure-sdk-for-net/issues/20911, I noticed that only some credential types in the Azure Identity library expose protected, parameterless constructors and are therefore mockable. This is a tracking issue to update the affected credential types accordingly, to adhere to Azure SDK for .NET mocking guidelines.
@scottaddie: Can you help us understand for what the scenarios are where mocking TokenCredential
is not sufficient? There's no API in any Azure SDK package that is credential based but does not take TokenCredential
.
@jsquire We have customers who want to test code that didn't accept/use the TokenCredential
abstraction and instead accepted the derived type. I linked to an issue in my original comment that shows an example.
My bigger concern is that we're inconsistent across credential types.
To be clear, I'm not opposed to the requested change, just trying to understand the scenario.