From e698d709be76cf4a29bfc5225c594f2d2fe96fd7 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Sat, 18 Mar 2023 12:35:04 +0200 Subject: [PATCH] itest: test LiTd REST endpoints --- itest/litd_mode_integrated_test.go | 8 ++++---- itest/litd_mode_remote_test.go | 4 ---- litrpc/lit-autopilot.pb.go | 2 +- litrpc/lit-autopilot.proto | 2 +- litrpc/lit-autopilot.swagger.json | 2 +- litrpc/lit-sessions.pb.go | 2 +- litrpc/lit-sessions.proto | 2 +- litrpc/lit-sessions.swagger.json | 2 +- 8 files changed, 10 insertions(+), 14 deletions(-) diff --git a/itest/litd_mode_integrated_test.go b/itest/litd_mode_integrated_test.go index 8f431468..493d748e 100644 --- a/itest/litd_mode_integrated_test.go +++ b/itest/litd_mode_integrated_test.go @@ -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, diff --git a/itest/litd_mode_remote_test.go b/itest/litd_mode_remote_test.go index a0e348dd..92832bbe 100644 --- a/itest/litd_mode_remote_test.go +++ b/itest/litd_mode_remote_test.go @@ -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, diff --git a/litrpc/lit-autopilot.pb.go b/litrpc/lit-autopilot.pb.go index 2c48354e..4a335b14 100644 --- a/litrpc/lit-autopilot.pb.go +++ b/litrpc/lit-autopilot.pb.go @@ -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"` } diff --git a/litrpc/lit-autopilot.proto b/litrpc/lit-autopilot.proto index ecc0b3a6..174940d4 100644 --- a/litrpc/lit-autopilot.proto +++ b/litrpc/lit-autopilot.proto @@ -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; } diff --git a/litrpc/lit-autopilot.swagger.json b/litrpc/lit-autopilot.swagger.json index 4b05891d..c0c9b3d2 100644 --- a/litrpc/lit-autopilot.swagger.json +++ b/litrpc/lit-autopilot.swagger.json @@ -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", diff --git a/litrpc/lit-sessions.pb.go b/litrpc/lit-sessions.pb.go index 0070b9a3..b7edfd6f 100644 --- a/litrpc/lit-sessions.pb.go +++ b/litrpc/lit-sessions.pb.go @@ -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"` } diff --git a/litrpc/lit-sessions.proto b/litrpc/lit-sessions.proto index b9ff9df8..a3f47db8 100644 --- a/litrpc/lit-sessions.proto +++ b/litrpc/lit-sessions.proto @@ -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; } diff --git a/litrpc/lit-sessions.swagger.json b/litrpc/lit-sessions.swagger.json index c4e8b118..b29b9b6b 100644 --- a/litrpc/lit-sessions.swagger.json +++ b/litrpc/lit-sessions.swagger.json @@ -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",