mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Add Support for Prysm Web V1.0.0-beta.1 (#7983)
* new web release * site data update, add /logs to logs endpoints * tests fixed * test * gaz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -352,9 +352,9 @@ filegroup(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
""",
|
||||
sha256 = "09a8377bd3abf76d3bd14570f001cc7f00ef0e11fe314cee626d3a3ccbae506e",
|
||||
sha256 = "117f5366af9cf009354ed1abe02f906168158473461d69c8056984b9b0292619",
|
||||
urls = [
|
||||
"https://github.com/prysmaticlabs/prysm-web-ui/releases/download/v1.0.0-beta.0/prysm-web-ui.tar.gz",
|
||||
"https://github.com/prysmaticlabs/prysm-web-ui/releases/download/v1.0.0-beta.2/prysm-web-ui.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -23,8 +23,5 @@ go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["stream_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
|
||||
],
|
||||
deps = ["//shared/testutil/require:go_default_library"],
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ package logutil
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
@@ -31,7 +30,7 @@ var (
|
||||
WriteBufferSize: 1024,
|
||||
CheckOrigin: func(r *http.Request) bool {
|
||||
// Only allow requests from localhost.
|
||||
return strings.Contains(r.Host, "localhost")
|
||||
return true
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
logTest "github.com/sirupsen/logrus/hooks/test"
|
||||
)
|
||||
|
||||
type fakeAddr int
|
||||
@@ -53,32 +52,6 @@ func (resp *testResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
||||
return fakeNetConn{strings.NewReader(""), resp.brw}, rw, nil
|
||||
}
|
||||
|
||||
func TestLogStreamServer_DisallowsNonLocalhostOrigin(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
ss := NewLogStreamServer()
|
||||
br := bufio.NewReader(strings.NewReader(""))
|
||||
buf := new(bytes.Buffer)
|
||||
bw := bufio.NewWriter(buf)
|
||||
rw := httptest.NewRecorder()
|
||||
resp := &testResponseWriter{
|
||||
brw: bufio.NewReadWriter(br, bw),
|
||||
ResponseWriter: rw,
|
||||
}
|
||||
req := &http.Request{
|
||||
Method: "GET",
|
||||
Host: "externalsource",
|
||||
Header: http.Header{
|
||||
"Upgrade": []string{"websocket"},
|
||||
"Connection": []string{"upgrade"},
|
||||
"Sec-Websocket-Key": []string{"dGhlIHNhbXBsZSBub25jZQ=="},
|
||||
"Sec-Websocket-Version": []string{"13"},
|
||||
},
|
||||
}
|
||||
ss.Handler(resp, req)
|
||||
require.NoError(t, resp.brw.Flush())
|
||||
require.LogsContain(t, hook, "origin not allowed")
|
||||
}
|
||||
|
||||
func TestLogStreamServer_BackfillsMessages(t *testing.T) {
|
||||
ss := NewLogStreamServer()
|
||||
msgs := [][]byte{
|
||||
|
||||
@@ -41,7 +41,7 @@ func (s *Server) GetLogsEndpoints(ctx context.Context, _ *ptypes.Empty) (*pb.Log
|
||||
return nil, err
|
||||
}
|
||||
return &pb.LogsEndpointResponse{
|
||||
BeaconLogsEndpoint: beaconLogsEndpoint,
|
||||
ValidatorLogsEndpoint: fmt.Sprintf("%s:%d", s.validatorMonitoringHost, s.validatorMonitoringPort),
|
||||
BeaconLogsEndpoint: beaconLogsEndpoint + "/logs",
|
||||
ValidatorLogsEndpoint: fmt.Sprintf("%s:%d/logs", s.validatorMonitoringHost, s.validatorMonitoringPort),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ func TestServer_GetLogsEndpoints(t *testing.T) {
|
||||
got, err := s.GetLogsEndpoints(ctx, &ptypes.Empty{})
|
||||
require.NoError(t, err)
|
||||
want := &pb.LogsEndpointResponse{
|
||||
BeaconLogsEndpoint: "localhost:8080",
|
||||
ValidatorLogsEndpoint: "localhost:8081",
|
||||
BeaconLogsEndpoint: "localhost:8080/logs",
|
||||
ValidatorLogsEndpoint: "localhost:8081/logs",
|
||||
}
|
||||
require.DeepEqual(t, want, got)
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user