Skip to content

Conversation

@Avery-Dunn
Copy link
Contributor

@Avery-Dunn Avery-Dunn commented Sep 26, 2024

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:

  • Previously, the Lombok @Getter annotation was creating a public method called getManagedIdentitySource in the final package
  • The changes in this PR create an explicit getManagedIdentitySource method that is also public, and removes the annotation for Lombok to create that same method
  • Putting those two points together, this should be no different from just changing the internals of the method to return the result of ManagedIdentityClient.getManagedIdentitySource() rather than the current value of the managedIdentitySource field
  • Because of all that, the values returned should be the same and the API should look no different in the actual package that gets built

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.

@Avery-Dunn Avery-Dunn requested a review from a team as a code owner September 26, 2024 15:46
@Avery-Dunn Avery-Dunn merged commit d27faab into dev Sep 28, 2024
@Avery-Dunn Avery-Dunn deleted the avdunn/mi-sourcetype-static branch January 21, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants