Commit Graph

39 Commits

Author SHA1 Message Date
Umar Bolatov
d9935ada9d
Add "/api/v1/users/me" endpoint 2021-06-02 20:02:29 -07:00
Umar Bolatov
907ae760e0
Add CanDeleteUser policy 2021-06-02 20:02:25 -07:00
Wouter Samaey
06fef563e3
Fixed 2 typos (#2514)
* Fixed 2 typos

* Update BTCPayServer/Controllers/ManageController.APIKeys.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Update BTCPayServer/Controllers/ManageController.APIKeys.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-05-07 18:51:10 +02:00
Andrew Camilleri
9dbfe22171
add greenfield authorize UI docs and fix small issues (#2156)
* add greenfield authorize UI docs and fix small issues

* Update ManageController.APIKeys.cs

* Apply suggestions from code review

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2020-12-23 13:19:38 +09:00
Andrew Camilleri
0652e30c30
GreenField: Notifications API (#2055)
* GreenField: Notifications API

This refactors notifications so that we dont have a bunch of duplicated direct access to db contexts in controllers and then introduces new endpoints to fetch/toggle seen/remove  notifications of the current user.

* add tests + docs

* fix test

* pr changes

* fix permission json
2020-12-11 23:11:08 +09: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
d8f145c4dc
Merge branch 'master' into plugins-db 2020-11-19 12:19:17 +09:00
Kukks
179520a211 Plugins: Allow creation of independent DbContexts
This allows plugins to create custom dbcontexts, which would be namespaced in the scheme with a prefix. Migrations are supported too and the table would be prefixed too
2020-11-18 12:27:26 +01:00
nicolas.dorier
94bcbeb604
Add Greenfield API 2020-11-13 14:15:03 +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
6a8dbf49da clean and remove hack 2020-08-28 09:15:08 +02:00
Kukks
0e07fcc706 fixes and adapt 2020-08-28 09:00:14 +02:00
Kukks
dbe7f464bd permission check for auth 2020-08-28 09:00:13 +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
34e76494e3
GreenField: Invoice API 2020-08-26 21:36:29 +09:00
rockstardev
f88c02cccd Removing unused usings, readonly fields where possible 2020-06-28 22:07:48 -05:00
nicolas.dorier
51514252b6
Run dotnet format 2020-06-28 17:55:27 +09:00
Nicolas Dorier
8230a408ac
Add pull payment feature (#1639) 2020-06-24 10:34:09 +09:00
nicolas.dorier
3fbe86c286
Rename Permission.StoreId to Permission.Scope 2020-06-07 23:17:48 +09:00
Andrew Camilleri
1e3f62718d
GreenField: Cross-implemenation Lightning Node API (#1566)
* GreenField: Cross-implemenation Lightning Node API

* switch to hard unrsstricted check

* fix

* set LightningPrivateRouteHints in swagger + stores api

* add priv route hint

* rename models and add swagger defs to models
2020-05-29 09:00:13 +09:00
Andrew Camilleri
5b3b96b372
GreenField: Payment Requests CRUD (#1430)
* GreenField: Payment Requests CRUD

* fixes

* fix swagger

* fix swag

* rebase fixes

* Add new permissions for payment requests

* Adapt PR to archive

* fix tst

* add to contains policxy

* make decimals returned as string due to avoid shitty language parsing issues

* do not register decimal json converter as global

* fix cultureinfo for json covnerter

* pr changes

* add json convertet test

* fix json test

* fix rebase
2020-05-20 02:59:23 +09:00
Nicolas Dorier
b0073af5aa
Merge pull request #1408 from Kukks/api/api-key-uu-refactor
Refactor UI for Add APIKey/Authorize
2020-04-10 22:00:32 +09:00
Kukks
ad284a4b61 Refactor UI for Add APIKey/Authorize 2020-04-10 09:49:01 +02:00
Dennis Reimann
9783a76c38 Fix generated API key color 2020-04-10 09:18:08 +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
432d6bb261
Update documentation 2020-03-20 14:33:11 +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
2def9e7bd3
fix build 2020-03-20 13:58:07 +09:00
nicolas.dorier
29a807696b
Refactor permissions of GreenField 2020-03-19 23:43:51 +09:00
nicolas.dorier
e351e0c9ea
Remove dependency on NSwag 2020-03-18 20:08:09 +09: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
233fa8a4a1 BTCPayServer.Client library + Revoke API Key 2020-03-11 16:54:53 +01:00
nicolas.dorier
153992a458
Use good rng for generating API keys 2020-03-10 21:30:46 +09:00
nicolas.dorier
691a8d6fd8
Fix warnings 2020-03-10 21:28:00 +09:00
Kukks
e7eea1036b make api key delete use confirm page 2020-02-26 10:26:38 +01:00
Kukks
0a8b303c11 add label for api keys, make api keys without -, fix null exception on authorize 2020-02-25 14:43:53 +01:00
Kukks
023e64704d Add Swagger and Redoc
Blocked by #1262
2020-02-24 19:04:04 +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