@@ -200,6 +200,14 @@ var (
200
200
litConn := litrpc .NewProxyClient (c )
201
201
return litConn .GetInfo (ctx , & litrpc.GetInfoRequest {})
202
202
}
203
+ statusRequestFn = func (ctx context.Context ,
204
+ c grpc.ClientConnInterface ) (proto.Message , error ) {
205
+
206
+ litConn := litrpc .NewStatusClient (c )
207
+ return litConn .SubServerStatus (
208
+ ctx , & litrpc.SubServerStatusReq {},
209
+ )
210
+ }
203
211
litMacaroonFn = func (cfg * LitNodeConfig ) string {
204
212
return cfg .LitMacPath
205
213
}
@@ -338,6 +346,16 @@ var (
338
346
grpcWebURI : "/litrpc.Proxy/GetInfo" ,
339
347
restWebURI : "/v1/proxy/info" ,
340
348
litOnly : true ,
349
+ }, {
350
+ name : "litrpc-status" ,
351
+ macaroonFn : emptyMacaroonFn ,
352
+ requestFn : statusRequestFn ,
353
+ successPattern : "\" sub_servers\" :" ,
354
+ allowedThroughLNC : true ,
355
+ grpcWebURI : "/litrpc.Status/SubServerStatus" ,
356
+ restWebURI : "/v1/status" ,
357
+ noAuth : true ,
358
+ litOnly : true ,
341
359
}}
342
360
343
361
// customURIs is a map of endpoint URIs that we want to allow via a
@@ -691,13 +709,20 @@ func integratedTestSuite(ctx context.Context, net *NetworkHarness, t *testing.T,
691
709
endpointDisabled := subServersDisabled &&
692
710
endpoint .canDisable
693
711
712
+ expectedErr := "permission denied"
713
+ if endpoint .noAuth {
714
+ expectedErr = "unknown service"
715
+ }
716
+
694
717
tt .Run (endpoint .name + " lit port" , func (ttt * testing.T ) {
695
718
allowed := customURIs [endpoint .grpcWebURI ]
719
+
696
720
runLNCAuthTest (
697
721
ttt , rawLNCConn , endpoint .requestFn ,
698
722
endpoint .successPattern ,
699
- allowed , "permission denied" ,
700
- endpointDisabled , endpoint .noAuth ,
723
+ allowed , expectedErr ,
724
+ endpointDisabled ,
725
+ endpoint .noAuth ,
701
726
)
702
727
})
703
728
}
@@ -817,6 +842,10 @@ func runGRPCAuthTest(t *testing.T, hostPort, tlsCertPath, macPath string,
817
842
require .NoError (t , err )
818
843
ctxm = macaroonContext (ctxt , macBytes )
819
844
resp , err = makeRequest (ctxm , rawConn )
845
+ if disabled {
846
+ require .ErrorContains (t , err , disabledErr )
847
+ return
848
+ }
820
849
require .NoError (t , err )
821
850
822
851
json , err := marshalOptions .Marshal (resp )
0 commit comments