-
Notifications
You must be signed in to change notification settings - Fork 148
Add API to disable internal retry behavior #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API to disable internal retry behavior #963
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
AbstractApplicationBase
to 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,
HttpHelper
was given a new constructor more easily and cleanly use this new field and the newIRetryPolicy
introduce in #960, and some minor refactoring was done to related classes.ManagedIdentityTests
received a new parameterized test which uses the API with severalIRetryPolicy
implementations.