File tree Expand file tree Collapse file tree 4 files changed +34
-11
lines changed
main/java/com/azure/core/amqp
test/java/com/azure/core/amqp
eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/models Expand file tree Collapse file tree 4 files changed +34
-11
lines changed Original file line number Diff line number Diff line change 77### Breaking Changes
88
99### Bugs Fixed
10+ - Fixed proxy authentication type not being read from configuration. ([ #28073 ] ( https://github.com/Azure/azure-sdk-for-java/issues/28073 ) )
11+ - Updated ProxyOptions.SYSTEM_DEFAULTS to use ProxyAuthenticationType.NONE
1012
1113### Other Changes
1214
Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ public class ProxyOptions implements AutoCloseable {
2424 * The configuration key for containing the password for the username who authenticates with the proxy.
2525 */
2626 public static final String PROXY_PASSWORD = "PROXY_PASSWORD" ;
27+ /**
28+ * The configuration key for containing the authentication type to be used by the proxy.
29+ * This can one of three values -
30+ * - NONE
31+ * - BASIC
32+ * - DIGEST
33+ * as defined in ProxyAuthenticationType
34+ */
35+ public static final String PROXY_AUTHENTICATION_TYPE = "PROXY_AUTHENTICATION_TYPE" ;
2736
2837 private static final ClientLogger LOGGER = new ClientLogger (ProxyOptions .class );
2938 private final PasswordAuthentication credentials ;
@@ -38,7 +47,7 @@ public class ProxyOptions implements AutoCloseable {
3847 private ProxyOptions () {
3948 this .credentials = null ;
4049 this .proxyAddress = null ;
41- this .authentication = null ;
50+ this .authentication = ProxyAuthenticationType . NONE ;
4251 }
4352
4453 /**
Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation. All rights reserved.
2+ // Licensed under the MIT License.
3+
4+ package com .azure .core .amqp ;
5+
6+ import org .junit .jupiter .api .Assertions ;
7+ import org .junit .jupiter .api .Test ;
8+
9+ import static com .azure .core .amqp .ProxyOptions .SYSTEM_DEFAULTS ;
10+
11+ public class ProxyOptionsTest {
12+
13+ /**
14+ * Test System default proxy configuration properties are set
15+ */
16+ @ Test
17+ public void systemDefaultProxyConfiguration () {
18+ Assertions .assertEquals (ProxyAuthenticationType .NONE , SYSTEM_DEFAULTS .getAuthentication ());
19+ Assertions .assertNull (SYSTEM_DEFAULTS .getCredential ());
20+ Assertions .assertNull (SYSTEM_DEFAULTS .getProxyAddress ());
21+ }
22+ }
Original file line number Diff line number Diff line change 66import com .azure .core .amqp .ProxyAuthenticationType ;
77import com .azure .core .amqp .ProxyOptions ;
88import org .junit .jupiter .api .Assertions ;
9- import org .junit .jupiter .api .Test ;
109import org .junit .jupiter .params .ParameterizedTest ;
1110import org .junit .jupiter .params .provider .EnumSource ;
1211
1312import java .net .InetSocketAddress ;
1413import java .net .Proxy ;
1514
16- import static com .azure .core .amqp .ProxyOptions .SYSTEM_DEFAULTS ;
17-
1815public class ProxyOptionsTest {
1916
2017 private static final String PROXY_HOST = "127.0.0.1" ;
@@ -25,13 +22,6 @@ public class ProxyOptionsTest {
2522
2623 private static Proxy proxyAddress = new Proxy (Proxy .Type .HTTP , new InetSocketAddress (PROXY_HOST , Integer .parseInt (PROXY_PORT )));
2724
28- @ Test
29- public void nullProxyConfiguration () {
30- Assertions .assertNull (SYSTEM_DEFAULTS .getAuthentication ());
31- Assertions .assertNull (SYSTEM_DEFAULTS .getCredential ());
32- Assertions .assertNull (SYSTEM_DEFAULTS .getProxyAddress ());
33- }
34-
3525 @ ParameterizedTest
3626 @ EnumSource (ProxyAuthenticationType .class )
3727 public void validateProxyConfiguration (ProxyAuthenticationType proxyAuthenticationType ) {
You can’t perform that action at this time.
0 commit comments