db + auth routes

This commit is contained in:
boufni95 2024-09-16 15:15:52 +00:00
parent d2b2418e21
commit 6df5752d46
17 changed files with 553 additions and 12 deletions

View file

@ -430,11 +430,29 @@ service LightningPub {
}
rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/lnurl_channel/url";
option (nostr) = true;
}
rpc GetAuthorizedDebits(structs.Empty) returns (structs.AuthorizedDebits){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/debit/get";
option (nostr) = true;
}
rpc RemoveAuthorizedDebit(structs.RemoveAuthorizedDebitRequest) returns (structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/debit/remove";
option (nostr) = true;
}
rpc AuthorizeDebit(structs.DebitAuthorization) returns (structs.AuthorizedDebit){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/debit/authorize";
option (nostr) = true;
}
rpc GetLiveUserOperations(structs.Empty) returns (stream structs.LiveUserOperation){
option (auth_type) = "User";
option (http_method) = "post";

View file

@ -476,4 +476,29 @@ message GetInviteTokenStateRequest {
message GetInviteTokenStateResponse {
bool used = 1;
}
message DebitAuthorization {
optional string authorize_npub =1;
}
enum AuthorizedDebitType {
NPUB = 0;
KEY = 1;
}
message AuthorizedDebit {
string debit_id = 1;
AuthorizedDebitType debit_type = 2;
string key = 3;
}
message AuthorizedDebits {
repeated AuthorizedDebit debits = 1;
}
message RemoveAuthorizedDebitRequest {
string debit_id = 1;
}