azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

Make all credential types mockable

Open scottaddie opened this issue 9 months ago • 3 comments

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 avatar May 09 '24 19:05 scottaddie

@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 avatar May 09 '24 19:05 jsquire

@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.

scottaddie avatar May 10 '24 16:05 scottaddie

To be clear, I'm not opposed to the requested change, just trying to understand the scenario.

jsquire avatar May 10 '24 16:05 jsquire