Skip to content

Commit ad32d1b

Browse files
committed
Share region/useinternalurl/identityservice
Sharing these values will enable better logging in the future and enable making services from another service.
1 parent da478d7 commit ad32d1b

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/corelib/Serialization/ServiceEndpoint.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@ public class ServiceEndpoint
1919
{
2020
private readonly IServiceType _serviceType;
2121
private readonly IAuthenticationProvider _authenticationProvider;
22-
private readonly string _region;
23-
private readonly bool _useInternalUrl;
2422
private readonly string _microversion;
2523
private readonly string _microversionHeader;
2624

25+
/// <summary>
26+
/// The service region.
27+
/// </summary>
28+
public string Region { get; }
29+
30+
/// <summary>
31+
/// Specifies if internal URLs will be used.
32+
/// </summary>
33+
public bool UseInternalUrl { get; }
34+
2735
/// <summary>
2836
/// Initializes a new instance of the <see cref="ServiceEndpoint"/> class.
2937
/// </summary>
@@ -49,8 +57,8 @@ public ServiceEndpoint(IServiceType serviceType, IAuthenticationProvider authent
4957
{
5058
_serviceType = serviceType;
5159
_authenticationProvider = authenticationProvider;
52-
_region = region;
53-
_useInternalUrl = useInternalUrl;
60+
Region = region;
61+
UseInternalUrl = useInternalUrl;
5462
_microversion = microversion;
5563
_microversionHeader = microversionHeader;
5664
}
@@ -62,7 +70,7 @@ public ServiceEndpoint(IServiceType serviceType, IAuthenticationProvider authent
6270
/// <returns>A <see cref="Url"/> representing the service endpoint.</returns>
6371
public async Task<Url> GetEndpoint(CancellationToken cancellationToken)
6472
{
65-
string endpoint = await _authenticationProvider.GetEndpoint(_serviceType, _region, _useInternalUrl, cancellationToken).ConfigureAwait(false);
73+
string endpoint = await _authenticationProvider.GetEndpoint(_serviceType, Region, UseInternalUrl, cancellationToken).ConfigureAwait(false);
6674
return new Url(endpoint);
6775
}
6876

0 commit comments

Comments
 (0)