Skip to content

Commit ac52d31

Browse files
committed
fixup
1 parent 720c262 commit ac52d31

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

projects/RabbitMQ.Client.OAuth2/IOAuth2Client.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface IOAuth2Client
4242
/// <param name="cancellationToken">Cancellation token for this request</param>
4343
/// <returns>Token with Access and Refresh Token</returns>
4444
Task<IToken> RequestTokenAsync(CancellationToken cancellationToken = default);
45-
45+
4646
/// <summary>
4747
/// Request a new AccessToken using the Refresh Token from the Token Endpoint.
4848
/// </summary>

projects/RabbitMQ.Client.OAuth2/OAuth2Client.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ public class OAuth2ClientBuilder
4646
/// Discovery endpoint subpath for all OpenID Connect issuers.
4747
/// </summary>
4848
const string DISCOVERY_ENDPOINT = ".well-known/openid-configuration";
49-
49+
5050
private readonly string _clientId;
5151
private readonly string _clientSecret;
52-
52+
5353
// At least one of the following Uris is not null
5454
private readonly Uri? _tokenEndpoint;
5555
private readonly Uri? _issuer;
56-
56+
5757
private string? _scope;
5858
private IDictionary<string, string>? _additionalRequestParameters;
5959
private HttpClientHandler? _httpClientHandler;
@@ -72,10 +72,10 @@ public OAuth2ClientBuilder(string clientId, string clientSecret, Uri? tokenEndpo
7272
{
7373
_clientId = clientId ?? throw new ArgumentNullException(nameof(clientId));
7474
_clientSecret = clientSecret ?? throw new ArgumentNullException(nameof(clientSecret));
75-
75+
7676
if (tokenEndpoint is null && issuer is null)
7777
throw new ArgumentException("Either tokenEndpoint or issuer is required");
78-
78+
7979
_tokenEndpoint = tokenEndpoint;
8080
_issuer = issuer;
8181
}
@@ -136,7 +136,7 @@ public IOAuth2Client Build()
136136
Uri tokenEndpoint = GetTokenEndpointFromIssuerAsync().GetAwaiter().GetResult();
137137
return new OAuth2Client(_clientId, _clientSecret, tokenEndpoint, _scope, _additionalRequestParameters, _httpClientHandler);
138138
}
139-
139+
140140
return new OAuth2Client(_clientId, _clientSecret, _tokenEndpoint,
141141
_scope, _additionalRequestParameters, _httpClientHandler);
142142
}
@@ -155,7 +155,7 @@ public async ValueTask<IOAuth2Client> BuildAsync(CancellationToken cancellationT
155155
return new OAuth2Client(_clientId, _clientSecret, tokenEndpoint,
156156
_scope, _additionalRequestParameters, _httpClientHandler);
157157
}
158-
158+
159159
return new OAuth2Client(_clientId, _clientSecret, _tokenEndpoint,
160160
_scope, _additionalRequestParameters, _httpClientHandler);
161161
}
@@ -171,18 +171,18 @@ private async Task<Uri> GetTokenEndpointFromIssuerAsync(CancellationToken cancel
171171
{
172172
throw new InvalidOperationException("The issuer is required");
173173
}
174-
174+
175175
using HttpClient httpClient = _httpClientHandler is null
176-
? new HttpClient()
176+
? new HttpClient()
177177
: new HttpClient(_httpClientHandler, false);
178178

179179
httpClient.DefaultRequestHeaders.Accept.Clear();
180180
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
181-
181+
182182
// Build endpoint from Issuer and dicovery endpoint, we can't use the Uri overload because the Issuer Uri may not have a trailing '/'
183183
string tempIssuer = _issuer.AbsoluteUri.EndsWith("/") ? _issuer.AbsoluteUri : _issuer.AbsoluteUri + "/";
184184
Uri discoveryEndpoint = new Uri(tempIssuer + DISCOVERY_ENDPOINT);
185-
185+
186186
using HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Get, discoveryEndpoint);
187187
using HttpResponseMessage response = await httpClient.SendAsync(req, cancellationToken)
188188
.ConfigureAwait(false);
@@ -237,8 +237,8 @@ public OAuth2Client(string clientId, string clientSecret, Uri tokenEndpoint,
237237
_additionalRequestParameters = additionalRequestParameters ?? EMPTY;
238238
_tokenEndpoint = tokenEndpoint;
239239

240-
_httpClient = httpClientHandler is null
241-
? new HttpClient()
240+
_httpClient = httpClientHandler is null
241+
? new HttpClient()
242242
: new HttpClient(httpClientHandler, false);
243243

244244
_httpClient.DefaultRequestHeaders.Accept.Clear();

0 commit comments

Comments
 (0)