mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
parent
06951a39c6
commit
7951dcada6
13 changed files with 27 additions and 7 deletions
|
@ -9,6 +9,7 @@ using BTCPayServer.Data;
|
||||||
using BTCPayServer.PayoutProcessors;
|
using BTCPayServer.PayoutProcessors;
|
||||||
using BTCPayServer.Security;
|
using BTCPayServer.Security;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using StoreData = BTCPayServer.Data.StoreData;
|
using StoreData = BTCPayServer.Data.StoreData;
|
||||||
using PayoutProcessorData = BTCPayServer.Client.Models.PayoutProcessorData;
|
using PayoutProcessorData = BTCPayServer.Client.Models.PayoutProcessorData;
|
||||||
|
@ -17,6 +18,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldPayoutProcessorsController : ControllerBase
|
public class GreenfieldPayoutProcessorsController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IEnumerable<IPayoutProcessorFactory> _factories;
|
private readonly IEnumerable<IPayoutProcessorFactory> _factories;
|
||||||
|
|
|
@ -10,6 +10,7 @@ using BTCPayServer.PayoutProcessors;
|
||||||
using BTCPayServer.PayoutProcessors.Lightning;
|
using BTCPayServer.PayoutProcessors.Lightning;
|
||||||
using BTCPayServer.Services.Invoices;
|
using BTCPayServer.Services.Invoices;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using PayoutProcessorData = BTCPayServer.Data.PayoutProcessorData;
|
using PayoutProcessorData = BTCPayServer.Data.PayoutProcessorData;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreAutomatedLightningPayoutProcessorsController : ControllerBase
|
public class GreenfieldStoreAutomatedLightningPayoutProcessorsController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly PayoutProcessorService _payoutProcessorService;
|
private readonly PayoutProcessorService _payoutProcessorService;
|
||||||
|
|
|
@ -10,6 +10,7 @@ using BTCPayServer.PayoutProcessors;
|
||||||
using BTCPayServer.PayoutProcessors.OnChain;
|
using BTCPayServer.PayoutProcessors.OnChain;
|
||||||
using BTCPayServer.Services.Invoices;
|
using BTCPayServer.Services.Invoices;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using PayoutProcessorData = BTCPayServer.Data.PayoutProcessorData;
|
using PayoutProcessorData = BTCPayServer.Data.PayoutProcessorData;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreAutomatedOnChainPayoutProcessorsController : ControllerBase
|
public class GreenfieldStoreAutomatedOnChainPayoutProcessorsController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly PayoutProcessorService _payoutProcessorService;
|
private readonly PayoutProcessorService _payoutProcessorService;
|
||||||
|
|
|
@ -17,6 +17,7 @@ using BTCPayServer.Payments.Lightning;
|
||||||
using BTCPayServer.Security;
|
using BTCPayServer.Security;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using StoreData = BTCPayServer.Data.StoreData;
|
using StoreData = BTCPayServer.Data.StoreData;
|
||||||
|
@ -25,24 +26,19 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreLNURLPayPaymentMethodsController : ControllerBase
|
public class GreenfieldStoreLNURLPayPaymentMethodsController : ControllerBase
|
||||||
{
|
{
|
||||||
private StoreData Store => HttpContext.GetStoreData();
|
private StoreData Store => HttpContext.GetStoreData();
|
||||||
private readonly StoreRepository _storeRepository;
|
private readonly StoreRepository _storeRepository;
|
||||||
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
|
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
|
||||||
private readonly IAuthorizationService _authorizationService;
|
|
||||||
private readonly ISettingsRepository _settingsRepository;
|
|
||||||
|
|
||||||
public GreenfieldStoreLNURLPayPaymentMethodsController(
|
public GreenfieldStoreLNURLPayPaymentMethodsController(
|
||||||
StoreRepository storeRepository,
|
StoreRepository storeRepository,
|
||||||
BTCPayNetworkProvider btcPayNetworkProvider,
|
BTCPayNetworkProvider btcPayNetworkProvider)
|
||||||
IAuthorizationService authorizationService,
|
|
||||||
ISettingsRepository settingsRepository)
|
|
||||||
{
|
{
|
||||||
_storeRepository = storeRepository;
|
_storeRepository = storeRepository;
|
||||||
_btcPayNetworkProvider = btcPayNetworkProvider;
|
_btcPayNetworkProvider = btcPayNetworkProvider;
|
||||||
_authorizationService = authorizationService;
|
|
||||||
_settingsRepository = settingsRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<LNURLPayPaymentMethodData> GetLNURLPayPaymentMethods(StoreData store,
|
public static IEnumerable<LNURLPayPaymentMethodData> GetLNURLPayPaymentMethods(StoreData store,
|
||||||
|
|
|
@ -6,6 +6,7 @@ using BTCPayServer.Abstractions.Extensions;
|
||||||
using BTCPayServer.Client;
|
using BTCPayServer.Client;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using AuthenticationSchemes = BTCPayServer.Abstractions.Constants.AuthenticationSchemes;
|
using AuthenticationSchemes = BTCPayServer.Abstractions.Constants.AuthenticationSchemes;
|
||||||
using LightningAddressData = BTCPayServer.Client.Models.LightningAddressData;
|
using LightningAddressData = BTCPayServer.Client.Models.LightningAddressData;
|
||||||
|
@ -14,6 +15,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreLightningAddressesController : ControllerBase
|
public class GreenfieldStoreLightningAddressesController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly LightningAddressService _lightningAddressService;
|
private readonly LightningAddressService _lightningAddressService;
|
||||||
|
|
|
@ -18,6 +18,7 @@ using BTCPayServer.Security;
|
||||||
using BTCPayServer.Services;
|
using BTCPayServer.Services;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using StoreData = BTCPayServer.Data.StoreData;
|
using StoreData = BTCPayServer.Data.StoreData;
|
||||||
|
@ -26,6 +27,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreLightningNetworkPaymentMethodsController : ControllerBase
|
public class GreenfieldStoreLightningNetworkPaymentMethodsController : ControllerBase
|
||||||
{
|
{
|
||||||
private StoreData Store => HttpContext.GetStoreData();
|
private StoreData Store => HttpContext.GetStoreData();
|
||||||
|
|
|
@ -8,6 +8,7 @@ using BTCPayServer.Data;
|
||||||
using BTCPayServer.Events;
|
using BTCPayServer.Events;
|
||||||
using BTCPayServer.Payments;
|
using BTCPayServer.Payments;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NBXplorer.Models;
|
using NBXplorer.Models;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
[HttpPost("~/api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/generate")]
|
[HttpPost("~/api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/generate")]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public async Task<IActionResult> GenerateOnChainWallet(string storeId, string cryptoCode,
|
public async Task<IActionResult> GenerateOnChainWallet(string storeId, string cryptoCode,
|
||||||
GenerateWalletRequest request)
|
GenerateWalletRequest request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@ using BTCPayServer.Services;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using BTCPayServer.Services.Wallets;
|
using BTCPayServer.Services.Wallets;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NBitcoin;
|
using NBitcoin;
|
||||||
using NBXplorer.DerivationStrategy;
|
using NBXplorer.DerivationStrategy;
|
||||||
|
@ -24,6 +25,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public partial class GreenfieldStoreOnChainPaymentMethodsController : ControllerBase
|
public partial class GreenfieldStoreOnChainPaymentMethodsController : ControllerBase
|
||||||
{
|
{
|
||||||
private StoreData Store => HttpContext.GetStoreData();
|
private StoreData Store => HttpContext.GetStoreData();
|
||||||
|
|
|
@ -8,6 +8,7 @@ using BTCPayServer.Client.Models;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
using BTCPayServer.Security;
|
using BTCPayServer.Security;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using StoreData = BTCPayServer.Data.StoreData;
|
using StoreData = BTCPayServer.Data.StoreData;
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStorePaymentMethodsController : ControllerBase
|
public class GreenfieldStorePaymentMethodsController : ControllerBase
|
||||||
{
|
{
|
||||||
private StoreData Store => HttpContext.GetStoreData();
|
private StoreData Store => HttpContext.GetStoreData();
|
||||||
|
|
|
@ -7,12 +7,14 @@ using BTCPayServer.Client;
|
||||||
using BTCPayServer.Client.Models;
|
using BTCPayServer.Client.Models;
|
||||||
using BTCPayServer.PayoutProcessors;
|
using BTCPayServer.PayoutProcessors;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace BTCPayServer.Controllers.Greenfield
|
namespace BTCPayServer.Controllers.Greenfield
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStorePayoutProcessorsController : ControllerBase
|
public class GreenfieldStorePayoutProcessorsController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly PayoutProcessorService _payoutProcessorService;
|
private readonly PayoutProcessorService _payoutProcessorService;
|
||||||
|
|
|
@ -13,6 +13,7 @@ using BTCPayServer.Rating;
|
||||||
using BTCPayServer.Services.Rates;
|
using BTCPayServer.Services.Rates;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using RateSource = BTCPayServer.Client.Models.RateSource;
|
using RateSource = BTCPayServer.Client.Models.RateSource;
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/stores/{storeId}/rates/configuration")]
|
[Route("api/v1/stores/{storeId}/rates/configuration")]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreRateConfigurationController : ControllerBase
|
public class GreenfieldStoreRateConfigurationController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RateFetcher _rateProviderFactory;
|
private readonly RateFetcher _rateProviderFactory;
|
||||||
|
|
|
@ -11,6 +11,7 @@ using BTCPayServer.Data;
|
||||||
using BTCPayServer.Rating;
|
using BTCPayServer.Rating;
|
||||||
using BTCPayServer.Services.Rates;
|
using BTCPayServer.Services.Rates;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace BTCPayServer.Controllers.GreenField
|
namespace BTCPayServer.Controllers.GreenField
|
||||||
|
@ -18,6 +19,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/stores/{storeId}/rates")]
|
[Route("api/v1/stores/{storeId}/rates")]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldStoreRatesController : ControllerBase
|
public class GreenfieldStoreRatesController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RateFetcher _rateProviderFactory;
|
private readonly RateFetcher _rateProviderFactory;
|
||||||
|
|
|
@ -6,6 +6,7 @@ using BTCPayServer.Data;
|
||||||
using BTCPayServer.Security;
|
using BTCPayServer.Security;
|
||||||
using BTCPayServer.Services.Stores;
|
using BTCPayServer.Services.Stores;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
[Route("api/test/apikey")]
|
[Route("api/test/apikey")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
|
[EnableCors(CorsPolicies.All)]
|
||||||
public class GreenfieldTestApiKeyController : ControllerBase
|
public class GreenfieldTestApiKeyController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly UserManager<ApplicationUser> _userManager;
|
private readonly UserManager<ApplicationUser> _userManager;
|
||||||
|
|
Loading…
Add table
Reference in a new issue