mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
itest: test LiTd REST endpoints
This commit is contained in:
parent
c2c8b978b5
commit
e698d709be
8 changed files with 10 additions and 14 deletions
|
|
@ -239,6 +239,7 @@ var (
|
|||
successPattern: "\"sessions\":[",
|
||||
allowedThroughLNC: false,
|
||||
grpcWebURI: "/litrpc.Sessions/ListSessions",
|
||||
restWebURI: "/v1/sessions",
|
||||
}, {
|
||||
name: "litrpc-accounts",
|
||||
macaroonFn: litMacaroonFn,
|
||||
|
|
@ -246,6 +247,7 @@ var (
|
|||
successPattern: "\"accounts\":[",
|
||||
allowedThroughLNC: false,
|
||||
grpcWebURI: "/litrpc.Accounts/ListAccounts",
|
||||
restWebURI: "/v1/accounts",
|
||||
}, {
|
||||
name: "litrpc-autopilot",
|
||||
macaroonFn: litMacaroonFn,
|
||||
|
|
@ -253,6 +255,7 @@ var (
|
|||
successPattern: "\"features\":{",
|
||||
allowedThroughLNC: true,
|
||||
grpcWebURI: "/litrpc.Autopilot/ListAutopilotFeatures",
|
||||
restWebURI: "/v1/autopilot/features",
|
||||
}, {
|
||||
name: "litrpc-proxy",
|
||||
macaroonFn: litMacaroonFn,
|
||||
|
|
@ -260,6 +263,7 @@ var (
|
|||
successPattern: "\"version\":",
|
||||
allowedThroughLNC: false,
|
||||
grpcWebURI: "/litrpc.Proxy/GetInfo",
|
||||
restWebURI: "/v1/proxy/info",
|
||||
}}
|
||||
|
||||
// customURIs is a map of endpoint URIs that we want to allow via a
|
||||
|
|
@ -448,10 +452,6 @@ func integratedTestSuite(ctx context.Context, net *NetworkHarness, t *testing.T,
|
|||
for _, endpoint := range endpoints {
|
||||
endpoint := endpoint
|
||||
|
||||
if endpoint.restWebURI == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
tt.Run(endpoint.name+" lit port", func(ttt *testing.T) {
|
||||
runRESTAuthTest(
|
||||
ttt, cfg.LitAddr(), cfg.UIPassword,
|
||||
|
|
|
|||
|
|
@ -134,10 +134,6 @@ func remoteTestSuite(ctx context.Context, net *NetworkHarness, t *testing.T,
|
|||
for _, endpoint := range endpoints {
|
||||
endpoint := endpoint
|
||||
|
||||
if endpoint.restWebURI == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
tt.Run(endpoint.name+" lit port", func(ttt *testing.T) {
|
||||
runRESTAuthTest(
|
||||
ttt, cfg.LitAddr(), cfg.UIPassword,
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ type RevokeAutopilotSessionRequest struct {
|
|||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The local static public key of the Autopilot session to be revoked.
|
||||
// When using REST, this field must be encoded as base64.
|
||||
// When using REST, this field must be encoded as base64url.
|
||||
LocalPublicKey []byte `protobuf:"bytes,1,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ message ListAutopilotFeaturesResponse {
|
|||
message RevokeAutopilotSessionRequest {
|
||||
/*
|
||||
The local static public key of the Autopilot session to be revoked.
|
||||
When using REST, this field must be encoded as base64.
|
||||
When using REST, this field must be encoded as base64url.
|
||||
*/
|
||||
bytes local_public_key = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
"parameters": [
|
||||
{
|
||||
"name": "local_public_key",
|
||||
"description": "The local static public key of the Autopilot session to be revoked.\nWhen using REST, this field must be encoded as base64.",
|
||||
"description": "The local static public key of the Autopilot session to be revoked.\nWhen using REST, this field must be encoded as base64url.",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ type RevokeSessionRequest struct {
|
|||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The local static key of the session to be revoked.
|
||||
// When using REST, this field must be encoded as base64.
|
||||
// When using REST, this field must be encoded as base64url.
|
||||
LocalPublicKey []byte `protobuf:"bytes,8,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ message ListSessionsResponse {
|
|||
message RevokeSessionRequest {
|
||||
/*
|
||||
The local static key of the session to be revoked.
|
||||
When using REST, this field must be encoded as base64.
|
||||
When using REST, this field must be encoded as base64url.
|
||||
*/
|
||||
bytes local_public_key = 8;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
"parameters": [
|
||||
{
|
||||
"name": "local_public_key",
|
||||
"description": "The local static key of the session to be revoked.\nWhen using REST, this field must be encoded as base64.",
|
||||
"description": "The local static key of the session to be revoked.\nWhen using REST, this field must be encoded as base64url.",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue