Add API to disable internal retry behavior#963
Add API to disable internal retry behavior#963Avery-Dunn merged 3 commits intoavdunn/retry-behaviorfrom
Conversation
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractApplicationBase.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractApplicationBase.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractApplicationBase.java
Outdated
Show resolved
Hide resolved
| * | ||
| * @return instance of the Builder on which method was called | ||
| */ | ||
| public T disableInternalRetries() { |
There was a problem hiding this comment.
Maybe rename it to disableMsalRetries. In MSAL.Net this is passed as a flag when passing HttpClientFactory. Would recommend to be consistent with that if possible. WithHttpClientFactory. The name of the flag is no longer valid in MSAL.Net but similar.
There was a problem hiding this comment.
This is the naming that @Robbie-Microsoft did for Node and .NET:
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/413ea5d4514ff409af2def53af1b4774c7343e11/lib/msal-node/src/config/Configuration.ts#L102
https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/9fd9500cca0125250ad52668793b6bc778a6b05f/src/client/Microsoft.Identity.Client/AppConfig/ApplicationConfiguration.cs#L119
MSAL Java doesn't really have a separate configuration file like Node and .NET seem to, so this API would be the closest equivalent.
Adds a public API to
AbstractApplicationBaseto disable internal retry behavior for HTTP requests, similar to what was done in MSAL Node and .NET:AzureAD/microsoft-authentication-library-for-js#7603
AzureAD/microsoft-authentication-library-for-dotnet#5252
Internally,
HttpHelperwas given a new constructor more easily and cleanly use this new field and the newIRetryPolicyintroduce in #960, and some minor refactoring was done to related classes.ManagedIdentityTestsreceived a new parameterized test which uses the API with severalIRetryPolicyimplementations.