Commit Graph

47 Commits

Author SHA1 Message Date
Nicolas Dorier
98d62e826b
Do not through missing-permission error when no store on /api/v1/stores (Close #4735) (#4748) 2023-03-08 21:36:51 +09:00
d11n
d5d0be5824
Code formatting updates (#4502)
* Editorconfig: Add space_before_self_closing setting

This was a difference between the way dotnet-format and Rider format code. See https://www.jetbrains.com/help/rider/EditorConfig_Index.html

* Editorconfig: Keep 4 spaces indentation for Swagger JSON files

They are all formatted that way, let's keep it like that.

* Apply dotnet-format, mostly white-space related changes
2023-01-06 22:18:07 +09:00
Dennis Reimann
ed1f249aaf Fix empty permissions case 2022-06-29 15:36:54 +02:00
Dennis Reimann
eef7539c2d Fix selective stores case 2022-06-29 15:36:54 +02:00
Dennis Reimann
1bb35bf545 Limit selection to one store 2022-06-29 15:36:54 +02:00
Dennis Reimann
2b9cb4a257 Better handling of confirm case (existing API key) 2022-06-29 15:36:54 +02:00
Dennis Reimann
9e253ac7a3 Test improvements 2022-06-29 15:36:54 +02:00
Dennis Reimann
27c5b16957 Improve views; fix tests 2022-06-29 15:36:54 +02:00
d11n
cd9a52706c
Use the store's default currency when creating entities (#3585)
* Use default currency for new pull payments

Closes #3582.

* Pull payment: Improve create form

* Use default currency for new invoices

Closes  #3581.

* Clean up old invoice form code

* Use default currency for new payment requests

* Test fixes
2022-04-11 17:50:30 +09:00
d11n
6bd7fb64ab
CI test fixes (#3609)
* Test fix


Logs

* Add test logs

* Test change

* Use async overloads in CanPayWithTwoCurrencies test

* Bump NBXplorer

* More test updates

* More logs

* More waiting

* More waiting

* Update GoToUrl calls

* Log request status

* More logs

* More logs, more waits, idk

* Click checkboxes using JS

* Go to url directly

* Double timeout
2022-04-08 18:58:01 +09:00
Dennis Reimann
4dfbb08db3 Try test fix 2022-03-04 10:49:36 +00:00
Dennis Reimann
b1b00ae886 Scroll to checkbox before click 2022-03-03 10:57:55 +01:00
Nicolas Dorier
c8b9906ef3
After login, redirect user to the main page even if root app configured (#3429) 2022-02-07 21:18:22 +09:00
d11n
20a9472ee2
Sticky headers (#3416)
* Make headers sticky

Closes #3344.

* Decrease headline margin bottom on mobile

* increases gap

* adds bottom padding

* Update BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml

* add "_blank" to view action

* Fix markup and tests

* Spacing updates

* Try test fix

* Re-add sticky account header and add test logs for timeout check

* Fix timeout issues

* Apply scroll padding on pages with sticky header

Co-authored-by: dstrukt <gfxdsign@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-02-07 18:37:45 +09:00
nicolas.dorier
50d4b55f73
Warning if not using 'simple using' 2022-01-14 17:50:29 +09:00
nicolas.dorier
23a96c07ae
Rename GreenField -> Greenfield 2022-01-14 13:46:04 +09:00
Nicolas Dorier
04b8eafacb
Run dotnet format (#3244) 2021-12-31 16:59:02 +09:00
d11n
f8e6b51e9d
Store-centric UI (#3091)
* Update layout structure and header

* Implement store selector

* Simplify homepage

* Update layout

* Use dropdown for store selector

* Hide global nav in store context

* Horizontal section nav

* Remove outer section and container from content views

* Update nav

* Set store context for invoice and payment request lists

* Test fixes

* Persist menu collapse state on client-side

* MainNav as view component

* Update app routes to incorporate store context

* Test fixes

* Display ticker for altcoins build only

* Plugins nav

* Incorporate category for active page as well

* Update invoice icon

* Add apps list to nav

* Add store context to app type controllers

* Incorporate id for active page as well

* Test fixes

* AppsController cleanup

* Nav: Display only apps for the current store

* Remove leftover from merge

* Nav styles optimization

* Left-align content container

* Increase sidebar padding on desktop

* Use min-width for store selector menu

* Store settings nav update

* Update app and payment request routes

* Test fixes

* Refactor MainNav component to use StoresController

* Set store context for invoice actions

* Cleanups

* Remove CurrentStore checks

The response will be "Access denied" in case the CookieAuthorizationHandler cannot resolve the store.

* Remove unnecessary store context setters

* Test fix
2021-12-11 12:32:23 +09:00
nicolas.dorier
35aad4ebf9
Remove Logs static singletons 2021-11-23 13:55:34 +09:00
Nicolas Dorier
d0120f1427
Fix Selenium flakyness on Circle CI (#2904) 2021-09-22 21:31:44 +09:00
Andrew Camilleri
04726b3ee4
Payouts: Detect External OnChain Payouts (#2462)
* Refactor and decouple Payout logic

So that we can support lightning + external payout payments

Fixes & refactoring

almost there

final

Remove uneeded payment method checks

Refactor payouts to handle custom payment method specific actions

External onchain payments to approved payouts will now require "confirmation" from the merchant that it was sent by them.

add pill tabs for payout status

* Improve some UX around feature

* add test and some fixes

* Only listen to address tracked source and determine based on wallet get tx call from nbx

* Simplify isInternal for Payout detection

* fix test

* Fix Noreferrer test

* Make EnsureNewLightningInvoiceOnPartialPayment more resilient

* Make notifications section test more resilient in CanUsePullPaymentsViaUI
2021-07-16 09:57:37 +02:00
d11n
c73878ccca
Fix missing hot wallet option on seed import (#2284)
* Fix missing hot wallet option on seed import

Thanks @kukks for spotting!

* Tests: Wait for button to be ready for interaction

* Camelcase test selectors

* Tests: Remove general ImplicitWait

* Tests: Add WaitForAndClick helper

* Tests: Refactor SetCheckbox

* Tests: Add WaitForElement helper

* Tests: Refactor and use wait.UntilJsIsReady helper

* Fix missing helper in ethereum tests

* Tests: Some more refactorings
2021-02-17 12:14:29 +09:00
Dennis Reimann
e567f7a80c
Refactor tests
Remove the hacky `ScrollTo`, `ForceClick` and `WaitForElement`.
Add the hacky `WaitForPageLoad`.
2021-01-25 13:04:58 +01:00
nicolas.dorier
13f10657b8
Fix bug: When creating API Key for non-admin, some checked permissions were not included (Fix #2107 and Fix #2002) 2020-12-08 15:20:59 +09:00
nicolas.dorier
df79c2cf48
Improve tests of webhooks 2020-11-14 13:39:44 +09:00
Dennis Reimann
7e60328cff
Greenfield: Rename API key redirect params; switch to POST body (#1898)
* Rename user param to userId in API key redirect

This way it is clearer what to expect and it also make the parameteer easier to consume.

* Post redirect: Allow form url and prettify page

- Form URL as alternative to controller/action for external URLs
- Making it look nice and add explanation for non-JS case

* APIKeys: Minor view updates

fix

* APIKeys: Use POST redirect for confirmation

fix

* UI: Minor update to confirm view

Tidies it up and adapts to the newly added ConfirmAPIKeys view.

* APIKeys: Update delete view

Structures the information in title and description better.

* APIKeys: Distinguish authorize and confirm (reuse)

* Upgrade ChromeDriver

* Test fixes

* Clean up PostRedirect view

By adding missing forgery token

* Re-add tests for callback post values

* Rename key param to apiKey in API key redirect

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.authorization.json

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Use DEBUG conditional for postredirect-callback-test route

* Remove unnecessary ChromeDriver references

* Add debug flag

* Remove debug flags

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2020-09-17 11:37:49 +02:00
Kukks
0e07fcc706 fixes and adapt 2020-08-28 09:00:14 +02:00
Kukks
7ca74aeea7 Add API Keys Application identifier
This lets the authorize api key screen redirect to the defined url  and provide it with the user id, permissions granted and the key.

This also allows apps to match existing api keys generated for it specifically using the application identifier, and if matched, presented with a confirmation page before redirection.
2020-08-28 09:00:13 +02:00
Kukks
41bebfedc4
add swagger docs 2020-08-26 21:36:31 +09:00
nicolas.dorier
51514252b6
Run dotnet format 2020-06-28 17:55:27 +09:00
nicolas.dorier
3fbe86c286
Rename Permission.StoreId to Permission.Scope 2020-06-07 23:17:48 +09:00
Kukks
deb197cfa5 GreenField: Get Stores 2020-04-22 15:05:13 +02:00
Kukks
ad284a4b61 Refactor UI for Add APIKey/Authorize 2020-04-10 09:49:01 +02:00
Kukks
c6d75de3d7 GreenField: Switch to Blob for API Keys 2020-04-02 09:32:22 +02:00
nicolas.dorier
ac14f199e4
Renaming GreenField classes 2020-03-27 12:55:21 +09:00
nicolas.dorier
53e7c84e73
Fix tests 2020-03-20 18:56:30 +09:00
nicolas.dorier
fb36ed2cae
Fix tests 2020-03-20 14:07:42 +09:00
nicolas.dorier
a0e638d500
Switch from System.Text.Json to Newtonsoft, typify the BTCPayServer.Client 2020-03-20 14:01:51 +09:00
nicolas.dorier
318d826694
Rename Permissions.Can.. to Policies.Can.. 2020-03-20 13:41:47 +09:00
nicolas.dorier
46edc281b6
Fix tests 2020-03-20 13:22:10 +09:00
nicolas.dorier
29a807696b
Refactor permissions of GreenField 2020-03-19 23:43:51 +09:00
Kukks
ff2ea5815c add else tests 2020-03-16 08:13:44 +01:00
Kukks
cc0202ecb3 fix test 2020-03-13 08:00:04 +01:00
Kukks
8173296c96 Greenfield API: Get current User
Builds on #1368
This PR adds a new endpoint: Get current user.. It only returns the current user's id and email for now( let's extend later)
It also adds a new permission: `ProfileManagement` which is needed for this endpoint (and for update endpoints later)
2020-03-12 14:59:24 +01:00
Kukks
786be9d1f5 fix tests 2020-03-11 16:54:53 +01:00
Kukks
233fa8a4a1 BTCPayServer.Client library + Revoke API Key 2020-03-11 16:54:53 +01:00
Andrew Camilleri
fa51180dfa
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 :(
2020-02-24 22:36:15 +09:00