bleh
More API stuff. Lots of bleh. Really boring Also need to figure out a somewhat generic way for "requires ownership" permission and then a combinator for permissions
This commit is contained in:
parent
ffe3cf32ae
commit
1bb6cd8a70
8 changed files with 438 additions and 300 deletions
|
@ -40,8 +40,18 @@ func setupLinstromApiV1Router() http.Handler {
|
|||
// Accounts
|
||||
// Creating a new account happens either during fetch of a remote one or during registration with a passkey
|
||||
router.HandleFunc("GET /accounts/{accountId}", linstromGetAccount)
|
||||
router.HandleFunc("PATCH /accounts/{accountId}", linstromUpdateAccount)
|
||||
router.HandleFunc("DELETE /accounts/{accountId}", linstromDeleteAccount)
|
||||
// Technically also requires authenticated account to also be owner or correct admin perms,
|
||||
// but that's annoying to handle in a general sense. So leaving that to the function
|
||||
router.HandleFunc(
|
||||
"PATCH /accounts/{accountId}",
|
||||
requireValidSessionMiddleware(linstromUpdateAccount),
|
||||
)
|
||||
// Technically also requires authenticated account to also be owner or correct admin perms,
|
||||
// but that's annoying to handle in a general sense. So leaving that to the function
|
||||
router.HandleFunc(
|
||||
"DELETE /accounts/{accountId}",
|
||||
requireValidSessionMiddleware(linstromDeleteAccount),
|
||||
)
|
||||
// Follow
|
||||
router.HandleFunc("GET /accounts/{accountId}/follow", linstromIsFollowingAccount)
|
||||
router.HandleFunc("POST /accounts/{accountId}/follow", linstromFollowAccount)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue