Skip to content

Commit b361214

Browse files
authored
Merge pull request #828 from AzureAD/avdunn/api-fix
API fixes
2 parents c134ec2 + bb11b01 commit b361214

File tree

3 files changed

+124
-1
lines changed

3 files changed

+124
-1
lines changed

msal4j-sdk/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,33 @@
171171
<build>
172172
<sourceDirectory>${project.build.directory}/delombok</sourceDirectory>
173173
<plugins>
174+
<plugin>
175+
<groupId>org.revapi</groupId>
176+
<artifactId>revapi-maven-plugin</artifactId>
177+
<version>0.15.0</version>
178+
<configuration>
179+
<analysisConfiguration>
180+
<revapi.java>
181+
<checks>
182+
<failBuildOnProblemsFound>false</failBuildOnProblemsFound>
183+
</checks>
184+
</revapi.java>
185+
</analysisConfiguration>
186+
</configuration>
187+
<dependencies>
188+
<dependency>
189+
<groupId>org.revapi</groupId>
190+
<artifactId>revapi-java</artifactId>
191+
<version>0.28.1</version>
192+
</dependency>
193+
</dependencies>
194+
<executions>
195+
<execution>
196+
<id>check</id>
197+
<goals><goal>check</goal></goals>
198+
</execution>
199+
</executions>
200+
</plugin>
174201
<plugin>
175202
<groupId>org.projectlombok</groupId>
176203
<artifactId>lombok-maven-plugin</artifactId>

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractClientApplicationBase.java

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,100 @@ public T instanceDiscovery(boolean val) {
426426
return self();
427427
}
428428

429+
/**
430+
* Set logPii - boolean value, which determines
431+
* whether Pii (personally identifiable information) will be logged in.
432+
* The default value is false.
433+
*
434+
* @param val a boolean value for logPii
435+
* @return instance of the Builder on which method was called
436+
*/
437+
public T logPii(boolean val) {
438+
return super.logPii(val);
439+
}
440+
441+
/**
442+
* Sets the connect timeout value used in HttpsURLConnection connections made by {@link DefaultHttpClient},
443+
* and is not needed if using a custom HTTP client
444+
*
445+
* @param val timeout value in milliseconds
446+
* @return instance of the Builder on which method was called
447+
*/
448+
public T connectTimeoutForDefaultHttpClient(Integer val) {
449+
return super.connectTimeoutForDefaultHttpClient(val);
450+
}
451+
452+
/**
453+
* Sets the read timeout value used in HttpsURLConnection connections made by {@link DefaultHttpClient},
454+
* and is not needed if using a custom HTTP client
455+
*
456+
* @param val timeout value in milliseconds
457+
* @return instance of the Builder on which method was called
458+
*/
459+
public T readTimeoutForDefaultHttpClient(Integer val) {
460+
return super.readTimeoutForDefaultHttpClient(val);
461+
}
462+
463+
/**
464+
* Sets HTTP client to be used by the client application for all HTTP requests. Allows for fine
465+
* grained configuration of HTTP client.
466+
*
467+
* @param val Implementation of {@link IHttpClient}
468+
* @return instance of the Builder on which method was called
469+
*/
470+
public T httpClient(IHttpClient val) {
471+
return super.httpClient(val);
472+
}
473+
474+
/**
475+
* Sets SSLSocketFactory to be used by the client application for all network communication.
476+
* If HTTP client is set on the client application (via ClientApplication.builder().httpClient()),
477+
* any configuration of SSL should be done on the HTTP client and not through this method.
478+
*
479+
* @param val an instance of SSLSocketFactory
480+
* @return instance of the Builder on which method was called
481+
*/
482+
public T sslSocketFactory(SSLSocketFactory val) {
483+
return super.sslSocketFactory(val);
484+
}
485+
486+
/**
487+
* Sets ExecutorService to be used to execute the requests.
488+
* Developer is responsible for maintaining the lifecycle of the ExecutorService.
489+
*
490+
* @param val an instance of ExecutorService
491+
* @return instance of the Builder on which method was called
492+
*/
493+
public T executorService(ExecutorService val) {
494+
return super.executorService(val);
495+
}
496+
497+
/**
498+
* Sets Proxy configuration to be used by the client application (MSAL4J by default uses
499+
* {@link javax.net.ssl.HttpsURLConnection}) for all network communication.
500+
* If no proxy value is passed in, system defined properties are used. If HTTP client is set on
501+
* the client application (via ClientApplication.builder().httpClient()),
502+
* proxy configuration should be done on the HTTP client object being passed in,
503+
* and not through this method.
504+
*
505+
* @param val an instance of Proxy
506+
* @return instance of the Builder on which method was called
507+
*/
508+
public T proxy(Proxy val) {
509+
return super.proxy(val);
510+
}
511+
512+
/**
513+
* Set optional correlation id to be used by the API.
514+
* If not provided, the API generates a random UUID.
515+
*
516+
* @param val a string value of correlation id
517+
* @return instance of the Builder on which method was called
518+
*/
519+
public T correlationId(String val) {
520+
return super.correlationId(val);
521+
}
522+
429523
abstract AbstractClientApplicationBase build();
430524
}
431525

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,7 @@ public interface IAuthenticationResult extends Serializable {
4848
/**
4949
* @return various metadata relating to this authentication result
5050
*/
51-
AuthenticationResultMetadata metadata();
51+
default AuthenticationResultMetadata metadata() {
52+
return AuthenticationResultMetadata.builder().build();
53+
}
5254
}

0 commit comments

Comments
 (0)