Skip to content

Commit cadc84f

Browse files
author
Anouar Hassine
committed
Refactoring some variables names and adding summary for some fields.
1 parent 77ceb77 commit cadc84f

File tree

7 files changed

+59
-26
lines changed

7 files changed

+59
-26
lines changed

ReactiveXComponent/Configuration/BusDetails.cs

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public BusDetails(
1818
int port,
1919
bool sslEnabled = false,
2020
string sslServerName = "",
21-
string sslCertPath = "",
22-
string sslCertPassphrase = "",
21+
string sslCertificatePath = "",
22+
string sslCertificatePassphrase = "",
2323
SslProtocols sslProtocol = SslProtocols.Default,
2424
bool sslAllowUntrustedServerCertificate = false)
2525
{
@@ -30,32 +30,65 @@ public BusDetails(
3030
Port = port;
3131
SslEnabled = sslEnabled;
3232
SslServerName = sslServerName;
33-
SslCertPath = sslCertPath;
34-
SslCertPassphrase = sslCertPassphrase;
33+
SslCertificatePath = sslCertificatePath;
34+
SslCertificatePassphrase = sslCertificatePassphrase;
3535
SslProtocol = sslProtocol;
3636
SslAllowUntrustedServerCertificate = sslAllowUntrustedServerCertificate;
3737
}
3838

39+
/// <summary>
40+
/// Rabbit Mq user.
41+
/// </summary>
3942
public string Username { get; set; }
4043

44+
/// <summary>
45+
/// Rabbit Mq password for user.
46+
/// </summary>
4147
public string Password { get; set; }
4248

49+
/// <summary>
50+
/// Rabbit Mq server's address.
51+
/// </summary>
4352
public string Host { get; set; }
4453

54+
/// <summary>
55+
/// Rabbit Mq virtual host to connect to.
56+
/// </summary>
4557
public string VirtualHost { get; set; }
4658

59+
/// <summary>
60+
/// Rabbit Mq server's port.
61+
/// </summary>
4762
public int Port { get; set; }
4863

64+
/// <summary>
65+
/// To enable SSL.
66+
/// </summary>
4967
public bool SslEnabled { get; set; }
5068

69+
/// <summary>
70+
/// Server's Common Name. It's indicated in the CN field of the server's certificate.
71+
/// </summary>
5172
public string SslServerName { get; set; }
5273

53-
public string SslCertPath { get; set; }
74+
/// <summary>
75+
/// Path to the client's certificate.
76+
/// </summary>
77+
public string SslCertificatePath { get; set; }
5478

55-
public string SslCertPassphrase { get; set; }
79+
/// <summary>
80+
/// Passphrase for the client's certificate if it has one.
81+
/// </summary>
82+
public string SslCertificatePassphrase { get; set; }
5683

84+
/// <summary>
85+
/// SSL protocol to use.
86+
/// </summary>
5787
public SslProtocols SslProtocol { get; set; }
5888

89+
/// <summary>
90+
/// To accept untrusted (e.g self-signed) server certificates. Only use this in Dev environment.
91+
/// </summary>
5992
public bool SslAllowUntrustedServerCertificate { get; set; }
6093

6194
public BusDetails Clone()
@@ -68,8 +101,8 @@ public BusDetails Clone()
68101
Port,
69102
SslEnabled,
70103
SslServerName,
71-
SslCertPath,
72-
SslCertPassphrase,
104+
SslCertificatePath,
105+
SslCertificatePassphrase,
73106
SslProtocol,
74107
SslAllowUntrustedServerCertificate);
75108
}

ReactiveXComponent/Configuration/ConfigurationOverrides.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public class ConfigurationOverrides
2121

2222
public string SslServerName { get; set; }
2323

24-
public string SslCertPath { get; set; }
24+
public string SslCertificatePath { get; set; }
2525

26-
public string SslCertPassphrase { get; set; }
26+
public string SslCertificatePassphrase { get; set; }
2727

2828
public SslProtocols? SslProtocol { get; set; }
2929

ReactiveXComponent/Configuration/XCApiTags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public static class XCApiTags
3333
public const string VirtualHost = "virtualHost";
3434
public const string BusSslEnabled = "sslEnabled";
3535
public const string BusSslServerName = "sslServerName";
36-
public const string BusSslCertPath = "sslCertPath";
37-
public const string BusSslCertPassphrase = "sslCertPassphrase";
36+
public const string BusSslCertificatePath = "sslCertPath";
37+
public const string BusSslCertificatePassphrase = "sslCertPassphrase";
3838
public const string BusSslProtocol = "sslProtocol";
3939
public const string BusSslAllowUntrustedServerCertificate = "sslAllowUntrustedServerCertificate";
4040
}

