Skip to content

Commit e698d70

Browse files
committed
itest: test LiTd REST endpoints
1 parent c2c8b97 commit e698d70

8 files changed

+10
-14
lines changed

itest/litd_mode_integrated_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,27 +239,31 @@ var (
239239
successPattern: "\"sessions\":[",
240240
allowedThroughLNC: false,
241241
grpcWebURI: "/litrpc.Sessions/ListSessions",
242+
restWebURI: "/v1/sessions",
242243
}, {
243244
name: "litrpc-accounts",
244245
macaroonFn: litMacaroonFn,
245246
requestFn: litAccountRequestFn,
246247
successPattern: "\"accounts\":[",
247248
allowedThroughLNC: false,
248249
grpcWebURI: "/litrpc.Accounts/ListAccounts",
250+
restWebURI: "/v1/accounts",
249251
}, {
250252
name: "litrpc-autopilot",
251253
macaroonFn: litMacaroonFn,
252254
requestFn: litAutopilotRequestFn,
253255
successPattern: "\"features\":{",
254256
allowedThroughLNC: true,
255257
grpcWebURI: "/litrpc.Autopilot/ListAutopilotFeatures",
258+
restWebURI: "/v1/autopilot/features",
256259
}, {
257260
name: "litrpc-proxy",
258261
macaroonFn: litMacaroonFn,
259262
requestFn: proxyRequestFn,
260263
successPattern: "\"version\":",
261264
allowedThroughLNC: false,
262265
grpcWebURI: "/litrpc.Proxy/GetInfo",
266+
restWebURI: "/v1/proxy/info",
263267
}}
264268

265269
// 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,
448452
for _, endpoint := range endpoints {
449453
endpoint := endpoint
450454

451-
if endpoint.restWebURI == "" {
452-
continue
453-
}
454-
455455
tt.Run(endpoint.name+" lit port", func(ttt *testing.T) {
456456
runRESTAuthTest(
457457
ttt, cfg.LitAddr(), cfg.UIPassword,

itest/litd_mode_remote_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ func remoteTestSuite(ctx context.Context, net *NetworkHarness, t *testing.T,
134134
for _, endpoint := range endpoints {
135135
endpoint := endpoint
136136

137-
if endpoint.restWebURI == "" {
138-
continue
139-
}
140-
141137
tt.Run(endpoint.name+" lit port", func(ttt *testing.T) {
142138
runRESTAuthTest(
143139
ttt, cfg.LitAddr(), cfg.UIPassword,

litrpc/lit-autopilot.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-autopilot.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ message ListAutopilotFeaturesResponse {
119119
message RevokeAutopilotSessionRequest {
120120
/*
121121
The local static public key of the Autopilot session to be revoked.
122-
When using REST, this field must be encoded as base64.
122+
When using REST, this field must be encoded as base64url.
123123
*/
124124
bytes local_public_key = 1;
125125
}

litrpc/lit-autopilot.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"parameters": [
115115
{
116116
"name": "local_public_key",
117-
"description": "The local static public key of the Autopilot session to be revoked.\nWhen using REST, this field must be encoded as base64.",
117+
"description": "The local static public key of the Autopilot session to be revoked.\nWhen using REST, this field must be encoded as base64url.",
118118
"in": "path",
119119
"required": true,
120120
"type": "string",

litrpc/lit-sessions.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-sessions.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ message ListSessionsResponse {
226226
message RevokeSessionRequest {
227227
/*
228228
The local static key of the session to be revoked.
229-
When using REST, this field must be encoded as base64.
229+
When using REST, this field must be encoded as base64url.
230230
*/
231231
bytes local_public_key = 8;
232232
}

litrpc/lit-sessions.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"parameters": [
9292
{
9393
"name": "local_public_key",
94-
"description": "The local static key of the session to be revoked.\nWhen using REST, this field must be encoded as base64.",
94+
"description": "The local static key of the session to be revoked.\nWhen using REST, this field must be encoded as base64url.",
9595
"in": "path",
9696
"required": true,
9797
"type": "string",

0 commit comments

Comments
 (0)