Merge "wspr: Rename VDL uppercase acronyms."
diff --git a/services/wsprd/app/app.go b/services/wsprd/app/app.go
index b02f0a4..81d3e49 100644
--- a/services/wsprd/app/app.go
+++ b/services/wsprd/app/app.go
@@ -154,7 +154,7 @@
}
// finishCall waits for the call to finish and write out the response to w.
-func (c *Controller) finishCall(ctx *context.T, w lib.ClientWriter, clientCall ipc.ClientCall, msg *VeyronRPCRequest, span vtrace.Span) {
+func (c *Controller) finishCall(ctx *context.T, w lib.ClientWriter, clientCall ipc.ClientCall, msg *RpcRequest, span vtrace.Span) {
if msg.IsStreaming {
for {
var item interface{}
@@ -194,7 +194,7 @@
func (c *Controller) sendRPCResponse(ctx *context.T, w lib.ClientWriter, span vtrace.Span, results []*vdl.Value) {
span.Finish()
- response := VeyronRPCResponse{
+ response := RpcResponse{
OutArgs: results,
TraceResponse: vtrace.GetResponse(ctx),
}
@@ -208,7 +208,7 @@
}
}
-func (c *Controller) startCall(ctx *context.T, w lib.ClientWriter, msg *VeyronRPCRequest, inArgs []interface{}) (ipc.ClientCall, error) {
+func (c *Controller) startCall(ctx *context.T, w lib.ClientWriter, msg *RpcRequest, inArgs []interface{}) (ipc.ClientCall, error) {
methodName := lib.UppercaseFirstCharacter(msg.Method)
retryTimeoutOpt := options.RetryTimeout(time.Duration(*retryTimeout) * time.Second)
clientCall, err := v23.GetClient(ctx).StartCall(ctx, msg.Name, methodName, inArgs, retryTimeoutOpt)
@@ -316,7 +316,7 @@
// SendVeyronRequest makes a vanadium request for the given flowId. If signal is non-nil, it will receive
// the call object after it has been constructed.
-func (c *Controller) sendVeyronRequest(ctx *context.T, id int32, msg *VeyronRPCRequest, inArgs []interface{}, w lib.ClientWriter, stream *outstandingStream, span vtrace.Span) {
+func (c *Controller) sendVeyronRequest(ctx *context.T, id int32, msg *RpcRequest, inArgs []interface{}, w lib.ClientWriter, stream *outstandingStream, span vtrace.Span) {
sig, err := c.getSignature(ctx, msg.Name)
if err != nil {
w.Error(err)
@@ -361,7 +361,7 @@
// any of this context information.
type localCall struct {
ctx *context.T
- vrpc *VeyronRPCRequest
+ vrpc *RpcRequest
tags []*vdl.Value
w lib.ClientWriter
}
@@ -398,7 +398,7 @@
func (l *localCall) RemoteEndpoint() naming.Endpoint { return nil }
func (l *localCall) VanadiumContext() *context.T { return l.ctx }
-func (c *Controller) handleInternalCall(ctx *context.T, invoker ipc.Invoker, msg *VeyronRPCRequest, decoder *vom.Decoder, w lib.ClientWriter, span vtrace.Span) {
+func (c *Controller) handleInternalCall(ctx *context.T, invoker ipc.Invoker, msg *RpcRequest, decoder *vom.Decoder, w lib.ClientWriter, span vtrace.Span) {
argptrs, tags, err := invoker.Prepare(msg.Method, int(msg.NumInArgs))
if err != nil {
w.Error(verror.Convert(verror.ErrInternal, ctx, err))
@@ -460,12 +460,12 @@
return
}
- var msg VeyronRPCRequest
+ var msg RpcRequest
if err := decoder.Decode(&msg); err != nil {
w.Error(verror.Convert(verror.ErrInternal, ctx, err))
return
}
- vlog.VI(2).Infof("VeyronRPC: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
+ vlog.VI(2).Infof("Rpc: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
spanName := fmt.Sprintf("<wspr>%q.%s", msg.Name, msg.Method)
ctx, span := vtrace.SetContinuedTrace(ctx, spanName, msg.TraceRequest)
@@ -652,13 +652,13 @@
server.HandleServerResponse(id, data)
}
-// parseVeyronRequest parses a json rpc request into a VeyronRPCRequest object.
-func (c *Controller) parseVeyronRequest(data string) (*VeyronRPCRequest, error) {
- var msg VeyronRPCRequest
+// parseVeyronRequest parses a json rpc request into a RpcRequest object.
+func (c *Controller) parseVeyronRequest(data string) (*RpcRequest, error) {
+ var msg RpcRequest
if err := lib.VomDecode(data, &msg); err != nil {
return nil, err
}
- vlog.VI(2).Infof("VeyronRPCRequest: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
+ vlog.VI(2).Infof("RpcRequest: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
return &msg, nil
}
@@ -673,8 +673,8 @@
return c.getSignature(call.Context(), name)
}
-// UnlinkJSBlessings removes the given blessings from the blessings store.
-func (c *Controller) UnlinkJSBlessings(_ ipc.ServerCall, handle int32) error {
+// UnlinkBlessings removes the given blessings from the blessings store.
+func (c *Controller) UnlinkBlessings(_ ipc.ServerCall, handle int32) error {
c.blessingsStore.Remove(handle)
return nil
}
diff --git a/services/wsprd/app/app.vdl b/services/wsprd/app/app.vdl
index 08c57d6..46a1834 100644
--- a/services/wsprd/app/app.vdl
+++ b/services/wsprd/app/app.vdl
@@ -3,22 +3,22 @@
package app
import (
+ "time"
+
"v.io/v23/vtrace"
- "time"
)
-type VeyronRPCRequest struct {
- Name string
- Method string
- NumInArgs int32
- NumOutArgs int32
- IsStreaming bool
- // TODO(bjornick): Change Timeout to use time.WireDeadline instead.
- Deadline time.WireDeadline
+type RpcRequest struct {
+ Name string
+ Method string
+ NumInArgs int32
+ NumOutArgs int32
+ IsStreaming bool
+ Deadline time.WireDeadline
TraceRequest vtrace.Request
}
-type VeyronRPCResponse struct {
+type RpcResponse struct {
OutArgs []any
TraceResponse vtrace.Response
}
diff --git a/services/wsprd/app/app.vdl.go b/services/wsprd/app/app.vdl.go
index b5144c2..53d02a3 100644
--- a/services/wsprd/app/app.vdl.go
+++ b/services/wsprd/app/app.vdl.go
@@ -14,33 +14,32 @@
"v.io/v23/vtrace"
)
-type VeyronRPCRequest struct {
- Name string
- Method string
- NumInArgs int32
- NumOutArgs int32
- IsStreaming bool
- // TODO(bjornick): Change Timeout to use time.WireDeadline instead.
+type RpcRequest struct {
+ Name string
+ Method string
+ NumInArgs int32
+ NumOutArgs int32
+ IsStreaming bool
Deadline time.Deadline
TraceRequest vtrace.Request
}
-func (VeyronRPCRequest) __VDLReflect(struct {
- Name string "v.io/x/ref/services/wsprd/app.VeyronRPCRequest"
+func (RpcRequest) __VDLReflect(struct {
+ Name string "v.io/x/ref/services/wsprd/app.RpcRequest"
}) {
}
-type VeyronRPCResponse struct {
+type RpcResponse struct {
OutArgs []*vdl.Value
TraceResponse vtrace.Response
}
-func (VeyronRPCResponse) __VDLReflect(struct {
- Name string "v.io/x/ref/services/wsprd/app.VeyronRPCResponse"
+func (RpcResponse) __VDLReflect(struct {
+ Name string "v.io/x/ref/services/wsprd/app.RpcResponse"
}) {
}
func init() {
- vdl.Register((*VeyronRPCRequest)(nil))
- vdl.Register((*VeyronRPCResponse)(nil))
+ vdl.Register((*RpcRequest)(nil))
+ vdl.Register((*RpcResponse)(nil))
}
diff --git a/services/wsprd/app/app_test.go b/services/wsprd/app/app_test.go
index fa51687..70f7055 100644
--- a/services/wsprd/app/app_test.go
+++ b/services/wsprd/app/app_test.go
@@ -225,7 +225,7 @@
}()
}
- request := VeyronRPCRequest{
+ request := RpcRequest{
Name: "/" + endpoint.String(),
Method: testCase.method,
NumInArgs: int32(len(testCase.inArgs)),
@@ -240,7 +240,7 @@
}
func makeRPCResponse(outArgs ...*vdl.Value) string {
- return lib.VomEncodeOrDie(VeyronRPCResponse{
+ return lib.VomEncodeOrDie(RpcResponse{
OutArgs: outArgs,
TraceResponse: vtrace.Response{},
})
@@ -310,7 +310,7 @@
proxyShutdown func()
}
-func makeRequest(rpc VeyronRPCRequest, args ...interface{}) (string, error) {
+func makeRequest(rpc RpcRequest, args ...interface{}) (string, error) {
var buf bytes.Buffer
encoder, err := vom.NewEncoder(&buf)
if err != nil {
@@ -354,7 +354,7 @@
v23.GetNamespace(controller.Context()).SetRoots("/" + endpoint.String())
- req, err := makeRequest(VeyronRPCRequest{
+ req, err := makeRequest(RpcRequest{
Name: "__controller",
Method: "Serve",
NumInArgs: 2,
diff --git a/services/wsprd/app/controller.vdl b/services/wsprd/app/controller.vdl
index 9804123..9b7c5ac 100644
--- a/services/wsprd/app/controller.vdl
+++ b/services/wsprd/app/controller.vdl
@@ -19,8 +19,8 @@
// RemoveName removes a published name from an existing server.
RemoveName(serverId uint32, name string) error
- // UnlinkJSBlessings removes the given blessings from the blessings store.
- UnlinkJSBlessings(handle int32) error
+ // UnlinkBlessings removes the given blessings from the blessings store.
+ UnlinkBlessings(handle int32) error
// BlessPublicKey creates a new blessing.
BlessPublicKey(fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string | error)
// CreateBlessings creates a new principal self-blessed with the given extension.
diff --git a/services/wsprd/app/controller.vdl.go b/services/wsprd/app/controller.vdl.go
index 3dfbf5b..32938d0 100644
--- a/services/wsprd/app/controller.vdl.go
+++ b/services/wsprd/app/controller.vdl.go
@@ -29,8 +29,8 @@
AddName(ctx *context.T, serverId uint32, name string, opts ...ipc.CallOpt) error
// RemoveName removes a published name from an existing server.
RemoveName(ctx *context.T, serverId uint32, name string, opts ...ipc.CallOpt) error
- // UnlinkJSBlessings removes the given blessings from the blessings store.
- UnlinkJSBlessings(ctx *context.T, handle int32, opts ...ipc.CallOpt) error
+ // UnlinkBlessings removes the given blessings from the blessings store.
+ UnlinkBlessings(ctx *context.T, handle int32, opts ...ipc.CallOpt) error
// BlessPublicKey creates a new blessing.
BlessPublicKey(ctx *context.T, fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string, opts ...ipc.CallOpt) (handle int32, publicKey string, err error)
// CreateBlessings creates a new principal self-blessed with the given extension.
@@ -106,9 +106,9 @@
return
}
-func (c implControllerClientStub) UnlinkJSBlessings(ctx *context.T, i0 int32, opts ...ipc.CallOpt) (err error) {
+func (c implControllerClientStub) UnlinkBlessings(ctx *context.T, i0 int32, opts ...ipc.CallOpt) (err error) {
var call ipc.ClientCall
- if call, err = c.c(ctx).StartCall(ctx, c.name, "UnlinkJSBlessings", []interface{}{i0}, opts...); err != nil {
+ if call, err = c.c(ctx).StartCall(ctx, c.name, "UnlinkBlessings", []interface{}{i0}, opts...); err != nil {
return
}
err = call.Finish()
@@ -164,8 +164,8 @@
AddName(call ipc.ServerCall, serverId uint32, name string) error
// RemoveName removes a published name from an existing server.
RemoveName(call ipc.ServerCall, serverId uint32, name string) error
- // UnlinkJSBlessings removes the given blessings from the blessings store.
- UnlinkJSBlessings(call ipc.ServerCall, handle int32) error
+ // UnlinkBlessings removes the given blessings from the blessings store.
+ UnlinkBlessings(call ipc.ServerCall, handle int32) error
// BlessPublicKey creates a new blessing.
BlessPublicKey(call ipc.ServerCall, fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string, err error)
// CreateBlessings creates a new principal self-blessed with the given extension.
@@ -227,8 +227,8 @@
return s.impl.RemoveName(call, i0, i1)
}
-func (s implControllerServerStub) UnlinkJSBlessings(call ipc.ServerCall, i0 int32) error {
- return s.impl.UnlinkJSBlessings(call, i0)
+func (s implControllerServerStub) UnlinkBlessings(call ipc.ServerCall, i0 int32) error {
+ return s.impl.UnlinkBlessings(call, i0)
}
func (s implControllerServerStub) BlessPublicKey(call ipc.ServerCall, i0 int32, i1 []security.Caveat, i2 time.Duration, i3 string) (int32, string, error) {
@@ -295,8 +295,8 @@
},
},
{
- Name: "UnlinkJSBlessings",
- Doc: "// UnlinkJSBlessings removes the given blessings from the blessings store.",
+ Name: "UnlinkBlessings",
+ Doc: "// UnlinkBlessings removes the given blessings from the blessings store.",
InArgs: []ipc.ArgDesc{
{"handle", ``}, // int32
},
diff --git a/services/wsprd/app/mock_jsServer_test.go b/services/wsprd/app/mock_jsServer_test.go
index 090bb19..6bf089f 100644
--- a/services/wsprd/app/mock_jsServer_test.go
+++ b/services/wsprd/app/mock_jsServer_test.go
@@ -299,7 +299,7 @@
func (m *mockJSServer) handleStreamClose(msg interface{}) error {
m.sender.Wait()
- reply := lib.ServerRPCReply{
+ reply := lib.ServerRpcReply{
Results: []*vdl.Value{m.finalResponse},
Err: m.finalError,
}
diff --git a/services/wsprd/browspr/browspr_test.go b/services/wsprd/browspr/browspr_test.go
index 7c037bf..9a886c2 100644
--- a/services/wsprd/browspr/browspr_test.go
+++ b/services/wsprd/browspr/browspr_test.go
@@ -168,7 +168,7 @@
t.Fatalf("Failed to associate account: %v")
}
- rpc := app.VeyronRPCRequest{
+ rpc := app.RpcRequest{
Name: mockServerName,
Method: "BasicCall",
NumInArgs: 1,
@@ -244,7 +244,7 @@
if outArg, ok = responseMsg.Message.(string); !ok {
t.Errorf("Got unexpected response message body of type %T, expected type string", responseMsg.Message)
}
- var result app.VeyronRPCResponse
+ var result app.RpcResponse
if err := lib.VomDecode(outArg, &result); err != nil {
t.Errorf("Failed to vom decode args from %v: %v", outArg, err)
}
diff --git a/services/wsprd/ipc/server/server.go b/services/wsprd/ipc/server/server.go
index 4543182..fc57e90 100644
--- a/services/wsprd/ipc/server/server.go
+++ b/services/wsprd/ipc/server/server.go
@@ -101,7 +101,7 @@
outstandingRequestLock sync.Mutex
// The set of outstanding server requests.
- outstandingServerRequests map[int32]chan *lib.ServerRPCReply
+ outstandingServerRequests map[int32]chan *lib.ServerRpcReply
outstandingAuthRequests map[int32]chan error
@@ -113,7 +113,7 @@
id: id,
helper: helper,
listenSpec: listenSpec,
- outstandingServerRequests: make(map[int32]chan *lib.ServerRPCReply),
+ outstandingServerRequests: make(map[int32]chan *lib.ServerRpcReply),
outstandingAuthRequests: make(map[int32]chan error),
outstandingValidationRequests: make(map[int32]chan []error),
}
@@ -128,14 +128,14 @@
// remoteInvokeFunc is a type of function that can invoke a remote method and
// communicate the result back via a channel to the caller
-type remoteInvokeFunc func(methodName string, args []interface{}, call ipc.StreamServerCall) <-chan *lib.ServerRPCReply
+type remoteInvokeFunc func(methodName string, args []interface{}, call ipc.StreamServerCall) <-chan *lib.ServerRpcReply
func (s *Server) createRemoteInvokerFunc(handle int32) remoteInvokeFunc {
- return func(methodName string, args []interface{}, call ipc.StreamServerCall) <-chan *lib.ServerRPCReply {
+ return func(methodName string, args []interface{}, call ipc.StreamServerCall) <-chan *lib.ServerRpcReply {
securityCall := s.convertSecurityCall(call, true)
flow := s.helper.CreateNewFlow(s, call)
- replyChan := make(chan *lib.ServerRPCReply, 1)
+ replyChan := make(chan *lib.ServerRpcReply, 1)
s.outstandingRequestLock.Lock()
s.outstandingServerRequests[flow.ID] = replyChan
s.outstandingRequestLock.Unlock()
@@ -145,10 +145,10 @@
timeout.Time = deadline
}
- errHandler := func(err error) <-chan *lib.ServerRPCReply {
+ errHandler := func(err error) <-chan *lib.ServerRpcReply {
if ch := s.popServerRequest(flow.ID); ch != nil {
stdErr := verror.Convert(verror.ErrInternal, call.Context(), err).(verror.E)
- ch <- &lib.ServerRPCReply{nil, &stdErr, vtrace.Response{}}
+ ch <- &lib.ServerRpcReply{nil, &stdErr, vtrace.Response{}}
s.helper.CleanupFlow(flow.ID)
}
return replyChan
@@ -191,7 +191,7 @@
s.helper.CleanupFlow(flow.ID)
err := verror.Convert(verror.ErrAborted, call.Context(), call.Context().Err()).(verror.E)
- ch <- &lib.ServerRPCReply{nil, &err, vtrace.Response{}}
+ ch <- &lib.ServerRpcReply{nil, &err, vtrace.Response{}}
}()
go proxyStream(call, flow.Writer)
@@ -238,7 +238,7 @@
ch: globChan,
ctx: call.Context(),
})
- replyChan := make(chan *lib.ServerRPCReply, 1)
+ replyChan := make(chan *lib.ServerRpcReply, 1)
s.outstandingRequestLock.Lock()
s.outstandingServerRequests[flow.ID] = replyChan
s.outstandingRequestLock.Unlock()
@@ -291,7 +291,7 @@
s.helper.CleanupFlow(flow.ID)
err := verror.Convert(verror.ErrAborted, call.Context(), call.Context().Err()).(verror.E)
- ch <- &lib.ServerRPCReply{nil, &err, vtrace.Response{}}
+ ch <- &lib.ServerRpcReply{nil, &err, vtrace.Response{}}
}()
return globChan, nil
@@ -525,7 +525,7 @@
return nil
}
-func (s *Server) popServerRequest(id int32) chan *lib.ServerRPCReply {
+func (s *Server) popServerRequest(id int32) chan *lib.ServerRpcReply {
s.outstandingRequestLock.Lock()
defer s.outstandingRequestLock.Unlock()
ch := s.outstandingServerRequests[id]
@@ -544,7 +544,7 @@
}
// Decode the result and send it through the channel
- var reply lib.ServerRPCReply
+ var reply lib.ServerRpcReply
if err := lib.VomDecode(data, &reply); err != nil {
reply.Err = err
}
@@ -636,7 +636,7 @@
func (s *Server) Stop() {
stdErr := verror.New(verror.ErrTimeout, nil).(verror.E)
- result := lib.ServerRPCReply{
+ result := lib.ServerRpcReply{
Results: nil,
Err: &stdErr,
}
@@ -659,7 +659,7 @@
}
s.outstandingRequestLock.Lock()
s.outstandingAuthRequests = make(map[int32]chan error)
- s.outstandingServerRequests = make(map[int32]chan *lib.ServerRPCReply)
+ s.outstandingServerRequests = make(map[int32]chan *lib.ServerRpcReply)
s.outstandingValidationRequests = make(map[int32]chan []error)
s.outstandingRequestLock.Unlock()
s.serverStateLock.Unlock()
diff --git a/services/wsprd/lib/writer.vdl b/services/wsprd/lib/writer.vdl
index bab2b75..d719e90 100644
--- a/services/wsprd/lib/writer.vdl
+++ b/services/wsprd/lib/writer.vdl
@@ -3,8 +3,8 @@
import "v.io/v23/vtrace"
// The response from the javascript server to the proxy.
-type ServerRPCReply struct {
- Results []any
- Err error
- TraceResponse vtrace.Response
+type ServerRpcReply struct {
+ Results []any
+ Err error
+ TraceResponse vtrace.Response
}
diff --git a/services/wsprd/lib/writer.vdl.go b/services/wsprd/lib/writer.vdl.go
index 88e0510..cf05c91 100644
--- a/services/wsprd/lib/writer.vdl.go
+++ b/services/wsprd/lib/writer.vdl.go
@@ -12,17 +12,17 @@
)
// The response from the javascript server to the proxy.
-type ServerRPCReply struct {
+type ServerRpcReply struct {
Results []*vdl.Value
Err error
TraceResponse vtrace.Response
}
-func (ServerRPCReply) __VDLReflect(struct {
- Name string "v.io/x/ref/services/wsprd/lib.ServerRPCReply"
+func (ServerRpcReply) __VDLReflect(struct {
+ Name string "v.io/x/ref/services/wsprd/lib.ServerRpcReply"
}) {
}
func init() {
- vdl.Register((*ServerRPCReply)(nil))
+ vdl.Register((*ServerRpcReply)(nil))
}