mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
CoinAverage credentials are now correctly passed
This commit is contained in:
parent
18977f7265
commit
a7ad71d492
@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Version>1.0.1.90</Version>
|
<Version>1.0.1.91</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -89,6 +89,10 @@ namespace BTCPayServer.HostedServices
|
|||||||
{
|
{
|
||||||
_coinAverageSettings.KeyPair = (rates.PublicKey, rates.PrivateKey);
|
_coinAverageSettings.KeyPair = (rates.PublicKey, rates.PrivateKey);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_coinAverageSettings.KeyPair = null;
|
||||||
|
}
|
||||||
await _SettingsRepository.WaitSettingsChanged<RatesSetting>(cancellation);
|
await _SettingsRepository.WaitSettingsChanged<RatesSetting>(cancellation);
|
||||||
}, cancellation);
|
}, cancellation);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace BTCPayServer.Hosting
|
|||||||
services.TryAddSingleton<TokenRepository>();
|
services.TryAddSingleton<TokenRepository>();
|
||||||
services.TryAddSingleton<EventAggregator>();
|
services.TryAddSingleton<EventAggregator>();
|
||||||
services.TryAddSingleton<CoinAverageSettings>();
|
services.TryAddSingleton<CoinAverageSettings>();
|
||||||
services.TryAddSingleton<ICoinAverageAuthenticator, CoinAverageSettings>();
|
services.TryAddSingleton<ICoinAverageAuthenticator, CoinAverageSettingsAuthenticator>();
|
||||||
services.TryAddSingleton<ApplicationDbContextFactory>(o =>
|
services.TryAddSingleton<ApplicationDbContextFactory>(o =>
|
||||||
{
|
{
|
||||||
var opts = o.GetRequiredService<BTCPayServerOptions>();
|
var opts = o.GetRequiredService<BTCPayServerOptions>();
|
||||||
|
@ -8,6 +8,18 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace BTCPayServer.Services.Rates
|
namespace BTCPayServer.Services.Rates
|
||||||
{
|
{
|
||||||
|
public class CoinAverageSettingsAuthenticator : ICoinAverageAuthenticator
|
||||||
|
{
|
||||||
|
CoinAverageSettings _Settings;
|
||||||
|
public CoinAverageSettingsAuthenticator(CoinAverageSettings settings)
|
||||||
|
{
|
||||||
|
_Settings = settings;
|
||||||
|
}
|
||||||
|
public Task AddHeader(HttpRequestMessage message)
|
||||||
|
{
|
||||||
|
return _Settings.AddHeader(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
public class CoinAverageSettings : ICoinAverageAuthenticator
|
public class CoinAverageSettings : ICoinAverageAuthenticator
|
||||||
{
|
{
|
||||||
private static readonly DateTime _epochUtc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
private static readonly DateTime _epochUtc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
Loading…
Reference in New Issue
Block a user