mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-19 06:54:19 +01:00
Remove dependency to DBriize
This commit is contained in:
@@ -10,7 +10,6 @@ using BTCPayServer.Storage.Services.Providers.AzureBlobStorage.Configuration;
|
|||||||
using BTCPayServer.Storage.Services.Providers.FileSystemStorage.Configuration;
|
using BTCPayServer.Storage.Services.Providers.FileSystemStorage.Configuration;
|
||||||
using BTCPayServer.Storage.ViewModels;
|
using BTCPayServer.Storage.ViewModels;
|
||||||
using BTCPayServer.Tests.Logging;
|
using BTCPayServer.Tests.Logging;
|
||||||
using DBriize.Utils;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
@@ -212,10 +211,9 @@ namespace BTCPayServer.Tests
|
|||||||
Assert.NotNull(statusMessageModel);
|
Assert.NotNull(statusMessageModel);
|
||||||
Assert.Equal(StatusMessageModel.StatusSeverity.Success, statusMessageModel.Severity);
|
Assert.Equal(StatusMessageModel.StatusSeverity.Success, statusMessageModel.Severity);
|
||||||
var index = statusMessageModel.Html.IndexOf("target='_blank'>");
|
var index = statusMessageModel.Html.IndexOf("target='_blank'>");
|
||||||
var url = statusMessageModel.Html.Substring(index).ReplaceMultiple(new Dictionary<string, string>()
|
var url = statusMessageModel.Html.Substring(index)
|
||||||
{
|
.Replace("</a>", string.Empty)
|
||||||
{"</a>", string.Empty}, {"target='_blank'>", string.Empty}
|
.Replace("target='_blank'>", string.Empty);
|
||||||
});
|
|
||||||
//verify tmpfile is available and the same
|
//verify tmpfile is available and the same
|
||||||
data = await net.DownloadStringTaskAsync(new Uri(url));
|
data = await net.DownloadStringTaskAsync(new Uri(url));
|
||||||
Assert.Equal(fileContent, data);
|
Assert.Equal(fileContent, data);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ using BTCPayServer.Services.Rates;
|
|||||||
using BTCPayServer.Tests.Logging;
|
using BTCPayServer.Tests.Logging;
|
||||||
using BTCPayServer.U2F.Models;
|
using BTCPayServer.U2F.Models;
|
||||||
using BTCPayServer.Validation;
|
using BTCPayServer.Validation;
|
||||||
using DBriize.Utils;
|
|
||||||
using ExchangeSharp;
|
using ExchangeSharp;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -263,21 +262,12 @@ namespace BTCPayServer.Tests
|
|||||||
ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
|
ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
|
||||||
!Policies.IsStorePolicy(pair.Key) && !Policies.IsServerPolicy(pair.Key));
|
!Policies.IsStorePolicy(pair.Key) && !Policies.IsServerPolicy(pair.Key));
|
||||||
|
|
||||||
description = description.ReplaceMultiple(new Dictionary<string, string>()
|
description = description.Replace("#OTHERPERMISSIONS#",
|
||||||
{
|
string.Join("\n", otherPolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}")))
|
||||||
{
|
.Replace("#SERVERPERMISSIONS#",
|
||||||
"#OTHERPERMISSIONS#",
|
string.Join("\n", serverPolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}")))
|
||||||
string.Join("\n", otherPolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}"))
|
.Replace("#STOREPERMISSIONS#",
|
||||||
},
|
string.Join("\n", storePolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}")));
|
||||||
{
|
|
||||||
"#SERVERPERMISSIONS#",
|
|
||||||
string.Join("\n", serverPolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}"))
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"#STOREPERMISSIONS#",
|
|
||||||
string.Join("\n", storePolicies.Select(pair => $"* `{pair.Key}`: {pair.Value.Title}"))
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Logs.Tester.LogInformation(description);
|
Logs.Tester.LogInformation(description);
|
||||||
|
|
||||||
var sresp = Assert
|
var sresp = Assert
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
<PackageReference Include="QRCoder" Version="1.4.1" />
|
<PackageReference Include="QRCoder" Version="1.4.1" />
|
||||||
<PackageReference Include="System.IO.Pipelines" Version="4.7.2" />
|
<PackageReference Include="System.IO.Pipelines" Version="4.7.2" />
|
||||||
<PackageReference Include="NBitpayClient" Version="1.0.0.39" />
|
<PackageReference Include="NBitpayClient" Version="1.0.0.39" />
|
||||||
<PackageReference Include="DBriize" Version="1.0.1.3" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
|
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
|
||||||
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
|
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ using BTCPayServer.Security;
|
|||||||
using BTCPayServer.Services.Invoices;
|
using BTCPayServer.Services.Invoices;
|
||||||
using BTCPayServer.Services.Invoices.Export;
|
using BTCPayServer.Services.Invoices.Export;
|
||||||
using BTCPayServer.Services.Rates;
|
using BTCPayServer.Services.Rates;
|
||||||
using DBriize.Utils;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ using BTCPayServer.Logging;
|
|||||||
using BTCPayServer.Payments;
|
using BTCPayServer.Payments;
|
||||||
using BTCPayServer.Services;
|
using BTCPayServer.Services;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using DBriize;
|
|
||||||
using DBriize.Utils;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using System.Net.Http;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BTCPayServer.Services.Shopify.ApiModels;
|
using BTCPayServer.Services.Shopify.ApiModels;
|
||||||
using DBriize.Utils;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ namespace BTCPayServer.Services.Shopify
|
|||||||
_credentials = credentials;
|
_credentials = credentials;
|
||||||
|
|
||||||
var bearer = $"{_credentials.ApiKey}:{_credentials.ApiPassword}";
|
var bearer = $"{_credentials.ApiKey}:{_credentials.ApiPassword}";
|
||||||
bearer = Encoding.UTF8.GetBytes(bearer).ToBase64String();
|
bearer = NBitcoin.DataEncoders.Encoders.Base64.EncodeData(Encoding.UTF8.GetBytes(bearer));
|
||||||
|
|
||||||
_httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + bearer);
|
_httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + bearer);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user