SMS služba: prostředník nad SMS-Služba.cz (API XML 3.0)
- JSON API /v1: odeslání SMS, doručenka, události, potvrzení událostí, kredit - vlastní API klíč pro každou aplikaci (X-Api-Key, API_KEYS) - po chybě přihlášení k bráně se volání zastaví, aby se účet nezablokoval - heslo maskované v logu, odeslání se nikdy neopakuje automaticky - /health, /docs a OpenAPI s prefixem z ROOT_PATH - .NET 10, šablona .NET 8 nahrazena projektem v src/, testy v tests/ - dokumentace: návrh, stav a návod pro napojení aplikací
This commit is contained in:
@@ -0,0 +1,245 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Api;
|
||||
|
||||
public sealed class ApiTests : IDisposable
|
||||
{
|
||||
private const string SendSuccessXml = """
|
||||
<messages>
|
||||
<message>
|
||||
<id>420603123456-20261020120000123</id>
|
||||
<text>Test</text>
|
||||
<send_at>20261020120000</send_at>
|
||||
<recipient>+420603123456</recipient>
|
||||
<parts>1</parts>
|
||||
<price>0.68</price>
|
||||
</message>
|
||||
<credit>453.49</credit>
|
||||
</messages>
|
||||
""";
|
||||
|
||||
private readonly FakeGatewayHandler _gateway = new();
|
||||
private readonly SmsApiFactory _factory;
|
||||
private readonly HttpClient _client;
|
||||
|
||||
public ApiTests()
|
||||
{
|
||||
_factory = new SmsApiFactory(_gateway);
|
||||
_client = _factory.CreateClient();
|
||||
_client.DefaultRequestHeaders.Add("X-Api-Key", SmsApiFactory.ApiKey);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_client.Dispose();
|
||||
_factory.Dispose();
|
||||
_gateway.Dispose();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Health_WithoutApiKey_ReturnsOk()
|
||||
{
|
||||
using var anonymous = _factory.CreateClient();
|
||||
|
||||
var response = await anonymous.GetAsync(new Uri("/health", UriKind.Relative));
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Empty(_gateway.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task V1_WithWrongApiKey_Returns401WithCode()
|
||||
{
|
||||
using var anonymous = _factory.CreateClient();
|
||||
anonymous.DefaultRequestHeaders.Add("X-Api-Key", "wrong");
|
||||
|
||||
var response = await anonymous.GetAsync(new Uri("/v1/account/credit", UriKind.Relative));
|
||||
|
||||
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
|
||||
Assert.Equal("unauthorized", (await ReadJson(response)).GetProperty("code").GetString());
|
||||
Assert.Empty(_gateway.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendMessage_Success_ReturnsGatewayResultAndSendsXml()
|
||||
{
|
||||
_gateway.Enqueue(SendSuccessXml);
|
||||
|
||||
var response = await _client.PostAsJsonAsync("/v1/messages", new { to = "+420603123456", text = "Test & co", deliveryReport = true });
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var json = await ReadJson(response);
|
||||
Assert.Equal("420603123456-20261020120000123", json.GetProperty("id").GetString());
|
||||
Assert.Equal(1, json.GetProperty("parts").GetInt32());
|
||||
Assert.Equal(0.68m, json.GetProperty("price").GetDecimal());
|
||||
Assert.Equal(453.49m, json.GetProperty("credit").GetDecimal());
|
||||
|
||||
var (uri, body) = Assert.Single(_gateway.Requests);
|
||||
Assert.EndsWith("/apixml30/receiver", uri.AbsolutePath, StringComparison.Ordinal);
|
||||
Assert.Contains("password=" + SmsApiFactory.GatewayPassword, uri.Query, StringComparison.Ordinal);
|
||||
var sent = XDocument.Parse(body!).Root!;
|
||||
Assert.Equal("Test & co", sent.Element("text")?.Value);
|
||||
Assert.Equal("20", sent.Element("dr_request")?.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendMessage_InvalidRecipient_Returns400WithProviderCode()
|
||||
{
|
||||
_gateway.Enqueue("<status><id>400;1</id><message>Chybne telefonni cislo 77716085</message></status>");
|
||||
|
||||
var response = await _client.PostAsJsonAsync("/v1/messages", new { to = "77716085", text = "Test" });
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
var json = await ReadJson(response);
|
||||
Assert.Equal("invalid_recipient", json.GetProperty("code").GetString());
|
||||
Assert.Equal("400;1", json.GetProperty("providerCode").GetString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendMessage_TextTooLong_DoesNotCallGateway()
|
||||
{
|
||||
var response = await _client.PostAsJsonAsync("/v1/messages", new { to = "+420603123456", text = new string('a', 460) });
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
Assert.Equal("text_too_long", (await ReadJson(response)).GetProperty("code").GetString());
|
||||
Assert.Empty(_gateway.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendMessage_InvalidJson_Returns400WithCode()
|
||||
{
|
||||
using var content = new StringContent("{not json", System.Text.Encoding.UTF8, "application/json");
|
||||
|
||||
var response = await _client.PostAsync(new Uri("/v1/messages", UriKind.Relative), content);
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
Assert.Equal("validation_failed", (await ReadJson(response)).GetProperty("code").GetString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendMessage_Timeout_Returns504()
|
||||
{
|
||||
_gateway.EnqueueException(new TaskCanceledException("timeout", new TimeoutException()));
|
||||
|
||||
var response = await _client.PostAsJsonAsync("/v1/messages", new { to = "+420603123456", text = "Test" });
|
||||
|
||||
Assert.Equal(HttpStatusCode.GatewayTimeout, response.StatusCode);
|
||||
Assert.Equal("provider_timeout", (await ReadJson(response)).GetProperty("code").GetString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AuthFailure_StopsAllFurtherGatewayCalls()
|
||||
{
|
||||
_gateway.Enqueue("<status><id>401</id><message>Chybne prihlaseni</message></status>");
|
||||
|
||||
var first = await _client.PostAsJsonAsync("/v1/messages", new { to = "+420603123456", text = "Test" });
|
||||
var second = await _client.GetAsync(new Uri("/v1/account/credit", UriKind.Relative));
|
||||
var health = await ReadJson(await _client.GetAsync(new Uri("/health", UriKind.Relative)));
|
||||
|
||||
Assert.Equal(HttpStatusCode.ServiceUnavailable, first.StatusCode);
|
||||
Assert.Equal(HttpStatusCode.ServiceUnavailable, second.StatusCode);
|
||||
Assert.Equal("provider_auth_blocked", (await ReadJson(second)).GetProperty("code").GetString());
|
||||
Assert.Equal("blocked", health.GetProperty("gateway").GetString());
|
||||
Assert.Single(_gateway.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetEvents_ReturnsTypedEventsAndQueriesGateway()
|
||||
{
|
||||
_gateway.Enqueue("""
|
||||
<messages>
|
||||
<message><type>answer_message</type><id>in-2</id><text>ANO</text><in_reply_to>out-1</in_reply_to><sender>+420777123456</sender><recipient>5517</recipient></message>
|
||||
<message><type>delivery_report</type><id>out-1</id><status>0</status><description>Doručeno</description></message>
|
||||
</messages>
|
||||
""");
|
||||
|
||||
var response = await _client.GetAsync(new Uri("/v1/events?count=10", UriKind.Relative));
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var events = (await ReadJson(response)).GetProperty("events");
|
||||
Assert.Equal("answer", events[0].GetProperty("type").GetString());
|
||||
Assert.Equal("out-1", events[0].GetProperty("inReplyTo").GetString());
|
||||
Assert.Equal("deliveryReport", events[1].GetProperty("type").GetString());
|
||||
Assert.Equal("out-1", events[1].GetProperty("messageId").GetString());
|
||||
|
||||
var query = Assert.Single(_gateway.Requests).Uri.Query;
|
||||
Assert.Contains("query_incoming=1", query, StringComparison.Ordinal);
|
||||
Assert.Contains("query_delivery_report=1", query, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("query_outgoing", query, StringComparison.Ordinal);
|
||||
Assert.Contains("count=10", query, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ConfirmEvents_MapsTypesAndReportsFailures()
|
||||
{
|
||||
_gateway.Enqueue("<status><id>200</id><message>OK</message></status>");
|
||||
_gateway.Enqueue("<status><id>503</id><message>Chyba brany</message></status>");
|
||||
|
||||
var response = await _client.PostAsJsonAsync("/v1/events/confirm", new
|
||||
{
|
||||
events = new[]
|
||||
{
|
||||
new { type = "answer", id = "in-2" },
|
||||
new { type = "deliveryReport", id = "out-1" },
|
||||
},
|
||||
});
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var json = await ReadJson(response);
|
||||
Assert.Equal("in-2", json.GetProperty("confirmed")[0].GetProperty("id").GetString());
|
||||
Assert.Equal("provider_unavailable", json.GetProperty("failed")[0].GetProperty("code").GetString());
|
||||
Assert.Contains("type=incoming_message", _gateway.Requests[0].Uri.Query, StringComparison.Ordinal);
|
||||
Assert.Contains("type=delivery_report", _gateway.Requests[1].Uri.Query, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ConfirmEvents_UnknownType_Returns400WithoutGatewayCall()
|
||||
{
|
||||
var response = await _client.PostAsJsonAsync("/v1/events/confirm", new { events = new[] { new { type = "sms", id = "1" } } });
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
Assert.Empty(_gateway.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DeliveryReport_NotAvailable_Returns404()
|
||||
{
|
||||
_gateway.Enqueue("<messages />");
|
||||
|
||||
var response = await _client.GetAsync(new Uri("/v1/messages/out-1/delivery-report", UriKind.Relative));
|
||||
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
Assert.Equal("delivery_report_not_found", (await ReadJson(response)).GetProperty("code").GetString());
|
||||
Assert.Contains("act=get_delivery_report", Assert.Single(_gateway.Requests).Uri.Query, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task OpenApi_DescribesApiKeyAndRelativeServer()
|
||||
{
|
||||
var json = await ReadJson(await _client.GetAsync(new Uri("/openapi/v1.json", UriKind.Relative)));
|
||||
|
||||
Assert.Equal("/", json.GetProperty("servers")[0].GetProperty("url").GetString());
|
||||
var scheme = json.GetProperty("components").GetProperty("securitySchemes").GetProperty("ApiKey");
|
||||
Assert.Equal("X-Api-Key", scheme.GetProperty("name").GetString());
|
||||
var send = json.GetProperty("paths").GetProperty("/v1/messages").GetProperty("post");
|
||||
Assert.True(send.GetProperty("security")[0].TryGetProperty("ApiKey", out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Docs_RedirectsRelatively()
|
||||
{
|
||||
using var client = _factory.CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false });
|
||||
|
||||
var response = await client.GetAsync(new Uri("/docs", UriKind.Relative));
|
||||
|
||||
Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
|
||||
Assert.Equal("docs/index.html", response.Headers.Location?.OriginalString);
|
||||
}
|
||||
|
||||
private static async Task<JsonElement> ReadJson(HttpResponseMessage response) =>
|
||||
JsonDocument.Parse(await response.Content.ReadAsStringAsync()).RootElement.Clone();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Api;
|
||||
|
||||
/// <summary>Stands in for the SMS gateway: returns queued responses and records every request.</summary>
|
||||
internal sealed class FakeGatewayHandler : HttpMessageHandler
|
||||
{
|
||||
private readonly Queue<Func<HttpResponseMessage>> _responses = new();
|
||||
|
||||
public List<(Uri Uri, string? Body)> Requests { get; } = [];
|
||||
|
||||
public void Enqueue(string body, HttpStatusCode status = HttpStatusCode.OK) =>
|
||||
_responses.Enqueue(() => new HttpResponseMessage(status)
|
||||
{
|
||||
Content = new StringContent(body, Encoding.UTF8, "application/xml"),
|
||||
});
|
||||
|
||||
public void EnqueueException(Exception exception) => _responses.Enqueue(() => throw exception);
|
||||
|
||||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
var body = request.Content is null ? null : await request.Content.ReadAsStringAsync(cancellationToken);
|
||||
Requests.Add((request.RequestUri!, body));
|
||||
|
||||
if (_responses.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Unexpected gateway call: " + request.RequestUri);
|
||||
}
|
||||
|
||||
return _responses.Dequeue()();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SmsSluzba.Api.Config;
|
||||
using SmsSluzba.Api.Gateway;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Api;
|
||||
|
||||
internal sealed class SmsApiFactory(FakeGatewayHandler gateway) : WebApplicationFactory<Program>
|
||||
{
|
||||
public const string ApiKey = "test-key-eshop";
|
||||
public const string GatewayPassword = "gateway-password";
|
||||
|
||||
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||||
{
|
||||
builder.UseSetting(AppSettingsLoader.LoginKey, "gateway-login");
|
||||
builder.UseSetting(AppSettingsLoader.PasswordKey, GatewayPassword);
|
||||
builder.UseSetting(AppSettingsLoader.ApiKeysKey, "eshop=" + ApiKey);
|
||||
builder.ConfigureTestServices(services =>
|
||||
services.AddHttpClient<SmsGatewayClient>().ConfigurePrimaryHttpMessageHandler(() => gateway));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using SmsSluzba.Api.Config;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Config;
|
||||
|
||||
public class AppSettingsLoaderTests
|
||||
{
|
||||
[Fact]
|
||||
public void Load_ValidConfiguration_AppliesDefaultsAndNormalizesRootPath()
|
||||
{
|
||||
var settings = AppSettingsLoader.Load(Build(new()
|
||||
{
|
||||
["ROOT_PATH"] = "apps/sms-sluzba/",
|
||||
["SMSSLUZBA_LOGIN"] = "login",
|
||||
["SMSSLUZBA_PASSWORD"] = "password",
|
||||
["API_KEYS"] = "eshop=key-one; cms=key-two",
|
||||
}));
|
||||
|
||||
Assert.Equal("/apps/sms-sluzba", settings.RootPath);
|
||||
Assert.Equal(new Uri("https://smsgateapi.sms-sluzba.cz/apixml30/"), settings.Gateway.BaseUrl);
|
||||
Assert.Equal(TimeSpan.FromSeconds(30), settings.Gateway.Timeout);
|
||||
Assert.Equal(new[] { "eshop", "cms" }, settings.ApiClients.Select(c => c.Name));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_InvalidConfiguration_ListsProblemsWithoutSecretValues()
|
||||
{
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => AppSettingsLoader.Load(Build(new()
|
||||
{
|
||||
["SMSSLUZBA_PASSWORD"] = "password",
|
||||
["SMSSLUZBA_TIMEOUT_SECONDS"] = "abc",
|
||||
["API_KEYS"] = "eshop=very-secret-key;broken",
|
||||
})));
|
||||
|
||||
Assert.Contains("SMSSLUZBA_LOGIN", ex.Message, StringComparison.Ordinal);
|
||||
Assert.Contains("SMSSLUZBA_TIMEOUT_SECONDS", ex.Message, StringComparison.Ordinal);
|
||||
Assert.Contains("položka 2", ex.Message, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("very-secret-key", ex.Message, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_DuplicateKey_Fails()
|
||||
{
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => AppSettingsLoader.Load(Build(new()
|
||||
{
|
||||
["SMSSLUZBA_LOGIN"] = "login",
|
||||
["SMSSLUZBA_PASSWORD"] = "password",
|
||||
["API_KEYS"] = "eshop=same;cms=same",
|
||||
})));
|
||||
|
||||
Assert.Contains("cms", ex.Message, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_HttpBaseUrl_Fails()
|
||||
{
|
||||
Assert.Throws<InvalidOperationException>(() => AppSettingsLoader.Load(Build(new()
|
||||
{
|
||||
["SMSSLUZBA_LOGIN"] = "login",
|
||||
["SMSSLUZBA_PASSWORD"] = "password",
|
||||
["SMSSLUZBA_BASE_URL"] = "http://example.com/",
|
||||
["API_KEYS"] = "eshop=key",
|
||||
})));
|
||||
}
|
||||
|
||||
private static IConfiguration Build(Dictionary<string, string?> values) =>
|
||||
new ConfigurationBuilder().AddInMemoryCollection(values).Build();
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using SmsSluzba.Api.Gateway;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Gateway;
|
||||
|
||||
public class GatewayEventQueryTests
|
||||
{
|
||||
[Fact]
|
||||
public void Parse_Empty_ReturnsDefault()
|
||||
{
|
||||
Assert.Equal(GatewayEventQuery.Default, GatewayEventQuery.Parse(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Parse_List_SetsFlags()
|
||||
{
|
||||
var query = GatewayEventQuery.Parse("deliveryReport, outgoing");
|
||||
|
||||
Assert.NotNull(query);
|
||||
Assert.False(query.Incoming);
|
||||
Assert.True(query.DeliveryReports);
|
||||
Assert.True(query.Outgoing);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Parse_UnknownType_ReturnsNull()
|
||||
{
|
||||
Assert.Null(GatewayEventQuery.Parse("incoming,sms"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("incoming", "incoming_message")]
|
||||
[InlineData("answer", "incoming_message")]
|
||||
[InlineData("deliveryReport", "delivery_report")]
|
||||
[InlineData("outgoing", "outgoing_message")]
|
||||
[InlineData("other", null)]
|
||||
public void ConfirmTypeFor_MapsApiTypes(string apiType, string? expected)
|
||||
{
|
||||
Assert.Equal(expected, GatewayEventQuery.ConfirmTypeFor(apiType));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System.Net;
|
||||
using SmsSluzba.Api.Gateway;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Gateway;
|
||||
|
||||
public class GatewayResponseTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("400;1", nameof(GatewayErrorKind.InvalidRecipient))]
|
||||
[InlineData("400;2", nameof(GatewayErrorKind.MissingText))]
|
||||
[InlineData("400", nameof(GatewayErrorKind.Rejected))]
|
||||
[InlineData("401", nameof(GatewayErrorKind.AuthFailed))]
|
||||
[InlineData("401;1", nameof(GatewayErrorKind.AuthFailed))]
|
||||
[InlineData("402", nameof(GatewayErrorKind.InsufficientCredit))]
|
||||
[InlineData("503", nameof(GatewayErrorKind.Unavailable))]
|
||||
[InlineData("999", nameof(GatewayErrorKind.Unavailable))]
|
||||
public void Interpret_StatusInBody_ThrowsMappedKind(string code, string expectedKind)
|
||||
{
|
||||
var body = $"<status><id>{code}</id><message>Popis</message></status>";
|
||||
|
||||
var ex = Assert.Throws<GatewayException>(() => GatewayResponse.Interpret(HttpStatusCode.OK, body));
|
||||
|
||||
Assert.Equal(expectedKind, ex.Kind.ToString());
|
||||
Assert.Equal(code, ex.ProviderCode);
|
||||
Assert.Equal("Popis", ex.ProviderMessage);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HttpStatusCode.BadRequest, nameof(GatewayErrorKind.Rejected))]
|
||||
[InlineData(HttpStatusCode.Unauthorized, nameof(GatewayErrorKind.AuthFailed))]
|
||||
[InlineData(HttpStatusCode.PaymentRequired, nameof(GatewayErrorKind.InsufficientCredit))]
|
||||
[InlineData(HttpStatusCode.BadGateway, nameof(GatewayErrorKind.Unavailable))]
|
||||
public void Interpret_HttpErrorWithoutXml_ThrowsMappedKind(HttpStatusCode status, string expectedKind)
|
||||
{
|
||||
var ex = Assert.Throws<GatewayException>(() => GatewayResponse.Interpret(status, "<html>error</html"));
|
||||
|
||||
Assert.Equal(expectedKind, ex.Kind.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Interpret_StatusOk_ReturnsDocument()
|
||||
{
|
||||
var document = GatewayResponse.Interpret(HttpStatusCode.OK, "<status><id>200</id><message>OK</message></status>");
|
||||
|
||||
Assert.NotNull(document);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Interpret_EmptySuccess_ReturnsNull()
|
||||
{
|
||||
Assert.Null(GatewayResponse.Interpret(HttpStatusCode.OK, string.Empty));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Interpret_ErrorCodeInBodyWinsOverHttpStatus()
|
||||
{
|
||||
var ex = Assert.Throws<GatewayException>(() =>
|
||||
GatewayResponse.Interpret(HttpStatusCode.BadRequest, "<status><id>400;1</id><message>x</message></status>"));
|
||||
|
||||
Assert.Equal(GatewayErrorKind.InvalidRecipient, ex.Kind);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using SmsSluzba.Api.Gateway;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Gateway;
|
||||
|
||||
public class GatewayTimeTests
|
||||
{
|
||||
[Fact]
|
||||
public void FromGateway_Winter_UsesCet()
|
||||
{
|
||||
Assert.Equal(new DateTimeOffset(2026, 1, 20, 11, 0, 0, TimeSpan.Zero), GatewayTime.FromGateway("20260120120000"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FromGateway_Summer_UsesCest()
|
||||
{
|
||||
Assert.Equal(new DateTimeOffset(2026, 7, 20, 10, 0, 0, TimeSpan.Zero), GatewayTime.FromGateway("20260720120000"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData("2026-01-20")]
|
||||
public void FromGateway_InvalidValue_ReturnsNull(string? value)
|
||||
{
|
||||
Assert.Null(GatewayTime.FromGateway(value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToGateway_ConvertsUtcToPragueTime()
|
||||
{
|
||||
Assert.Equal("20260120120000", GatewayTime.ToGateway(new DateTimeOffset(2026, 1, 20, 11, 0, 0, TimeSpan.Zero)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
using System.Xml.Linq;
|
||||
using SmsSluzba.Api.Contracts;
|
||||
using SmsSluzba.Api.Gateway;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Gateway;
|
||||
|
||||
public class GatewayXmlTests
|
||||
{
|
||||
[Fact]
|
||||
public void BuildOutgoingMessage_EscapesTextAndWritesOptionalElements()
|
||||
{
|
||||
var sendAt = new DateTimeOffset(2026, 10, 21, 8, 0, 0, TimeSpan.FromHours(2));
|
||||
|
||||
var xml = GatewayXml.BuildOutgoingMessage("+420603123456", "A & B <C>", true, sendAt);
|
||||
|
||||
Assert.StartsWith("<?xml", xml, StringComparison.Ordinal);
|
||||
Assert.Contains("A & B <C>", xml, StringComparison.Ordinal);
|
||||
var root = XDocument.Parse(xml).Root!;
|
||||
Assert.Equal("outgoing_message", root.Name.LocalName);
|
||||
Assert.Equal("20", root.Element("dr_request")?.Value);
|
||||
Assert.Equal("A & B <C>", root.Element("text")?.Value);
|
||||
Assert.Equal("+420603123456", root.Element("recipient")?.Value);
|
||||
Assert.Equal("20261021080000", root.Element("send_at")?.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildOutgoingMessage_WithoutOptionalValues_OmitsElements()
|
||||
{
|
||||
var root = XDocument.Parse(GatewayXml.BuildOutgoingMessage("603123456", "Test", null, null)).Root!;
|
||||
|
||||
Assert.Null(root.Element("dr_request"));
|
||||
Assert.Null(root.Element("send_at"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildOutgoingMessage_DeliveryReportFalse_WritesZero()
|
||||
{
|
||||
var root = XDocument.Parse(GatewayXml.BuildOutgoingMessage("603123456", "Test", false, null)).Root!;
|
||||
|
||||
Assert.Equal("0", root.Element("dr_request")?.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseSendResult_ReadsAllFields()
|
||||
{
|
||||
var document = XDocument.Parse("""
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<messages>
|
||||
<message>
|
||||
<id>420777123456-20080404153039854</id>
|
||||
<text>text zpravy</text>
|
||||
<send_at>20080404153038</send_at>
|
||||
<recipient>+420777123456</recipient>
|
||||
<parts>1</parts>
|
||||
<price>0.80</price>
|
||||
</message>
|
||||
<credit>168.85</credit>
|
||||
</messages>
|
||||
""");
|
||||
|
||||
var result = GatewayXml.ParseSendResult(document);
|
||||
|
||||
Assert.Equal("420777123456-20080404153039854", result.Id);
|
||||
Assert.Equal("+420777123456", result.Recipient);
|
||||
Assert.Equal(new DateTimeOffset(2008, 4, 4, 13, 30, 38, TimeSpan.Zero), result.SendAt);
|
||||
Assert.Equal(1, result.Parts);
|
||||
Assert.Equal(0.80m, result.Price);
|
||||
Assert.Equal(168.85m, result.Credit);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseSendResult_WithoutId_ThrowsInvalidResponse()
|
||||
{
|
||||
var document = XDocument.Parse("<messages><message><parts>1</parts></message></messages>");
|
||||
|
||||
var ex = Assert.Throws<GatewayException>(() => GatewayXml.ParseSendResult(document));
|
||||
Assert.Equal(GatewayErrorKind.InvalidResponse, ex.Kind);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseEvents_ReadsAllTypesAndSkipsUnknown()
|
||||
{
|
||||
var document = XDocument.Parse("""
|
||||
<messages>
|
||||
<message>
|
||||
<type>incoming_message</type>
|
||||
<id>in-1</id>
|
||||
<text>dotaz</text>
|
||||
<sent_at>20260120072542</sent_at>
|
||||
<sender>+420777123456</sender>
|
||||
<recipient>5517</recipient>
|
||||
</message>
|
||||
<message>
|
||||
<type>answer_message</type>
|
||||
<id>in-2</id>
|
||||
<text>ANO</text>
|
||||
<sent_at>20260120072542</sent_at>
|
||||
<in_reply_to>out-1</in_reply_to>
|
||||
<sender>+420777123456</sender>
|
||||
<recipient>5517</recipient>
|
||||
</message>
|
||||
<message>
|
||||
<type>delivery_report</type>
|
||||
<id>out-1</id>
|
||||
<delivery_timestamp>20260120114428</delivery_timestamp>
|
||||
<status>0</status>
|
||||
<description>Doručeno</description>
|
||||
</message>
|
||||
<message>
|
||||
<type>gate_outgoing_message</type>
|
||||
<id>out-2</id>
|
||||
<text>z portalu</text>
|
||||
<send_at>20260120065600</send_at>
|
||||
<recipient>+420777123456</recipient>
|
||||
</message>
|
||||
<message>
|
||||
<type>api_outgoing_message</type>
|
||||
<id>out-3</id>
|
||||
<text>z api</text>
|
||||
<send_at>20260120065600</send_at>
|
||||
<recipient>+420777123456</recipient>
|
||||
</message>
|
||||
<message>
|
||||
<type>something_new</type>
|
||||
<id>x-1</id>
|
||||
</message>
|
||||
</messages>
|
||||
""");
|
||||
|
||||
var parsed = GatewayXml.ParseEvents(document);
|
||||
|
||||
Assert.Equal(5, parsed.Events.Count);
|
||||
var incoming = Assert.IsType<IncomingSmsEvent>(parsed.Events[0]);
|
||||
Assert.Equal("+420777123456", incoming.From);
|
||||
Assert.Equal("5517", incoming.To);
|
||||
Assert.Equal(new DateTimeOffset(2026, 1, 20, 6, 25, 42, TimeSpan.Zero), incoming.SentAt);
|
||||
|
||||
var answer = Assert.IsType<AnswerSmsEvent>(parsed.Events[1]);
|
||||
Assert.Equal("out-1", answer.InReplyTo);
|
||||
|
||||
var report = Assert.IsType<DeliveryReportSmsEvent>(parsed.Events[2]);
|
||||
Assert.Equal("out-1", report.MessageId);
|
||||
Assert.Equal(0, report.Status);
|
||||
Assert.Equal("Doručeno", report.Description);
|
||||
|
||||
Assert.Equal("portal", Assert.IsType<OutgoingSmsEvent>(parsed.Events[3]).Source);
|
||||
Assert.Equal("api", Assert.IsType<OutgoingSmsEvent>(parsed.Events[4]).Source);
|
||||
Assert.Equal(new[] { "something_new" }, parsed.SkippedTypes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseEvents_EmptyDocument_ReturnsNoEvents()
|
||||
{
|
||||
var parsed = GatewayXml.ParseEvents(XDocument.Parse("<messages />"));
|
||||
|
||||
Assert.Empty(parsed.Events);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseCredit_ReadsAllPrices()
|
||||
{
|
||||
var document = XDocument.Parse("""
|
||||
<info>
|
||||
<credit>454.17</credit>
|
||||
<price_cz_sms>0.68</price_cz_sms>
|
||||
<price_sk_sms>0.78</price_sk_sms>
|
||||
<price_other_sms>1.80</price_other_sms>
|
||||
</info>
|
||||
""");
|
||||
|
||||
var credit = GatewayXml.ParseCredit(document);
|
||||
|
||||
Assert.Equal(new CreditResponse(454.17m, 0.68m, 0.78m, 1.80m), credit);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryParse_NonXml_ReturnsNull()
|
||||
{
|
||||
Assert.Null(GatewayXml.TryParse("<html><body>Bad gateway"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryParse_Dtd_IsRejected()
|
||||
{
|
||||
Assert.Null(GatewayXml.TryParse("<!DOCTYPE x [<!ENTITY a \"b\">]><x>&a;</x>"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using SmsSluzba.Api.Logging;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Logging;
|
||||
|
||||
public class LogMaskTests
|
||||
{
|
||||
[Fact]
|
||||
public void Url_MasksPassword()
|
||||
{
|
||||
var masked = LogMask.Url(new Uri("https://gate.example/apixml30/sender?login=a&password=tajne%26heslo&count=30"));
|
||||
|
||||
Assert.Equal("https://gate.example/apixml30/sender?login=a&password=***&count=30", masked);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("+420724123234", "+420724***234")]
|
||||
[InlineData("724123234", "724***234")]
|
||||
[InlineData("5517", "***")]
|
||||
[InlineData(null, "")]
|
||||
public void Phone_KeepsPrefixAndSuffix(string? number, string expected)
|
||||
{
|
||||
Assert.Equal(expected, LogMask.Phone(number));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using SmsSluzba.Api.Messages;
|
||||
|
||||
namespace SmsSluzba.Api.Tests.Messages;
|
||||
|
||||
public class SmsTextTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Ahoj", 4)]
|
||||
[InlineData("Příliš žluťoučký", 16)]
|
||||
[InlineData("Cena 10 €", 10)]
|
||||
[InlineData("[a]{b}", 10)]
|
||||
public void CountLength_CountsExtensionCharactersTwice(string text, int expected)
|
||||
{
|
||||
Assert.Equal(expected, SmsText.CountLength(text));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CountLength_MaximumText_FitsLimit()
|
||||
{
|
||||
Assert.Equal(SmsText.MaxLength, SmsText.CountLength(new string('a', SmsText.MaxLength)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\SmsSluzba.Api\SmsSluzba.Api.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,430 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
"net10.0": {
|
||||
"Microsoft.AspNetCore.Mvc.Testing": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "AiQkwLuYCtZoWD1lm6ll/tqVf+u1GVdVJw+EEBQnCOgdofcwpMCnZ6h8HEwD04rOdmF1v+pVfGzr9HFCmq3zdw==",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.TestHost": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyModel": "10.0.13",
|
||||
"Microsoft.Extensions.Hosting": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.Test.Sdk": {
|
||||
"type": "Direct",
|
||||
"requested": "[17.14.1, )",
|
||||
"resolved": "17.14.1",
|
||||
"contentHash": "HJKqKOE+vshXra2aEHpi2TlxYX7Z9VFYkr+E5rwEvHC8eIXiyO+K9kNm8vmNom3e2rA56WqxU+/N9NJlLGXsJQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.CodeCoverage": "17.14.1",
|
||||
"Microsoft.TestPlatform.TestHost": "17.14.1"
|
||||
}
|
||||
},
|
||||
"xunit": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.9.3, )",
|
||||
"resolved": "2.9.3",
|
||||
"contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==",
|
||||
"dependencies": {
|
||||
"xunit.analyzers": "1.18.0",
|
||||
"xunit.assert": "2.9.3",
|
||||
"xunit.core": "[2.9.3]"
|
||||
}
|
||||
},
|
||||
"xunit.runner.visualstudio": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.1.4, )",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg=="
|
||||
},
|
||||
"Microsoft.AspNetCore.TestHost": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "8xzbDfEOWg5GRp5byA42Axr4TbockbxCvdHTYk27ZIdst79DO0CLBp/Zw5sduK2goRii7of4EeuTjG/yPH4tsg=="
|
||||
},
|
||||
"Microsoft.CodeCoverage": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.14.1",
|
||||
"contentHash": "pmTrhfFIoplzFVbhVwUquT+77CbGH+h4/3mBpdmIlYtBi9nAB+kKI6dN3A/nV4DFi3wLLx/BlHIPK+MkbQ6Tpg=="
|
||||
},
|
||||
"Microsoft.Extensions.Configuration": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "inhujYI/nikhmLxYI6ZEcaCgZ28ipJsKMPPxxr2XWf3vM0Q2P+E9R3hDHABZOLBxzD3gjpgcbSH/+hd2+gvI2A==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "DY4C2qzTt2lOIY3VoscBH/TCwTolI5DKOfgJLuI+k1QUvRNT5vTMS58AOerNiihdVRStO0wEpLeRWA8jytzHBQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Binder": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "yJJl/b0+W+GEWbu+7viw6C3h2BoNkB69Vlz7s/4e+hm4mYbJqfhdcDSi9sCXJw47blsBaiQd3UDPgDtop92+ug==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.CommandLine": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "RwdNZ9JdGs8eZmeL5qRe7ugp0Irk3KVkWpC/w1c8kjJwu1R4HvCXYz9kwHZxn45WiaRBG5lphQKtqnBaJOQC+Q==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "qJK2dm9/AxyPVfqqBaZtjkUFl2hnBR/CQnMJtSO5LdEoyATMqvZjeQVY+8l0oa6PM6qlVe28iMEyXIRQ0wyZjA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "kwC1DY55CsqPmDtJAz+7alD3G+gJcM+XwHSZrcRO8mJGYB9hRq1qC6ZH8DL0SPW9WtJ/Bae5ikzPic8SxSv6Vw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "acCWM2+WR67kBAz6gAhD2zG+IZH9Q2VpKv5le7Msiu0vAMsnnLXpnV3BAzxd8/i+uOEo/dfb2XRYTynRVTDvEg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "kQ/Tx972unP+ueQL8SSninthIj6w6XP2o0VnJPFC5HQIimPMwEN704MOspEgDkmm4FUL5SuxLEU0bNiW4HEZFA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "4tnWU9vrU/A8NwYe9Z6wvieZ0EBb/uM82LAT+edNhdepOBWREZ7M7mzb941EIDPJaeOFdbVrDd5+7s9e89U6bQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "6TyllZsToy3S/Ziu67GddljRTttuVJ8bbrbVUrsdHqH5678Oax5MpaEubxLoPoWLvgUBYo4KfcAig0mkBtktXQ=="
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "J9ODOrffj1mK3Et69elNsLGRguesPxvThTdVpFmQX7fLNPhIOgqHQfLdGnTBEwNAV3yf8yiyVlpDZNw2qN87Nw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "oZzqZze8ed1fLS20HtIrkPxQXGRG/koq09srIw2ptnDHm9RHfwB++d35hosB/cXc55TH7Pshv85O0txongjCIg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "BZDwtN3uoWRghDi5lRRZPDjMMCg2Ds7J6YEYjqka/TLjqnzquEpXyvchrIMeoubwT1ns23ow6PPeAoBHJO81Rw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "U7HkgGCNPICN5k7NVK6dmLsSPSPeO/EbNcuxOl/5qdC9Ahjp9UZWKOvlnUC+rYurmoxIlwyv9e5j0BaQlTOELA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "vQVzmAbnzlhXSXA2caYnlxtG9GXxEwtj5bODiWLu06A6iqeJmfBtlfKjuOSJGRy0/CFaNUrm7u9nxEUlljc2Rg=="
|
||||
},
|
||||
"Microsoft.Extensions.Hosting": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "Q+hmPoDqeHipHyJcY7mDCQiLDUcn9jIgjoCThcgaOgjLTTT3ApTe8p6M2+twsDyfKuuCsKhSNlnNjaaggtXxRA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
|
||||
"Microsoft.Extensions.Hosting.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Console": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Debug": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.EventLog": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.EventSource": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Hosting.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "zIrbe9vkIFXxW3mOApIOWXw+xMwX7Cgsptr3ZSlglJt4hW2qp4fB/JU1NHgAevteBNH4PicvU9DsFPHxlnnloA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "fqbiPy4nUp4H2XHKAVQXKN2y3T2h4cFIx1DAAgE6iY9OHkN/OA1cKFi+geJKRWGuX6pS5SFbsjIPWHJqrxE0eg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Configuration": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "OyYJOaE9WbBx1Hp+Dd2zrqeFM0JwH5M/x0VL6tNUv3V18vIAVpix8UjhvY9eW/iXpguEHy68JO/Z9YkBOwftIw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Console": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "i9rn0rHkiCxfNVbf4DRG7LOFcKPy/BioAxS07w6daWvIpLNRjskqDJcGGaYVFWndsq0iTRaS8Msry0t5fRYQug==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Debug": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "yBig0DNMq+3UgliwxYlUC48dg0fPqvqI5B3ljzmLTrpR6maoKTOO5i9QnPgQUmQoaQWZMgu74fuF6oSDihb6pg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.EventLog": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "OAK40lXhgMuvyNwvzW3fxLvvucN8yr5XS7dQRcPmtnPf+Pt1lpbMgao5T4Wa6VdFagtIeDZNgPtV5Ig4xstziQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"System.Diagnostics.EventLog": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.EventSource": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "SxJu3oczk+TJtHvpgAmCVzEkzx69/obA6GZCbGrbqYqc981YOAyfEprySBdFX7Yc5qatHJKHNTlpGeeBAQkZcA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "tmMJgdrE4uhf1JcNs9CV9moAHW+hmDuvgMiPpnQxarKaUxqI2eN33sYK5S4l9Uw+rG9PJvlm4qPxMhvolTDTaQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "xVO5HhATc09WXuS/RaDmx8ZeWS0mTpT1L0tkEDMSBHtAnNpNsDr0ge0wIO2jinCWWqpq5dL1tRTzpYNVlvyqLw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "ZjTwxzhiw2TMEzIbUDkMF0dfDB2I4NQgIfKD0ELu9/5Mk+SRGdKZcD0/lvBrRCAPo6KN2r0BW86MRancoyJkoA=="
|
||||
},
|
||||
"Microsoft.OpenApi": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.12.2",
|
||||
"contentHash": "ZkT7qiJe0Kj0+DTZOZo+xrDy1kNmdsWFQVPIQLNx9ZJ0T9cB2LG7r+Bi60so8/+yg1nkS7QCPadrzsTG4VPKrA=="
|
||||
},
|
||||
"Microsoft.TestPlatform.ObjectModel": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.14.1",
|
||||
"contentHash": "xTP1W6Mi6SWmuxd3a+jj9G9UoC850WGwZUps1Wah9r1ZxgXhdJfj1QqDLJkFjHDCvN42qDL2Ps5KjQYWUU0zcQ=="
|
||||
},
|
||||
"Microsoft.TestPlatform.TestHost": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.14.1",
|
||||
"contentHash": "d78LPzGKkJwsJXAQwsbJJ7LE7D1wB+rAyhHHAaODF+RDSQ0NgMjDFkSA1Djw18VrxO76GlKAjRUhl+H8NL8Z+Q==",
|
||||
"dependencies": {
|
||||
"Microsoft.TestPlatform.ObjectModel": "17.14.1",
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "13.0.3",
|
||||
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
|
||||
},
|
||||
"System.Diagnostics.EventLog": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "DkNjtQyPR5Ud/zHnWHdsOuKbFRL9nIC92Q76z0NmHVDoQm40toLtsGFTIWq7toBoVa6fo/DInL3PLxY3Asixyw=="
|
||||
},
|
||||
"xunit.abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.0.3",
|
||||
"contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg=="
|
||||
},
|
||||
"xunit.analyzers": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.18.0",
|
||||
"contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ=="
|
||||
},
|
||||
"xunit.assert": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.9.3",
|
||||
"contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA=="
|
||||
},
|
||||
"xunit.core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.9.3",
|
||||
"contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==",
|
||||
"dependencies": {
|
||||
"xunit.extensibility.core": "[2.9.3]",
|
||||
"xunit.extensibility.execution": "[2.9.3]"
|
||||
}
|
||||
},
|
||||
"xunit.extensibility.core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.9.3",
|
||||
"contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==",
|
||||
"dependencies": {
|
||||
"xunit.abstractions": "2.0.3"
|
||||
}
|
||||
},
|
||||
"xunit.extensibility.execution": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.9.3",
|
||||
"contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==",
|
||||
"dependencies": {
|
||||
"xunit.extensibility.core": "[2.9.3]"
|
||||
}
|
||||
},
|
||||
"smssluzba.api": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.OpenApi": "[10.0.13, )",
|
||||
"Swashbuckle.AspNetCore.SwaggerUI": "[9.0.6, )"
|
||||
}
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "XVuqUBGjVUVyb4DXR5BrSkrW0Br7sYKq39f723ILhQLlFHCyhAgWe1PkJBc42R/5mKBIgHiKVSY+PN5/4XtcQw==",
|
||||
"dependencies": {
|
||||
"Microsoft.OpenApi": "[2.12.2, 3.0.0)"
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerUI": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[9.0.6, )",
|
||||
"resolved": "9.0.6",
|
||||
"contentHash": "WGsw/Yop9b16miq8TQd4THxuEgkP5cH3+DX93BrX9m0OdPcKNtg2nNm77WQSAsA+Se+M0bTiu8bUyrruRSeS5g=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user