itest: test LiTd REST endpoints

This commit is contained in:
Elle Mouton 2023-03-18 12:35:04 +02:00
parent c2c8b978b5
commit e698d709be
No known key found for this signature in database
GPG key ID: D7D916376026F177
8 changed files with 10 additions and 14 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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"`
}

View file

@ -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;
}

View file

@ -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",

View file

@ -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"`
}

View file

@ -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;
}

View file

@ -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",