AzureAD / microsoft-authentication-library-for-java

Microsoft Authentication Library (MSAL) for Java http://aka.ms/aadv2
MIT License
285 stars 142 forks source link

Make getManagedIdentitySource static #864

Closed Avery-Dunn closed 1 week ago

Avery-Dunn commented 1 week ago

Adjusts ManagedIdentityApplication to make the getManagedIdentitySource method static. This is to solve a niche issue when testing an application that uses Managed Identity, where a developer would want to test an app with multiple mocked MI sources on one machine.

Although this looks like it is adjusting public APIs, the actual change in the built package is minor and there should be no breaking change:

Additionally, static methods can be access through an instance of a class just like a non-static method, so making this method static will at worst cause a minor warning in an IDE about using a static method improperly. The RevAPI plugin was used to ensure that this was the only part of the API that could be considered 'changed' when compared to the last released msal4j package.