ReactiveXComponent/Parser/XCApiConfigParser.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ public BusDetails GetBusDetails()
192192
}
193193

194194
var sslServerName = busInfos?.Attribute(XCApiTags.BusSslServerName)?.Value;
195-
var sslCertPath = busInfos?.Attribute(XCApiTags.BusSslCertPath)?.Value;
196-
var sslCertPassphrase = busInfos?.Attribute(XCApiTags.BusSslCertPassphrase)?.Value;
195+
var sslCertificatePath = busInfos?.Attribute(XCApiTags.BusSslCertificatePath)?.Value;
196+
var sslCertificatePassphrase = busInfos?.Attribute(XCApiTags.BusSslCertificatePassphrase)?.Value;
197197

198198
var sslProtocolString = busInfos?.Attribute(XCApiTags.BusSslProtocol)?.Value;
199199
SslProtocols sslProtocol = SslProtocols.Default;
@@ -217,8 +217,8 @@ public BusDetails GetBusDetails()
217217
Convert.ToInt32(busInfos?.Attribute(XCApiTags.Port)?.Value),
218218
sslEnabled,
219219
sslServerName,
220-
sslCertPath,
221-
sslCertPassphrase,
220+
sslCertificatePath,
221+
sslCertificatePassphrase,
222222
sslProtocol,
223223
sslAllowUntrustedServerCertificate);
224224

ReactiveXComponent/RabbitMq/RabbitMqConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ public IXCSession CreateSession(ConfigurationOverrides configurationOverrides =
6060
busDetails.SslServerName = configurationOverrides.SslServerName;
6161
}
6262

63-
if (configurationOverrides.SslCertPath != null)
63+
if (configurationOverrides.SslCertificatePath != null)
6464
{
65-
busDetails.SslCertPath = configurationOverrides.SslCertPath;
65+
busDetails.SslCertificatePath = configurationOverrides.SslCertificatePath;
6666
}
6767

68-
if (configurationOverrides.SslCertPassphrase != null)
68+
if (configurationOverrides.SslCertificatePassphrase != null)
6969
{
70-
busDetails.SslCertPassphrase = configurationOverrides.SslCertPassphrase;
70+
busDetails.SslCertificatePassphrase = configurationOverrides.SslCertificatePassphrase;
7171
}
7272

7373
if (configurationOverrides.SslProtocol != null)

ReactiveXComponent/RabbitMq/RabbitMqSession.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ private void InitConnection(BusDetails busDetails)
4646

4747
_factory.Ssl.ServerName = busDetails.SslServerName;
4848

49-
if (!string.IsNullOrEmpty(busDetails.SslCertPath))
49+
if (!string.IsNullOrEmpty(busDetails.SslCertificatePath))
5050
{
51-
_factory.Ssl.CertPath = busDetails.SslCertPath;
51+
_factory.Ssl.CertPath = busDetails.SslCertificatePath;
5252
}
5353

54-
if (!string.IsNullOrEmpty(busDetails.SslCertPassphrase))
54+
if (!string.IsNullOrEmpty(busDetails.SslCertificatePassphrase))
5555
{
56-
_factory.Ssl.CertPassphrase = busDetails.SslCertPassphrase;
56+
_factory.Ssl.CertPassphrase = busDetails.SslCertificatePassphrase;
5757
}
5858

5959
_factory.Ssl.Version = busDetails.SslProtocol;

ReactiveXComponentTest/Configuration/ConfigurationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public void GetBusDetailsTest()
8181
Check.That(busDetails.Port).IsEqualTo(5671);
8282
Check.That(busDetails.SslEnabled).IsTrue();
8383
Check.That(busDetails.SslServerName).IsEqualTo("XComponent RMq");
84-
Check.That(busDetails.SslCertPath).IsEqualTo("some_cert_path");
85-
Check.That(busDetails.SslCertPassphrase).IsEqualTo("some_cert_pass");
84+
Check.That(busDetails.SslCertificatePath).IsEqualTo("some_cert_path");
85+
Check.That(busDetails.SslCertificatePassphrase).IsEqualTo("some_cert_pass");
8686
Check.That(busDetails.SslProtocol).IsEqualTo(SslProtocols.Default);
8787
Check.That(busDetails.SslAllowUntrustedServerCertificate).IsTrue();
8888
}

0 commit comments

Comments
 (0)