Api keys with openiddict (#1262)

* Remove OpenIddict

* Add API Key system

* Revert removing OpenIddict

* fix rebase

* fix tests

* pr changes

* fix tests

* fix apikey test

* pr change

* fix db

* add migration attrs

* fix migration error

* PR Changes

* Fix sqlite migration

* change api key to use Authorization Header

* add supportAddForeignKey

* use tempdata status message

* fix add api key css

* remove redirect url + app identifier feature :(
This commit is contained in:
Andrew Camilleri
2020-02-24 14:36:15 +01:00
committed by GitHub
parent a3e7729c52
commit fa51180dfa
29 changed files with 1502 additions and 44 deletions

View File

@@ -19,6 +19,8 @@ using System.Globalization;
using BTCPayServer.Security;
using BTCPayServer.U2F;
using BTCPayServer.Data;
using BTCPayServer.Security.APIKeys;
namespace BTCPayServer.Controllers
{
@@ -34,6 +36,8 @@ namespace BTCPayServer.Controllers
IWebHostEnvironment _Env;
public U2FService _u2FService;
private readonly BTCPayServerEnvironment _btcPayServerEnvironment;
private readonly APIKeyRepository _apiKeyRepository;
private readonly IAuthorizationService _authorizationService;
StoreRepository _StoreRepository;
@@ -48,7 +52,10 @@ namespace BTCPayServer.Controllers
StoreRepository storeRepository,
IWebHostEnvironment env,
U2FService u2FService,
BTCPayServerEnvironment btcPayServerEnvironment)
BTCPayServerEnvironment btcPayServerEnvironment,
APIKeyRepository apiKeyRepository,
IAuthorizationService authorizationService
)
{
_userManager = userManager;
_signInManager = signInManager;
@@ -58,6 +65,8 @@ namespace BTCPayServer.Controllers
_Env = env;
_u2FService = u2FService;
_btcPayServerEnvironment = btcPayServerEnvironment;
_apiKeyRepository = apiKeyRepository;
_authorizationService = authorizationService;
_StoreRepository = storeRepository;
}