Skip to content

Commit

Permalink
Bump RestSharp from 108.0.2 to 112.0.0 in /coffeecard/CoffeeCard.Libr…
Browse files Browse the repository at this point in the history
…ary (#282)

Bumps [RestSharp](https://github.com/restsharp/RestSharp) from 108.0.2
to 112.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/restsharp/RestSharp/releases">RestSharp's
releases</a>.</em></p>
<blockquote>
<h2>112.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Don't allow CRLF in headers by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2258">restsharp/RestSharp#2258</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/MrFrawsty"><code>@​MrFrawsty</code></a>
made their first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2251">restsharp/RestSharp#2251</a></li>
<li><a href="https://github.com/snechaev"><code>@​snechaev</code></a>
made their first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2256">restsharp/RestSharp#2256</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/restsharp/RestSharp/compare/111.4.1...112.0.0">https://github.com/restsharp/RestSharp/compare/111.4.1...112.0.0</a></p>
<h2>111.4.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Allow setting parameter content type by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2249">restsharp/RestSharp#2249</a></li>
<li>Added extensions for getting content header values by <a
href="https://github.com/jizc"><code>@​jizc</code></a> in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2247">restsharp/RestSharp#2247</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/minhtaile2712"><code>@​minhtaile2712</code></a>
made their first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2243">restsharp/RestSharp#2243</a></li>
<li><a href="https://github.com/jizc"><code>@​jizc</code></a> made their
first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2247">restsharp/RestSharp#2247</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/restsharp/RestSharp/compare/111.4.0...111.4.1">https://github.com/restsharp/RestSharp/compare/111.4.0...111.4.1</a></p>
<h2>111.4.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Doc versions and response section by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2232">restsharp/RestSharp#2232</a></li>
<li>Re-instate old methods, but as obsolete by <a
href="https://github.com/matt-richardson"><code>@​matt-richardson</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2228">restsharp/RestSharp#2228</a></li>
<li>Header value null check by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2241">restsharp/RestSharp#2241</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/matt-richardson"><code>@​matt-richardson</code></a>
made their first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2228">restsharp/RestSharp#2228</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/restsharp/RestSharp/compare/111.3.0...111.4.0">https://github.com/restsharp/RestSharp/compare/111.3.0...111.4.0</a></p>
<h2>111.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix spelling in docs sidebar by <a
href="https://github.com/Strepto"><code>@​Strepto</code></a> in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2218">restsharp/RestSharp#2218</a></li>
<li>Use code generator for cloning responses by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2223">restsharp/RestSharp#2223</a></li>
<li>Extensions for client and response by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2221">restsharp/RestSharp#2221</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Strepto"><code>@​Strepto</code></a> made
their first contribution in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2218">restsharp/RestSharp#2218</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/restsharp/RestSharp/compare/111.2.0...111.3.0">https://github.com/restsharp/RestSharp/compare/111.2.0...111.3.0</a></p>
<h2>111.2.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix null reference exception when disposing response content by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2201">restsharp/RestSharp#2201</a></li>
<li>Add Version to RestRequest by <a
href="https://github.com/alexeyzimarev"><code>@​alexeyzimarev</code></a>
in <a
href="https://redirect.github.com/restsharp/RestSharp/pull/2209">restsharp/RestSharp#2209</a></li>
<li>Reverted authenticators rename</li>
<li>Returned back <code>Execute(request)</code> without method</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/restsharp/RestSharp/commit/0fba5e727d241b1867bd71efc912594075c2934b"><code>0fba5e7</code></a>
Don't allow CRLF in headers (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2258">#2258</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/7b7950b1b6cfb7f1251f6c2e4cf74062ace41e65"><code>7b7950b</code></a>
Fixed the Simple Factory example. Fixes <a
href="https://redirect.github.com/restsharp/RestSharp/issues/2255">#2255</a>
(<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2256">#2256</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/777bf194ec2d14271e7807cc704e73ec18fcaf7e"><code>777bf19</code></a>
Fixed sentence to be easier to read (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2251">#2251</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/6391624bfaaf3f4df56481d308e755e96b5eb1b9"><code>6391624</code></a>
Added extensions for getting content header values (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2247">#2247</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/75ccc0087efd78b3d1db0fe630e46582badfea43"><code>75ccc00</code></a>
Bump JetBrains.Annotations from 2023.3.0 to 2024.2.0 (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2237">#2237</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/875849372d672f408f50a2e88fe882995324c305"><code>8758493</code></a>
Correct typo (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2246">#2246</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/8fee05ddd05365d1f21c43e189504bcfa4aee757"><code>8fee05d</code></a>
Correct typo (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2244">#2244</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/6c596fe9f1ab8e8662467ab465520352678d00a1"><code>6c596fe</code></a>
Bump Polly from 8.3.1 to 8.4.1 (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2234">#2234</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/aa43b68851ed930712295e25150cf456feaf5d6e"><code>aa43b68</code></a>
Correct methods name (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2243">#2243</a>)</li>
<li><a
href="https://github.com/restsharp/RestSharp/commit/fef25a56d57f6ac8377d34ce50451ef3be95e9e7"><code>fef25a5</code></a>
Allow setting parameter content type (<a
href="https://redirect.github.com/restsharp/RestSharp/issues/2249">#2249</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/restsharp/RestSharp/compare/108.0.2...112.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=RestSharp&package-manager=nuget&previous-version=108.0.2&new-version=112.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/AnalogIO/analog-core/network/alerts).

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Trøstrup <andreastrstrup@gmail.com>
  • Loading branch information
dependabot[bot] and duckth authored Nov 17, 2024
1 parent af9c81e commit 69063b1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion coffeecard/CoffeeCard.Library/CoffeeCard.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="MimeKit" Version="4.7.1" />
<PackageReference Include="NetEscapades.Configuration.Validation" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="RestSharp" Version="108.0.2" />
<PackageReference Include="RestSharp" Version="112.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
<PackageReference Include="Serilog.Enrichers.CorrelationId" Version="3.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
Expand Down
16 changes: 9 additions & 7 deletions coffeecard/CoffeeCard.Library/Services/MailgunEmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

namespace CoffeeCard.Library.Services;

public class MailgunEmailSender(MailgunSettings mailgunSettings) : IEmailSender
public class MailgunEmailSender(MailgunSettings mailgunSettings, IRestClient restClient) : IEmailSender
{
public async Task SendEmailAsync(MimeMessage mail)
{
using var client = new RestClient(mailgunSettings.MailgunApiUrl);
client.Authenticator = new HttpBasicAuthenticator("api", mailgunSettings.ApiKey);

var request = new RestRequest();
request.AddParameter("domain", mailgunSettings.Domain, ParameterType.UrlSegment);
Expand All @@ -23,12 +21,16 @@ public async Task SendEmailAsync(MimeMessage mail)
request.AddParameter("html", mail.HtmlBody);
request.Method = Method.Post;

var response = await client.ExecutePostAsync(request);
var response = await restClient.ExecutePostAsync(request);

if (!response.IsSuccessful)
{
Log.Error("Error sending request to Mailgun. StatusCode: {statusCode} ErrorMessage: {errorMessage}",
response.StatusCode, response.ErrorMessage);
Log.Error(
"Error sending request to Mailgun. StatusCode: {statusCode} ErrorMessage: {errorMessage}",
response.StatusCode,
response.ErrorMessage
);
}
}
}
}

12 changes: 12 additions & 0 deletions coffeecard/CoffeeCard.WebApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
using NJsonSchema.Generation;
using NSwag;
using NSwag.Generation.Processors.Security;
using RestSharp;
using RestSharp.Authenticators;
using AccountService = CoffeeCard.Library.Services.AccountService;
using IAccountService = CoffeeCard.Library.Services.IAccountService;
using IPurchaseService = CoffeeCard.Library.Services.IPurchaseService;
Expand Down Expand Up @@ -95,6 +97,16 @@ public void ConfigureServices(IServiceCollection services)
services.AddScoped<ClaimsUtilities>();
services.AddSingleton(_environment.ContentRootFileProvider);

services.AddSingleton<IRestClient>(provider =>
{
var mailgunSettings = provider.GetRequiredService<MailgunSettings>();
var options = new RestClientOptions(mailgunSettings.MailgunApiUrl)
{
Authenticator = new HttpBasicAuthenticator("api", mailgunSettings.ApiKey),
};
return new RestClient(options);
});

services.AddScoped<Library.Services.v2.IPurchaseService, Library.Services.v2.PurchaseService>();
services.AddScoped<Library.Services.v2.ITicketService, Library.Services.v2.TicketService>();
services.AddMobilePayHttpClients(_configuration.GetSection("MobilePaySettingsV2").Get<MobilePaySettingsV2>());
Expand Down

0 comments on commit 69063b1

Please sign in to comment.