@@ -71,6 +71,7 @@ public class SharedCredentialsFile : ICredentialProfileStore
71
71
private const string RequestMinCompressionSizeBytesField = "request_min_compression_size_bytes" ;
72
72
private const string ClientAppIdField = "sdk_ua_app_id" ;
73
73
private const string AccountIdEndpointModeField = "account_id_endpoint_mode" ;
74
+ private const string S3ForcePathStyleField = "s3_force_path_style" ;
74
75
private readonly Logger _logger = Logger . GetLogger ( typeof ( SharedCredentialsFile ) ) ;
75
76
76
77
private static readonly HashSet < string > ReservedPropertyNames = new HashSet < string > ( StringComparer . OrdinalIgnoreCase )
@@ -104,7 +105,8 @@ public class SharedCredentialsFile : ICredentialProfileStore
104
105
DisableRequestCompressionField ,
105
106
RequestMinCompressionSizeBytesField ,
106
107
ClientAppIdField ,
107
- AccountIdEndpointModeField
108
+ AccountIdEndpointModeField ,
109
+ S3ForcePathStyleField
108
110
} ;
109
111
110
112
/// <summary>
@@ -443,9 +445,13 @@ private void RegisterProfileInternal(CredentialProfile profile)
443
445
444
446
if ( profile . ClientAppId != null )
445
447
reservedProperties [ ClientAppIdField ] = profile . ClientAppId ;
448
+
446
449
if ( profile . AccountIdEndpointMode != null )
447
450
reservedProperties [ AccountIdEndpointModeField ] = profile . AccountIdEndpointMode . ToString ( ) . ToLowerInvariant ( ) ;
448
451
452
+ if ( profile . S3ForcePathStyle != null )
453
+ reservedProperties [ S3ForcePathStyleField ] = profile . S3ForcePathStyle . ToString ( ) . ToLowerInvariant ( ) ;
454
+
449
455
var profileDictionary = PropertyMapping . CombineProfileParts (
450
456
profile . Options , ReservedPropertyNames , reservedProperties , profile . Properties ) ;
451
457
@@ -966,6 +972,21 @@ private bool TryGetProfile(string profileName, bool doRefresh, bool isSsoSession
966
972
967
973
#endif
968
974
}
975
+
976
+ string s3ForcePathStyleString ;
977
+ bool ? s3ForcePathStyle = null ;
978
+ if ( reservedProperties . TryGetValue ( S3ForcePathStyleField , out s3ForcePathStyleString ) )
979
+ {
980
+ bool s3ForcePathStyleOut ;
981
+ if ( ! bool . TryParse ( s3ForcePathStyleString , out s3ForcePathStyleOut ) )
982
+ {
983
+ Logger . GetLogger ( GetType ( ) ) . InfoFormat ( "Invalid value {0} for {1} in profile {2}. A boolean true/false is expected." , s3ForcePathStyleString , S3ForcePathStyleField , profileName ) ;
984
+ profile = null ;
985
+ return false ;
986
+ }
987
+ s3ForcePathStyle = s3ForcePathStyleOut ;
988
+ }
989
+
969
990
profile = new CredentialProfile ( profileName , profileOptions )
970
991
{
971
992
UniqueKey = toolkitArtifactGuid ,
@@ -992,7 +1013,8 @@ private bool TryGetProfile(string profileName, bool doRefresh, bool isSsoSession
992
1013
DisableRequestCompression = disableRequestCompression ,
993
1014
RequestMinCompressionSizeBytes = requestMinCompressionSizeBytes ,
994
1015
ClientAppId = clientAppId ,
995
- AccountIdEndpointMode = accountIdEndpointMode
1016
+ AccountIdEndpointMode = accountIdEndpointMode ,
1017
+ S3ForcePathStyle = s3ForcePathStyle
996
1018
} ;
997
1019
998
1020
if ( ! IsSupportedProfileType ( profile . ProfileType ) )
0 commit comments