ref: Update many variable names for *Calls to call.
In a previous change I renamed many types from *Context to *Call.
In this change I am trying to also update as many variable names
as can easily be changed. I have only altered variables whose
type was trivially determined.
MultiPart: 3/8
Change-Id: I0d71623921d14b42857d7d59140e9ad15c50da7f
diff --git a/cmd/binary/impl_test.go b/cmd/binary/impl_test.go
index e46f0a3..62a52a1 100644
--- a/cmd/binary/impl_test.go
+++ b/cmd/binary/impl_test.go
@@ -79,7 +79,7 @@
return nil, "", nil
}
-func (s *server) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+func (s *server) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
return nil
}
diff --git a/cmd/mgmt/device/impl/local_install.go b/cmd/mgmt/device/impl/local_install.go
index 4054201..e07c3e4 100644
--- a/cmd/mgmt/device/impl/local_install.go
+++ b/cmd/mgmt/device/impl/local_install.go
@@ -164,7 +164,7 @@
return "", 0, errNotImplemented
}
-func (i binaryInvoker) Stat(ctx ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
+func (i binaryInvoker) Stat(call ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
fileName := string(i)
h := md5.New()
bytes, err := ioutil.ReadFile(fileName)
@@ -180,11 +180,11 @@
return errNotImplemented
}
-func (binaryInvoker) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+func (binaryInvoker) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
return nil, "", errNotImplemented
}
-func (binaryInvoker) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+func (binaryInvoker) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
return errNotImplemented
}
diff --git a/cmd/mounttable/impl_test.go b/cmd/mounttable/impl_test.go
index 114428d..cc7182d 100644
--- a/cmd/mounttable/impl_test.go
+++ b/cmd/mounttable/impl_test.go
@@ -22,7 +22,7 @@
suffix string
}
-func (s *server) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (s *server) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
vlog.VI(2).Infof("Glob() was called. suffix=%v pattern=%q", s.suffix, pattern)
ch := make(chan naming.VDLGlobReply, 2)
ch <- naming.VDLGlobReplyEntry{naming.VDLMountEntry{"name1", []naming.VDLMountedServer{{"server1", nil, 123}}, false}}
diff --git a/examples/rps/rpsbot/impl.go b/examples/rps/rpsbot/impl.go
index 5c7b45e..15310b4 100644
--- a/examples/rps/rpsbot/impl.go
+++ b/examples/rps/rpsbot/impl.go
@@ -34,12 +34,12 @@
return r.scoreKeeper
}
-func (r *RPS) CreateGame(ctx ipc.ServerCall, opts rps.GameOptions) (rps.GameID, error) {
+func (r *RPS) CreateGame(call ipc.ServerCall, opts rps.GameOptions) (rps.GameID, error) {
if vlog.V(1) {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.Infof("CreateGame %+v from %v", opts, b)
}
- names, _ := ctx.LocalBlessings().ForCall(ctx)
+ names, _ := call.LocalBlessings().ForCall(call)
if len(names) == 0 {
return rps.GameID{}, errors.New("no names provided for context")
}
@@ -55,15 +55,15 @@
return r.judge.play(ctx, names[0], id)
}
-func (r *RPS) Challenge(ctx ipc.ServerCall, address string, id rps.GameID, opts rps.GameOptions) error {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (r *RPS) Challenge(call ipc.ServerCall, address string, id rps.GameID, opts rps.GameOptions) error {
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Challenge (%q, %+v, %+v) from %v", address, id, opts, b)
newctx, _ := vtrace.SetNewTrace(r.ctx)
return r.player.challenge(newctx, address, id, opts)
}
-func (r *RPS) Record(ctx ipc.ServerCall, score rps.ScoreCard) error {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (r *RPS) Record(call ipc.ServerCall, score rps.ScoreCard) error {
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Record (%+v) from %v", score, b)
- return r.scoreKeeper.Record(ctx, score)
+ return r.scoreKeeper.Record(call, score)
}
diff --git a/examples/rps/rpsbot/scorekeeper.go b/examples/rps/rpsbot/scorekeeper.go
index 3883aa4..7b7a4ea 100644
--- a/examples/rps/rpsbot/scorekeeper.go
+++ b/examples/rps/rpsbot/scorekeeper.go
@@ -23,8 +23,8 @@
return k.numRecords.Value()
}
-func (k *ScoreKeeper) Record(ctx ipc.ServerCall, score rps.ScoreCard) error {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (k *ScoreKeeper) Record(call ipc.ServerCall, score rps.ScoreCard) error {
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Received ScoreCard from %v:", b)
vlog.VI(1).Info(common.FormatScoreCard(score))
k.numRecords.Incr(1)
diff --git a/examples/rps/rpsplayer/main.go b/examples/rps/rpsplayer/main.go
index f7d69a3..2b7b979 100644
--- a/examples/rps/rpsplayer/main.go
+++ b/examples/rps/rpsplayer/main.go
@@ -71,8 +71,8 @@
return prev
}
-func (i *impl) Challenge(ctx ipc.ServerCall, address string, id rps.GameID, opts rps.GameOptions) error {
- remote, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (i *impl) Challenge(call ipc.ServerCall, address string, id rps.GameID, opts rps.GameOptions) error {
+ remote, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Challenge (%q, %+v) from %v", address, id, remote)
// When setDecline(true) returns, future challenges will be declined.
// Whether the current challenge should be considered depends on the
diff --git a/examples/rps/rpsscorekeeper/main.go b/examples/rps/rpsscorekeeper/main.go
index 04c216f..cf1b025 100644
--- a/examples/rps/rpsscorekeeper/main.go
+++ b/examples/rps/rpsscorekeeper/main.go
@@ -23,8 +23,8 @@
ch chan rps.ScoreCard
}
-func (i *impl) Record(ctx ipc.ServerCall, score rps.ScoreCard) error {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (i *impl) Record(call ipc.ServerCall, score rps.ScoreCard) error {
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Record (%+v) from %v", score, b)
i.ch <- score
return nil
diff --git a/profiles/internal/ipc/benchmark/glob/glob_test.go b/profiles/internal/ipc/benchmark/glob/glob_test.go
index 1889c0c..ce83d50 100644
--- a/profiles/internal/ipc/benchmark/glob/glob_test.go
+++ b/profiles/internal/ipc/benchmark/glob/glob_test.go
@@ -98,7 +98,7 @@
bufferSize int
}
-func (o *globObject) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (o *globObject) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
if pattern != "*" {
panic("this benchmark only works with pattern='*'")
}
@@ -118,8 +118,8 @@
bufferSize int
}
-func (o *globChildrenObject) GlobChildren__(ctx ipc.ServerCall) (<-chan string, error) {
- if ctx.Suffix() != "" {
+func (o *globChildrenObject) GlobChildren__(call ipc.ServerCall) (<-chan string, error) {
+ if call.Suffix() != "" {
return nil, nil
}
ch := make(chan string, o.bufferSize)
diff --git a/profiles/internal/ipc/benchmark/internal/server.go b/profiles/internal/ipc/benchmark/internal/server.go
index cc4731b..d65f35f 100644
--- a/profiles/internal/ipc/benchmark/internal/server.go
+++ b/profiles/internal/ipc/benchmark/internal/server.go
@@ -14,7 +14,7 @@
type impl struct {
}
-func (i *impl) Echo(ctx ipc.ServerCall, payload []byte) ([]byte, error) {
+func (i *impl) Echo(call ipc.ServerCall, payload []byte) ([]byte, error) {
return payload, nil
}
diff --git a/profiles/internal/ipc/cancel_test.go b/profiles/internal/ipc/cancel_test.go
index 45cc811..6a510ab 100644
--- a/profiles/internal/ipc/cancel_test.go
+++ b/profiles/internal/ipc/cancel_test.go
@@ -31,7 +31,7 @@
stop func() error
}
-func (c *canceld) Run(ctx ipc.StreamServerCall) error {
+func (c *canceld) Run(call ipc.StreamServerCall) error {
close(c.started)
client, err := InternalNewClient(c.sm, c.ns)
@@ -41,14 +41,14 @@
}
if c.child != "" {
- if _, err = client.StartCall(ctx.Context(), c.child, "Run", []interface{}{}); err != nil {
+ if _, err = client.StartCall(call.Context(), c.child, "Run", []interface{}{}); err != nil {
vlog.Error(err)
return err
}
}
vlog.Info(c.name, " waiting for cancellation")
- <-ctx.Context().Done()
+ <-call.Context().Done()
vlog.Info(c.name, " canceled")
close(c.canceled)
return nil
diff --git a/profiles/internal/ipc/default_authorizer.go b/profiles/internal/ipc/default_authorizer.go
index eb49874..109a097 100644
--- a/profiles/internal/ipc/default_authorizer.go
+++ b/profiles/internal/ipc/default_authorizer.go
@@ -9,11 +9,11 @@
// delegate of the other.
type defaultAuthorizer struct{}
-func (defaultAuthorizer) Authorize(ctx security.Call) error {
+func (defaultAuthorizer) Authorize(call security.Call) error {
var (
- localForCall, localErr = ctx.LocalBlessings().ForCall(ctx)
- remote = ctx.RemoteBlessings()
- remoteForCall, remoteErr = remote.ForCall(ctx)
+ localForCall, localErr = call.LocalBlessings().ForCall(call)
+ remote = call.RemoteBlessings()
+ remoteForCall, remoteErr = remote.ForCall(call)
)
// Authorize if any element in localForCall is a "delegate of" (i.e., has been
// blessed by) any element in remote, OR vice-versa.
diff --git a/profiles/internal/ipc/full_test.go b/profiles/internal/ipc/full_test.go
index e92a5fc..593684f 100644
--- a/profiles/internal/ipc/full_test.go
+++ b/profiles/internal/ipc/full_test.go
@@ -93,34 +93,34 @@
type testServer struct{}
-func (*testServer) Closure(ctx ipc.ServerCall) error {
+func (*testServer) Closure(call ipc.ServerCall) error {
return nil
}
-func (*testServer) Error(ctx ipc.ServerCall) error {
+func (*testServer) Error(call ipc.ServerCall) error {
return errMethod
}
-func (*testServer) Echo(ctx ipc.ServerCall, arg string) (string, error) {
- return fmt.Sprintf("method:%q,suffix:%q,arg:%q", ctx.Method(), ctx.Suffix(), arg), nil
+func (*testServer) Echo(call ipc.ServerCall, arg string) (string, error) {
+ return fmt.Sprintf("method:%q,suffix:%q,arg:%q", call.Method(), call.Suffix(), arg), nil
}
-func (*testServer) EchoUser(ctx ipc.ServerCall, arg string, u userType) (string, userType, error) {
- return fmt.Sprintf("method:%q,suffix:%q,arg:%q", ctx.Method(), ctx.Suffix(), arg), u, nil
+func (*testServer) EchoUser(call ipc.ServerCall, arg string, u userType) (string, userType, error) {
+ return fmt.Sprintf("method:%q,suffix:%q,arg:%q", call.Method(), call.Suffix(), arg), u, nil
}
-func (*testServer) EchoBlessings(ctx ipc.ServerCall) (server, client string, _ error) {
- local, _ := ctx.LocalBlessings().ForCall(ctx)
- remote, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (*testServer) EchoBlessings(call ipc.ServerCall) (server, client string, _ error) {
+ local, _ := call.LocalBlessings().ForCall(call)
+ remote, _ := call.RemoteBlessings().ForCall(call)
return fmt.Sprintf("%v", local), fmt.Sprintf("%v", remote), nil
}
-func (*testServer) EchoGrantedBlessings(ctx ipc.ServerCall, arg string) (result, blessing string, _ error) {
- return arg, fmt.Sprintf("%v", ctx.GrantedBlessings()), nil
+func (*testServer) EchoGrantedBlessings(call ipc.ServerCall, arg string) (result, blessing string, _ error) {
+ return arg, fmt.Sprintf("%v", call.GrantedBlessings()), nil
}
-func (*testServer) EchoAndError(ctx ipc.ServerCall, arg string) (string, error) {
- result := fmt.Sprintf("method:%q,suffix:%q,arg:%q", ctx.Method(), ctx.Suffix(), arg)
+func (*testServer) EchoAndError(call ipc.ServerCall, arg string) (string, error) {
+ result := fmt.Sprintf("method:%q,suffix:%q,arg:%q", call.Method(), call.Suffix(), arg)
if arg == "error" {
return result, errMethod
}
@@ -182,7 +182,7 @@
called bool
}
-func (ds *dischargeServer) Discharge(ctx ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
+func (ds *dischargeServer) Discharge(call ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
ds.mu.Lock()
ds.called = true
ds.mu.Unlock()
@@ -190,7 +190,7 @@
if tp == nil {
return nil, fmt.Errorf("discharger: %v does not represent a third-party caveat", cav)
}
- if err := tp.Dischargeable(ctx); err != nil {
+ if err := tp.Dischargeable(call); err != nil {
return nil, fmt.Errorf("third-party caveat %v cannot be discharged for this context: %v", cav, err)
}
// Add a fakeTimeCaveat to be able to control discharge expiration via 'clock'.
@@ -198,7 +198,7 @@
if err != nil {
return nil, fmt.Errorf("failed to create an expiration on the discharge: %v", err)
}
- d, err := ctx.LocalPrincipal().MintDischarge(cav, expiry)
+ d, err := call.LocalPrincipal().MintDischarge(cav, expiry)
if err != nil {
return nil, err
}
@@ -837,9 +837,9 @@
traceid []uniqueid.Id
}
-func (s *dischargeTestServer) Discharge(ctx ipc.ServerCall, cav security.Caveat, impetus security.DischargeImpetus) (security.WireDischarge, error) {
+func (s *dischargeTestServer) Discharge(call ipc.ServerCall, cav security.Caveat, impetus security.DischargeImpetus) (security.WireDischarge, error) {
s.impetus = append(s.impetus, impetus)
- s.traceid = append(s.traceid, vtrace.GetSpan(ctx.Context()).Trace())
+ s.traceid = append(s.traceid, vtrace.GetSpan(call.Context()).Trace())
return nil, fmt.Errorf("discharges not issued")
}
@@ -1756,12 +1756,12 @@
called bool
}
-func (ed *expiryDischarger) Discharge(ctx ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
+func (ed *expiryDischarger) Discharge(call ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
tp := cav.ThirdPartyDetails()
if tp == nil {
return nil, fmt.Errorf("discharger: %v does not represent a third-party caveat", cav)
}
- if err := tp.Dischargeable(ctx); err != nil {
+ if err := tp.Dischargeable(call); err != nil {
return nil, fmt.Errorf("third-party caveat %v cannot be discharged for this context: %v", cav, err)
}
expDur := 10 * time.Millisecond
@@ -1772,7 +1772,7 @@
if err != nil {
return nil, fmt.Errorf("failed to create an expiration on the discharge: %v", err)
}
- d, err := ctx.LocalPrincipal().MintDischarge(cav, expiry)
+ d, err := call.LocalPrincipal().MintDischarge(cav, expiry)
if err != nil {
return nil, err
}
diff --git a/profiles/internal/ipc/glob_test.go b/profiles/internal/ipc/glob_test.go
index 57ce06f..0e8efff 100644
--- a/profiles/internal/ipc/glob_test.go
+++ b/profiles/internal/ipc/glob_test.go
@@ -194,7 +194,7 @@
suffix []string
}
-func (o *globObject) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (o *globObject) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
g, err := glob.Parse(pattern)
if err != nil {
return nil, err
diff --git a/profiles/internal/ipc/proxy_test.go b/profiles/internal/ipc/proxy_test.go
index a314004..e939cb9 100644
--- a/profiles/internal/ipc/proxy_test.go
+++ b/profiles/internal/ipc/proxy_test.go
@@ -49,8 +49,8 @@
type testServer struct{}
-func (*testServer) Echo(ctx ipc.ServerCall, arg string) (string, error) {
- return fmt.Sprintf("method:%q,suffix:%q,arg:%q", ctx.Method(), ctx.Suffix(), arg), nil
+func (*testServer) Echo(call ipc.ServerCall, arg string) (string, error) {
+ return fmt.Sprintf("method:%q,suffix:%q,arg:%q", call.Method(), call.Suffix(), arg), nil
}
type testServerAuthorizer struct{}
diff --git a/profiles/internal/ipc/reserved.go b/profiles/internal/ipc/reserved.go
index ff3f63f..a0b8370 100644
--- a/profiles/internal/ipc/reserved.go
+++ b/profiles/internal/ipc/reserved.go
@@ -143,10 +143,10 @@
return invoker.MethodSignature(ctx, ctx.Method())
}
-func (r *reservedMethods) Glob(ctx ipc.StreamServerCall, pattern string) error {
+func (r *reservedMethods) Glob(call ipc.StreamServerCall, pattern string) error {
// Copy the original call to shield ourselves from changes the flowServer makes.
- glob := globInternal{r.dispNormal, r.dispReserved, ctx.Suffix()}
- return glob.Glob(copyMutableCall(ctx), pattern)
+ glob := globInternal{r.dispNormal, r.dispReserved, call.Suffix()}
+ return glob.Glob(copyMutableCall(call), pattern)
}
// globInternal handles ALL the Glob requests received by a server and
@@ -319,11 +319,11 @@
// copyMutableContext returns a new mutableContext copied from ctx. Changes to
// the original ctx don't affect the mutable fields in the returned object.
-func copyMutableContext(ctx ipc.ServerCall) *mutableContext {
- c := &mutableContext{T: ctx.Context()}
- c.M.CallParams.Copy(ctx)
- c.M.GrantedBlessings = ctx.GrantedBlessings()
- c.M.Server = ctx.Server()
+func copyMutableContext(call ipc.ServerCall) *mutableContext {
+ c := &mutableContext{T: call.Context()}
+ c.M.CallParams.Copy(call)
+ c.M.GrantedBlessings = call.GrantedBlessings()
+ c.M.Server = call.Server()
return c
}
diff --git a/profiles/internal/ipc/server.go b/profiles/internal/ipc/server.go
index 06af75b..dac6a19 100644
--- a/profiles/internal/ipc/server.go
+++ b/profiles/internal/ipc/server.go
@@ -1170,8 +1170,8 @@
return nil
}
-func authorize(ctx ipc.ServerCall, auth security.Authorizer) error {
- if ctx.LocalPrincipal() == nil {
+func authorize(call ipc.ServerCall, auth security.Authorizer) error {
+ if call.LocalPrincipal() == nil {
// LocalPrincipal is nil means that the server wanted to avoid
// authentication, and thus wanted to skip authorization as well.
return nil
@@ -1179,9 +1179,9 @@
if auth == nil {
auth = defaultAuthorizer{}
}
- if err := auth.Authorize(ctx); err != nil {
+ if err := auth.Authorize(call); err != nil {
// TODO(ataly, ashankar): For privacy reasons, should we hide the authorizer error?
- return verror.New(verror.ErrNoAccess, ctx.Context(), newErrBadAuth(ctx.Context(), ctx.Suffix(), ctx.Method(), err))
+ return verror.New(verror.ErrNoAccess, call.Context(), newErrBadAuth(call.Context(), call.Suffix(), call.Method(), err))
}
return nil
}
diff --git a/profiles/internal/ipc/server_authorizer.go b/profiles/internal/ipc/server_authorizer.go
index 04efce6..14097a7 100644
--- a/profiles/internal/ipc/server_authorizer.go
+++ b/profiles/internal/ipc/server_authorizer.go
@@ -60,30 +60,30 @@
return auth
}
-func (a *serverAuthorizer) Authorize(ctx security.Call) error {
- if ctx.RemoteBlessings().IsZero() {
- return verror.New(errNoBlessings, ctx.Context())
+func (a *serverAuthorizer) Authorize(call security.Call) error {
+ if call.RemoteBlessings().IsZero() {
+ return verror.New(errNoBlessings, call.Context())
}
- serverBlessings, rejectedBlessings := ctx.RemoteBlessings().ForCall(ctx)
+ serverBlessings, rejectedBlessings := call.RemoteBlessings().ForCall(call)
if !matchedBy(a.patternsFromNameResolution, serverBlessings) {
- return verror.New(errAuthNoPatternMatch, ctx.Context(), serverBlessings, a.patternsFromNameResolution, rejectedBlessings)
+ return verror.New(errAuthNoPatternMatch, call.Context(), serverBlessings, a.patternsFromNameResolution, rejectedBlessings)
} else if enableSecureServerAuth {
// No server patterns were obtained while resolving the name, authorize
// the server using the default authorization policy.
- if err := (defaultAuthorizer{}).Authorize(ctx); err != nil {
- return verror.New(errDefaultAuthDenied, ctx.Context(), serverBlessings)
+ if err := (defaultAuthorizer{}).Authorize(call); err != nil {
+ return verror.New(errDefaultAuthDenied, call.Context(), serverBlessings)
}
}
for _, patterns := range a.allowedServerPolicies {
if !matchedBy(patterns, serverBlessings) {
- return verror.New(errAuthServerNotAllowed, ctx.Context(), serverBlessings, patterns, rejectedBlessings)
+ return verror.New(errAuthServerNotAllowed, call.Context(), serverBlessings, patterns, rejectedBlessings)
}
}
- if remoteKey, key := ctx.RemoteBlessings().PublicKey(), a.serverPublicKey; key != nil && !reflect.DeepEqual(remoteKey, key) {
- return verror.New(errAuthServerKeyNotAllowed, ctx.Context(), remoteKey, key)
+ if remoteKey, key := call.RemoteBlessings().PublicKey(), a.serverPublicKey; key != nil && !reflect.DeepEqual(remoteKey, key) {
+ return verror.New(errAuthServerKeyNotAllowed, call.Context(), remoteKey, key)
}
return nil
diff --git a/profiles/internal/ipc/server_test.go b/profiles/internal/ipc/server_test.go
index 07b33de..469cb59 100644
--- a/profiles/internal/ipc/server_test.go
+++ b/profiles/internal/ipc/server_test.go
@@ -124,7 +124,7 @@
type statusServer struct{ ch chan struct{} }
-func (s *statusServer) Hang(ctx ipc.ServerCall) error {
+func (s *statusServer) Hang(call ipc.ServerCall) error {
<-s.ch
return nil
}
diff --git a/profiles/internal/ipc/stream/vc/vc_test.go b/profiles/internal/ipc/stream/vc/vc_test.go
index 71cca9c..eab33fc 100644
--- a/profiles/internal/ipc/stream/vc/vc_test.go
+++ b/profiles/internal/ipc/stream/vc/vc_test.go
@@ -129,29 +129,29 @@
}
// Authorize tests that the context passed to the authorizer is the expected one.
-func (a *auth) Authorize(ctx security.Call) error {
+func (a *auth) Authorize(call security.Call) error {
if a.err != nil {
return a.err
}
- if got, want := ctx.LocalPrincipal(), a.localPrincipal; !reflect.DeepEqual(got, want) {
+ if got, want := call.LocalPrincipal(), a.localPrincipal; !reflect.DeepEqual(got, want) {
return fmt.Errorf("ctx.LocalPrincipal: got %v, want %v", got, want)
}
- if got, want := ctx.RemoteBlessings(), a.remoteBlessings; !reflect.DeepEqual(got, want) {
+ if got, want := call.RemoteBlessings(), a.remoteBlessings; !reflect.DeepEqual(got, want) {
return fmt.Errorf("ctx.RemoteBlessings: got %v, want %v", got, want)
}
- if got, want := ctx.RemoteDischarges(), a.remoteDischarges; !reflect.DeepEqual(got, want) {
+ if got, want := call.RemoteDischarges(), a.remoteDischarges; !reflect.DeepEqual(got, want) {
return fmt.Errorf("ctx.RemoteDischarges: got %v, want %v", got, want)
}
- if got, want := ctx.LocalEndpoint(), clientEP; !reflect.DeepEqual(got, want) {
+ if got, want := call.LocalEndpoint(), clientEP; !reflect.DeepEqual(got, want) {
return fmt.Errorf("ctx.LocalEndpoint: got %v, want %v", got, want)
}
- if got, want := ctx.RemoteEndpoint(), serverEP; !reflect.DeepEqual(got, want) {
+ if got, want := call.RemoteEndpoint(), serverEP; !reflect.DeepEqual(got, want) {
return fmt.Errorf("ctx.RemoteEndpoint: got %v, want %v", got, want)
}
- if got, want := ctx.Suffix(), a.suffix; got != want {
+ if got, want := call.Suffix(), a.suffix; got != want {
return fmt.Errorf("ctx.RemoteEndpoint: got %v, want %v", got, want)
}
- if got, want := ctx.Method(), a.method; got != want {
+ if got, want := call.Method(), a.method; got != want {
return fmt.Errorf("ctx.RemoteEndpoint: got %v, want %v", got, want)
}
return nil
diff --git a/profiles/internal/ipc/stress/internal/server.go b/profiles/internal/ipc/stress/internal/server.go
index 1f1b93c..3cab901 100644
--- a/profiles/internal/ipc/stress/internal/server.go
+++ b/profiles/internal/ipc/stress/internal/server.go
@@ -21,7 +21,7 @@
stop chan struct{}
}
-func (s *impl) Sum(ctx ipc.ServerCall, arg stress.Arg) ([]byte, error) {
+func (s *impl) Sum(call ipc.ServerCall, arg stress.Arg) ([]byte, error) {
defer s.incSumCount()
return doSum(arg)
}
@@ -43,13 +43,13 @@
return nil
}
-func (s *impl) GetStats(ctx ipc.ServerCall) (stress.Stats, error) {
+func (s *impl) GetStats(call ipc.ServerCall) (stress.Stats, error) {
s.statsMu.Lock()
defer s.statsMu.Unlock()
return stress.Stats{s.sumCount, s.sumStreamCount}, nil
}
-func (s *impl) Stop(ctx ipc.ServerCall) error {
+func (s *impl) Stop(call ipc.ServerCall) error {
s.stop <- struct{}{}
return nil
}
diff --git a/profiles/internal/naming/namespace/all_test.go b/profiles/internal/naming/namespace/all_test.go
index 932dd0b..72f38f0 100644
--- a/profiles/internal/naming/namespace/all_test.go
+++ b/profiles/internal/naming/namespace/all_test.go
@@ -100,7 +100,7 @@
suffix string
}
-func (testServer) KnockKnock(ctx ipc.ServerCall) (string, error) {
+func (testServer) KnockKnock(call ipc.ServerCall) (string, error) {
return "Who's there?", nil
}
diff --git a/profiles/internal/rt/ipc_test.go b/profiles/internal/rt/ipc_test.go
index b13339f..c106c42 100644
--- a/profiles/internal/rt/ipc_test.go
+++ b/profiles/internal/rt/ipc_test.go
@@ -38,12 +38,12 @@
mu sync.Mutex
}
-func (ds *dischargeService) Discharge(ctx ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
+func (ds *dischargeService) Discharge(call ipc.StreamServerCall, cav security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
tp := cav.ThirdPartyDetails()
if tp == nil {
return nil, fmt.Errorf("discharger: not a third party caveat (%v)", cav)
}
- if err := tp.Dischargeable(ctx); err != nil {
+ if err := tp.Dischargeable(call); err != nil {
return nil, fmt.Errorf("third-party caveat %v cannot be discharged for this context: %v", tp, err)
}
// If its the first time being called, add an expiry caveat and a MethodCaveat for "EchoBlessings".
@@ -59,7 +59,7 @@
}
}
- d, err := ctx.LocalPrincipal().MintDischarge(cav, caveats[0], caveats[1:]...)
+ d, err := call.LocalPrincipal().MintDischarge(cav, caveats[0], caveats[1:]...)
if err != nil {
return nil, err
}
diff --git a/profiles/internal/vtrace/vtrace_test.go b/profiles/internal/vtrace/vtrace_test.go
index 4ca879c..14afa92 100644
--- a/profiles/internal/vtrace/vtrace_test.go
+++ b/profiles/internal/vtrace/vtrace_test.go
@@ -55,9 +55,9 @@
forceCollect bool
}
-func (c *testServer) Run(ctx ipc.ServerCall) error {
+func (c *testServer) Run(call ipc.ServerCall) error {
if c.forceCollect {
- vtrace.ForceCollect(ctx.Context())
+ vtrace.ForceCollect(call.Context())
}
client, err := iipc.InternalNewClient(c.sm, c.ns)
@@ -66,20 +66,20 @@
return err
}
- vtrace.GetSpan(ctx.Context()).Annotate(c.name + "-begin")
+ vtrace.GetSpan(call.Context()).Annotate(c.name + "-begin")
if c.child != "" {
- var call ipc.ClientCall
- if call, err = client.StartCall(ctx.Context(), c.child, "Run", []interface{}{}); err != nil {
+ var clientCall ipc.ClientCall
+ if clientCall, err = client.StartCall(call.Context(), c.child, "Run", []interface{}{}); err != nil {
vlog.Error(err)
return err
}
- if err := call.Finish(); err != nil {
+ if err := clientCall.Finish(); err != nil {
vlog.Error(err)
return err
}
}
- vtrace.GetSpan(ctx.Context()).Annotate(c.name + "-end")
+ vtrace.GetSpan(call.Context()).Annotate(c.name + "-end")
return nil
}
diff --git a/services/identity/blesser/macaroon.go b/services/identity/blesser/macaroon.go
index 2cbb267..4e056d7 100644
--- a/services/identity/blesser/macaroon.go
+++ b/services/identity/blesser/macaroon.go
@@ -23,7 +23,7 @@
return identity.MacaroonBlesserServer(&macaroonBlesser{key})
}
-func (b *macaroonBlesser) Bless(ctx ipc.ServerCall, macaroon string) (security.Blessings, error) {
+func (b *macaroonBlesser) Bless(call ipc.ServerCall, macaroon string) (security.Blessings, error) {
var empty security.Blessings
inputs, err := util.Macaroon(macaroon).Decode(b.key)
if err != nil {
@@ -36,11 +36,11 @@
if time.Now().After(m.Creation.Add(time.Minute * 5)) {
return empty, fmt.Errorf("macaroon has expired")
}
- if ctx.LocalPrincipal() == nil {
+ if call.LocalPrincipal() == nil {
return empty, fmt.Errorf("server misconfiguration: no authentication happened")
}
if len(m.Caveats) == 0 {
m.Caveats = []security.Caveat{security.UnconstrainedUse()}
}
- return ctx.LocalPrincipal().Bless(ctx.RemoteBlessings().PublicKey(), ctx.LocalBlessings(), m.Name, m.Caveats[0], m.Caveats[1:]...)
+ return call.LocalPrincipal().Bless(call.RemoteBlessings().PublicKey(), call.LocalBlessings(), m.Name, m.Caveats[0], m.Caveats[1:]...)
}
diff --git a/services/identity/blesser/oauth.go b/services/identity/blesser/oauth.go
index 0af1ae1..52d4d39 100644
--- a/services/identity/blesser/oauth.go
+++ b/services/identity/blesser/oauth.go
@@ -58,18 +58,18 @@
})
}
-func (b *oauthBlesser) BlessUsingAccessToken(ctx ipc.ServerCall, accessToken string) (security.Blessings, string, error) {
+func (b *oauthBlesser) BlessUsingAccessToken(call ipc.ServerCall, accessToken string) (security.Blessings, string, error) {
var noblessings security.Blessings
email, clientName, err := b.oauthProvider.GetEmailAndClientName(accessToken, b.accessTokenClients)
if err != nil {
return noblessings, "", err
}
- return b.bless(ctx, email, clientName)
+ return b.bless(call, email, clientName)
}
-func (b *oauthBlesser) bless(ctx ipc.ServerCall, email, clientName string) (security.Blessings, string, error) {
+func (b *oauthBlesser) bless(call ipc.ServerCall, email, clientName string) (security.Blessings, string, error) {
var noblessings security.Blessings
- self := ctx.LocalPrincipal()
+ self := call.LocalPrincipal()
if self == nil {
return noblessings, "", fmt.Errorf("server error: no authentication happened")
}
@@ -93,7 +93,7 @@
// (say, via ACLs).
clientName,
}, security.ChainSeparator)
- blessing, err := self.Bless(ctx.RemoteBlessings().PublicKey(), ctx.LocalBlessings(), extension, caveat)
+ blessing, err := self.Bless(call.RemoteBlessings().PublicKey(), call.LocalBlessings(), extension, caveat)
if err != nil {
return noblessings, "", err
}
diff --git a/services/mgmt/application/impl/service.go b/services/mgmt/application/impl/service.go
index d10265d..85a3873 100644
--- a/services/mgmt/application/impl/service.go
+++ b/services/mgmt/application/impl/service.go
@@ -42,7 +42,7 @@
return &appRepoService{store: store, storeRoot: storeRoot, suffix: suffix}
}
-func parse(context ipc.ServerCall, suffix string) (string, string, error) {
+func parse(call ipc.ServerCall, suffix string) (string, string, error) {
tokens := strings.Split(suffix, "/")
switch len(tokens) {
case 2:
@@ -50,19 +50,19 @@
case 1:
return tokens[0], "", nil
default:
- return "", "", verror.New(ErrInvalidSuffix, context.Context())
+ return "", "", verror.New(ErrInvalidSuffix, call.Context())
}
}
-func (i *appRepoService) Match(context ipc.ServerCall, profiles []string) (application.Envelope, error) {
+func (i *appRepoService) Match(call ipc.ServerCall, profiles []string) (application.Envelope, error) {
vlog.VI(0).Infof("%v.Match(%v)", i.suffix, profiles)
empty := application.Envelope{}
- name, version, err := parse(context, i.suffix)
+ name, version, err := parse(call, i.suffix)
if err != nil {
return empty, err
}
if version == "" {
- return empty, verror.New(ErrInvalidSuffix, context.Context())
+ return empty, verror.New(ErrInvalidSuffix, call.Context())
}
i.store.Lock()
@@ -70,7 +70,7 @@
for _, profile := range profiles {
path := naming.Join("/applications", name, profile, version)
- entry, err := i.store.BindObject(path).Get(context)
+ entry, err := i.store.BindObject(path).Get(call)
if err != nil {
continue
}
@@ -80,22 +80,22 @@
}
return envelope, nil
}
- return empty, verror.New(ErrNotFound, context.Context())
+ return empty, verror.New(ErrNotFound, call.Context())
}
-func (i *appRepoService) Put(context ipc.ServerCall, profiles []string, envelope application.Envelope) error {
+func (i *appRepoService) Put(call ipc.ServerCall, profiles []string, envelope application.Envelope) error {
vlog.VI(0).Infof("%v.Put(%v, %v)", i.suffix, profiles, envelope)
- name, version, err := parse(context, i.suffix)
+ name, version, err := parse(call, i.suffix)
if err != nil {
return err
}
if version == "" {
- return verror.New(ErrInvalidSuffix, context.Context())
+ return verror.New(ErrInvalidSuffix, call.Context())
}
i.store.Lock()
defer i.store.Unlock()
// Transaction is rooted at "", so tname == tid.
- tname, err := i.store.BindTransactionRoot("").CreateTransaction(context)
+ tname, err := i.store.BindTransactionRoot("").CreateTransaction(call)
if err != nil {
return err
}
@@ -104,27 +104,27 @@
path := naming.Join(tname, "/applications", name, profile, version)
object := i.store.BindObject(path)
- _, err := object.Put(context, envelope)
+ _, err := object.Put(call, envelope)
if err != nil {
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
}
- if err := i.store.BindTransaction(tname).Commit(context); err != nil {
- return verror.New(ErrOperationFailed, context.Context())
+ if err := i.store.BindTransaction(tname).Commit(call); err != nil {
+ return verror.New(ErrOperationFailed, call.Context())
}
return nil
}
-func (i *appRepoService) Remove(context ipc.ServerCall, profile string) error {
+func (i *appRepoService) Remove(call ipc.ServerCall, profile string) error {
vlog.VI(0).Infof("%v.Remove(%v)", i.suffix, profile)
- name, version, err := parse(context, i.suffix)
+ name, version, err := parse(call, i.suffix)
if err != nil {
return err
}
i.store.Lock()
defer i.store.Unlock()
// Transaction is rooted at "", so tname == tid.
- tname, err := i.store.BindTransactionRoot("").CreateTransaction(context)
+ tname, err := i.store.BindTransactionRoot("").CreateTransaction(call)
if err != nil {
return err
}
@@ -133,18 +133,18 @@
path += "/" + version
}
object := i.store.BindObject(path)
- found, err := object.Exists(context)
+ found, err := object.Exists(call)
if err != nil {
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
if !found {
- return verror.New(ErrNotFound, context.Context())
+ return verror.New(ErrNotFound, call.Context())
}
- if err := object.Remove(context); err != nil {
- return verror.New(ErrOperationFailed, context.Context())
+ if err := object.Remove(call); err != nil {
+ return verror.New(ErrOperationFailed, call.Context())
}
- if err := i.store.BindTransaction(tname).Commit(context); err != nil {
- return verror.New(ErrOperationFailed, context.Context())
+ if err := i.store.BindTransaction(tname).Commit(call); err != nil {
+ return verror.New(ErrOperationFailed, call.Context())
}
return nil
}
@@ -227,14 +227,14 @@
return ch, nil
}
-func (i *appRepoService) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+func (i *appRepoService) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
i.store.Lock()
defer i.store.Unlock()
path := naming.Join("/acls", i.suffix, "data")
return getACL(i.store, path)
}
-func (i *appRepoService) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+func (i *appRepoService) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
i.store.Lock()
defer i.store.Unlock()
path := naming.Join("/acls", i.suffix, "data")
diff --git a/services/mgmt/binary/impl/service.go b/services/mgmt/binary/impl/service.go
index 80718c9..b565ea7 100644
--- a/services/mgmt/binary/impl/service.go
+++ b/services/mgmt/binary/impl/service.go
@@ -110,47 +110,47 @@
return locks.SetPathACL(dir, tam, "")
}
-func (i *binaryService) Create(context ipc.ServerCall, nparts int32, mediaInfo repository.MediaInfo) error {
+func (i *binaryService) Create(call ipc.ServerCall, nparts int32, mediaInfo repository.MediaInfo) error {
vlog.Infof("%v.Create(%v, %v)", i.suffix, nparts, mediaInfo)
if nparts < 1 {
- return verror.New(ErrInvalidParts, context.Context())
+ return verror.New(ErrInvalidParts, call.Context())
}
parent, perm := filepath.Dir(i.path), os.FileMode(0700)
if err := os.MkdirAll(parent, perm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", parent, perm, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
prefix := "creating-"
tmpDir, err := ioutil.TempDir(parent, prefix)
if err != nil {
vlog.Errorf("TempDir(%v, %v) failed: %v", parent, prefix, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
nameFile := filepath.Join(tmpDir, nameFileName)
if err := ioutil.WriteFile(nameFile, []byte(i.suffix), os.FileMode(0600)); err != nil {
vlog.Errorf("WriteFile(%q) failed: %v", nameFile)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
- rb, _ := context.RemoteBlessings().ForCall(context)
+ rb, _ := call.RemoteBlessings().ForCall(call)
if len(rb) == 0 {
// None of the client's blessings are valid.
- return verror.New(ErrNotAuthorized, context.Context())
+ return verror.New(ErrNotAuthorized, call.Context())
}
if err := insertACLs(aclPath(i.state.rootDir, i.suffix), i.locks, rb); err != nil {
vlog.Errorf("insertACLs(%v) failed: %v", rb, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
infoFile := filepath.Join(tmpDir, mediaInfoFileName)
jInfo, err := json.Marshal(mediaInfo)
if err != nil {
vlog.Errorf("json.Marshal(%v) failed: %v", mediaInfo, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
if err := ioutil.WriteFile(infoFile, jInfo, os.FileMode(0600)); err != nil {
vlog.Errorf("WriteFile(%q) failed: %v", infoFile, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
for j := 0; j < int(nparts); j++ {
partPath, partPerm := generatePartPath(tmpDir, j), os.FileMode(0700)
@@ -159,7 +159,7 @@
if err := os.RemoveAll(tmpDir); err != nil {
vlog.Errorf("RemoveAll(%v) failed: %v", tmpDir, err)
}
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
}
// Use os.Rename() to atomically create the binary directory
@@ -171,33 +171,33 @@
}
}()
if linkErr, ok := err.(*os.LinkError); ok && linkErr.Err == syscall.ENOTEMPTY {
- return verror.New(verror.ErrExist, context.Context(), i.path)
+ return verror.New(verror.ErrExist, call.Context(), i.path)
}
vlog.Errorf("Rename(%v, %v) failed: %v", tmpDir, i.path, err)
- return verror.New(ErrOperationFailed, context.Context(), i.path)
+ return verror.New(ErrOperationFailed, call.Context(), i.path)
}
return nil
}
-func (i *binaryService) Delete(context ipc.ServerCall) error {
+func (i *binaryService) Delete(call ipc.ServerCall) error {
vlog.Infof("%v.Delete()", i.suffix)
if _, err := os.Stat(i.path); err != nil {
if os.IsNotExist(err) {
- return verror.New(verror.ErrNoExist, context.Context(), i.path)
+ return verror.New(verror.ErrNoExist, call.Context(), i.path)
}
vlog.Errorf("Stat(%v) failed: %v", i.path, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
// Use os.Rename() to atomically remove the binary directory
// structure.
path := filepath.Join(filepath.Dir(i.path), "removing-"+filepath.Base(i.path))
if err := os.Rename(i.path, path); err != nil {
vlog.Errorf("Rename(%v, %v) failed: %v", i.path, path, err)
- return verror.New(ErrOperationFailed, context.Context(), i.path)
+ return verror.New(ErrOperationFailed, call.Context(), i.path)
}
if err := os.RemoveAll(path); err != nil {
vlog.Errorf("Remove(%v) failed: %v", path, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
for {
// Remove the binary and all directories on the path back to the
@@ -211,7 +211,7 @@
break
}
vlog.Errorf("Remove(%v) failed: %v", path, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
}
return nil
@@ -256,7 +256,7 @@
return i.state.rootURL + "/" + i.suffix, 0, nil
}
-func (i *binaryService) Stat(context ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
+func (i *binaryService) Stat(call ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
vlog.Infof("%v.Stat()", i.suffix)
result := make([]binary.PartInfo, 0)
parts, err := getParts(i.path)
@@ -272,7 +272,7 @@
continue
}
vlog.Errorf("ReadFile(%v) failed: %v", checksumFile, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, context.Context())
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, call.Context())
}
dataFile := filepath.Join(part, dataFileName)
fi, err := os.Stat(dataFile)
@@ -282,7 +282,7 @@
continue
}
vlog.Errorf("Stat(%v) failed: %v", dataFile, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, context.Context())
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, call.Context())
}
result = append(result, binary.PartInfo{Checksum: string(bytes), Size: fi.Size()})
}
@@ -290,12 +290,12 @@
jInfo, err := ioutil.ReadFile(infoFile)
if err != nil {
vlog.Errorf("ReadFile(%q) failed: %v", infoFile)
- return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, context.Context())
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, call.Context())
}
var mediaInfo repository.MediaInfo
if err := json.Unmarshal(jInfo, &mediaInfo); err != nil {
vlog.Errorf("json.Unmarshal(%v) failed: %v", jInfo, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, context.Context())
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, call.Context())
}
return result, mediaInfo, nil
}
@@ -369,14 +369,14 @@
return nil
}
-func (i *binaryService) GlobChildren__(context ipc.ServerCall) (<-chan string, error) {
+func (i *binaryService) GlobChildren__(call ipc.ServerCall) (<-chan string, error) {
elems := strings.Split(i.suffix, "/")
if len(elems) == 1 && elems[0] == "" {
elems = nil
}
n := i.createObjectNameTree().find(elems, false)
if n == nil {
- return nil, verror.New(ErrOperationFailed, context.Context())
+ return nil, verror.New(ErrOperationFailed, call.Context())
}
ch := make(chan string)
go func() {
@@ -388,7 +388,7 @@
return ch, nil
}
-func (i *binaryService) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+func (i *binaryService) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
acl, etag, err = i.locks.GetPathACL(aclPath(i.state.rootDir, i.suffix))
@@ -399,7 +399,7 @@
// can be extended to form one of the local blessings.)
tam := make(access.TaggedACLMap)
- lb, _ := ctx.LocalBlessings().ForCall(ctx)
+ lb, _ := call.LocalBlessings().ForCall(call)
for _, p := range prefixPatterns(lb) {
for _, tag := range access.AllTypicalTags() {
tam.Add(p, string(tag))
diff --git a/services/mgmt/device/impl/app_service.go b/services/mgmt/device/impl/app_service.go
index b9cb816..562f224 100644
--- a/services/mgmt/device/impl/app_service.go
+++ b/services/mgmt/device/impl/app_service.go
@@ -1070,7 +1070,7 @@
// TODO(caprita): implement deadline for Stop.
-func (i *appService) Stop(ctx ipc.ServerCall, deadline uint32) error {
+func (i *appService) Stop(call ipc.ServerCall, deadline uint32) error {
instanceDir, err := i.instanceDir()
if err != nil {
return err
@@ -1081,14 +1081,14 @@
if err := transitionInstance(instanceDir, started, stopping); err != nil {
return err
}
- if err := stop(ctx.Context(), instanceDir, i.reap); err != nil {
+ if err := stop(call.Context(), instanceDir, i.reap); err != nil {
transitionInstance(instanceDir, stopping, started)
return err
}
return transitionInstance(instanceDir, stopping, stopped)
}
-func (i *appService) Suspend(ctx ipc.ServerCall) error {
+func (i *appService) Suspend(call ipc.ServerCall) error {
instanceDir, err := i.instanceDir()
if err != nil {
return err
@@ -1096,7 +1096,7 @@
if err := transitionInstance(instanceDir, started, suspending); err != nil {
return err
}
- if err := stop(ctx.Context(), instanceDir, i.reap); err != nil {
+ if err := stop(call.Context(), instanceDir, i.reap); err != nil {
transitionInstance(instanceDir, suspending, started)
return err
}
@@ -1209,13 +1209,13 @@
return nil
}
-func (i *appService) Revert(ctx ipc.ServerCall) error {
+func (i *appService) Revert(call ipc.ServerCall) error {
installationDir, err := i.installationDir()
if err != nil {
return err
}
if !installationStateIs(installationDir, active) {
- return verror.New(ErrInvalidOperation, ctx.Context())
+ return verror.New(ErrInvalidOperation, call.Context())
}
// NOTE(caprita): A race can occur between an update and a revert, where
// both use the same current version as their starting point. This will
@@ -1226,21 +1226,21 @@
currVersionDir, err := filepath.EvalSymlinks(currLink)
if err != nil {
vlog.Errorf("EvalSymlinks(%v) failed: %v", currLink, err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
previousLink := filepath.Join(currVersionDir, "previous")
if _, err := os.Lstat(previousLink); err != nil {
if os.IsNotExist(err) {
// No 'previous' link -- must be the first version.
- return verror.New(ErrUpdateNoOp, ctx.Context())
+ return verror.New(ErrUpdateNoOp, call.Context())
}
vlog.Errorf("Lstat(%v) failed: %v", previousLink, err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
prevVersionDir, err := filepath.EvalSymlinks(previousLink)
if err != nil {
vlog.Errorf("EvalSymlinks(%v) failed: %v", previousLink, err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
return updateLink(prevVersionDir, currLink)
}
@@ -1414,18 +1414,18 @@
return i.locks.GetPathACL(path.Join(dir, "acls"))
}
-func (i *appService) Debug(ctx ipc.ServerCall) (string, error) {
+func (i *appService) Debug(call ipc.ServerCall) (string, error) {
switch len(i.suffix) {
case 2:
- return i.installationDebug(ctx)
+ return i.installationDebug(call)
case 3:
- return i.instanceDebug(ctx)
+ return i.instanceDebug(call)
default:
return "", verror.New(ErrInvalidSuffix, nil)
}
}
-func (i *appService) installationDebug(ctx ipc.ServerCall) (string, error) {
+func (i *appService) installationDebug(call ipc.ServerCall) (string, error) {
const installationDebug = `Installation dir: {{.InstallationDir}}
Origin: {{.Origin}}
@@ -1477,7 +1477,7 @@
}
-func (i *appService) instanceDebug(ctx ipc.ServerCall) (string, error) {
+func (i *appService) instanceDebug(call ipc.ServerCall) (string, error) {
const instanceDebug = `Instance dir: {{.InstanceDir}}
System name / start system name: {{.SystemName}} / {{.StartSystemName}}
@@ -1509,7 +1509,7 @@
}{}
debugInfo.InstanceDir = instanceDir
- debugInfo.SystemName = suidHelper.usernameForPrincipal(ctx, i.uat)
+ debugInfo.SystemName = suidHelper.usernameForPrincipal(call, i.uat)
if startSystemName, err := readSystemNameForInstance(instanceDir); err != nil {
return "", err
} else {
@@ -1533,7 +1533,7 @@
return "", err
}
var cancel func()
- if debugInfo.Principal, cancel, err = agentPrincipal(ctx.Context(), file); err != nil {
+ if debugInfo.Principal, cancel, err = agentPrincipal(call.Context(), file); err != nil {
return "", err
}
defer cancel()
diff --git a/services/mgmt/device/impl/claim.go b/services/mgmt/device/impl/claim.go
index eca12f0..c5b99be 100644
--- a/services/mgmt/device/impl/claim.go
+++ b/services/mgmt/device/impl/claim.go
@@ -28,42 +28,42 @@
mu sync.Mutex
}
-func (c *claimable) Claim(ctx ipc.ServerCall, pairingToken string) error {
+func (c *claimable) Claim(call ipc.ServerCall, pairingToken string) error {
// Verify that the claimer pairing tokens match that of the device manager.
if subtle.ConstantTimeCompare([]byte(pairingToken), []byte(c.token)) != 1 {
- return verror.New(ErrInvalidPairingToken, ctx.Context())
+ return verror.New(ErrInvalidPairingToken, call.Context())
}
var (
- granted = ctx.GrantedBlessings() // blessings granted by the claimant
- principal = ctx.LocalPrincipal()
+ granted = call.GrantedBlessings() // blessings granted by the claimant
+ principal = call.LocalPrincipal()
store = principal.BlessingStore()
)
if granted.IsZero() {
- return verror.New(ErrInvalidBlessing, ctx.Context())
+ return verror.New(ErrInvalidBlessing, call.Context())
}
c.mu.Lock()
defer c.mu.Unlock()
if c.notify == nil {
// Device has already been claimed (by a concurrent
// RPC perhaps), it cannot be reclaimed
- return verror.New(ErrDeviceAlreadyClaimed, ctx.Context())
+ return verror.New(ErrDeviceAlreadyClaimed, call.Context())
}
// TODO(ashankar): If the claim fails, would make sense
// to remove from roots as well.
if err := principal.AddToRoots(granted); err != nil {
- return verror.New(ErrInvalidBlessing, ctx.Context())
+ return verror.New(ErrInvalidBlessing, call.Context())
}
// Create an ACL with all the granted blessings
// (irrespective of caveats).
blessings := principal.BlessingsInfo(granted)
if len(blessings) == 0 {
- return verror.New(ErrInvalidBlessing, ctx.Context())
+ return verror.New(ErrInvalidBlessing, call.Context())
}
if _, err := store.Set(granted, security.AllPrincipals); err != nil {
- return verror.New(ErrInvalidBlessing, ctx.Context(), err)
+ return verror.New(ErrInvalidBlessing, call.Context(), err)
}
if err := store.SetDefault(granted); err != nil {
- return verror.New(ErrInvalidBlessing, ctx.Context(), err)
+ return verror.New(ErrInvalidBlessing, call.Context(), err)
}
// Create ACLs that allow principals with the caller's blessings to
// administer and use the device.
@@ -79,7 +79,7 @@
}
}
if err := c.locks.SetPathACL(c.aclDir, acl, ""); err != nil {
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
vlog.Infof("Device claimed and ACLs set to: %v", acl)
close(c.notify)
diff --git a/services/mgmt/device/impl/device_service.go b/services/mgmt/device/impl/device_service.go
index c84cf6c..9398c19 100644
--- a/services/mgmt/device/impl/device_service.go
+++ b/services/mgmt/device/impl/device_service.go
@@ -486,8 +486,8 @@
return nil
}
-func (*deviceService) Install(ctx ipc.ServerCall, _ string, _ device.Config, _ application.Packages) (string, error) {
- return "", verror.New(ErrInvalidSuffix, ctx.Context())
+func (*deviceService) Install(call ipc.ServerCall, _ string, _ device.Config, _ application.Packages) (string, error) {
+ return "", verror.New(ErrInvalidSuffix, call.Context())
}
func (*deviceService) Refresh(ipc.ServerCall) error {
@@ -500,8 +500,8 @@
return nil
}
-func (*deviceService) Resume(ctx ipc.ServerCall) error {
- return verror.New(ErrInvalidSuffix, ctx.Context())
+func (*deviceService) Resume(call ipc.ServerCall) error {
+ return verror.New(ErrInvalidSuffix, call.Context())
}
func (s *deviceService) Revert(call ipc.ServerCall) error {
@@ -521,8 +521,8 @@
return err
}
-func (*deviceService) Start(ctx ipc.ServerCall) ([]string, error) {
- return nil, verror.New(ErrInvalidSuffix, ctx.Context())
+func (*deviceService) Start(call ipc.ServerCall) ([]string, error) {
+ return nil, verror.New(ErrInvalidSuffix, call.Context())
}
func (*deviceService) Stop(call ipc.ServerCall, _ uint32) error {
@@ -540,8 +540,8 @@
return nil
}
-func (*deviceService) Uninstall(ctx ipc.ServerCall) error {
- return verror.New(ErrInvalidSuffix, ctx.Context())
+func (*deviceService) Uninstall(call ipc.ServerCall) error {
+ return verror.New(ErrInvalidSuffix, call.Context())
}
func (s *deviceService) Update(call ipc.ServerCall) error {
diff --git a/services/mgmt/device/impl/dispatcher.go b/services/mgmt/device/impl/dispatcher.go
index 5b6f0e7..3a72320 100644
--- a/services/mgmt/device/impl/dispatcher.go
+++ b/services/mgmt/device/impl/dispatcher.go
@@ -294,12 +294,12 @@
return obj, d, err
}
-func (testModeDispatcher) Authorize(ctx security.Call) error {
- if ctx.Suffix() == deviceSuffix && ctx.Method() == "Stop" {
- vlog.Infof("testModeDispatcher.Authorize: Allow %q.%s()", ctx.Suffix(), ctx.Method())
+func (testModeDispatcher) Authorize(call security.Call) error {
+ if call.Suffix() == deviceSuffix && call.Method() == "Stop" {
+ vlog.Infof("testModeDispatcher.Authorize: Allow %q.%s()", call.Suffix(), call.Method())
return nil
}
- vlog.Infof("testModeDispatcher.Authorize: Reject %q.%s()", ctx.Suffix(), ctx.Method())
+ vlog.Infof("testModeDispatcher.Authorize: Reject %q.%s()", call.Suffix(), call.Method())
return verror.New(ErrInvalidSuffix, nil)
}
diff --git a/services/mgmt/device/impl/helper_manager.go b/services/mgmt/device/impl/helper_manager.go
index e25cdae..03abc6e 100644
--- a/services/mgmt/device/impl/helper_manager.go
+++ b/services/mgmt/device/impl/helper_manager.go
@@ -58,8 +58,8 @@
// devicemanager will use to invoke apps.
// TODO(rjkroege): This code assumes a desktop target and will need
// to be reconsidered for embedded contexts.
-func (i suidHelperState) usernameForPrincipal(ctx ipc.ServerCall, uat BlessingSystemAssociationStore) string {
- identityNames, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (i suidHelperState) usernameForPrincipal(call ipc.ServerCall, uat BlessingSystemAssociationStore) string {
+ identityNames, _ := call.RemoteBlessings().ForCall(call)
systemName, present := uat.SystemAccountForBlessings(identityNames)
if present {
diff --git a/services/mgmt/device/impl/mock_repo_test.go b/services/mgmt/device/impl/mock_repo_test.go
index 5234e14..834474b 100644
--- a/services/mgmt/device/impl/mock_repo_test.go
+++ b/services/mgmt/device/impl/mock_repo_test.go
@@ -150,12 +150,12 @@
return "", 0, nil
}
-func (*brInvoker) Stat(ctx ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
+func (*brInvoker) Stat(call ipc.ServerCall) ([]binary.PartInfo, repository.MediaInfo, error) {
vlog.VI(1).Infof("Stat()")
h := md5.New()
bytes, err := ioutil.ReadFile(os.Args[0])
if err != nil {
- return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, ctx.Context())
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.New(ErrOperationFailed, call.Context())
}
h.Write(bytes)
part := binary.PartInfo{Checksum: hex.EncodeToString(h.Sum(nil)), Size: int64(len(bytes))}
@@ -167,10 +167,10 @@
return nil
}
-func (i *brInvoker) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+func (i *brInvoker) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
return nil, "", nil
}
-func (i *brInvoker) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+func (i *brInvoker) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
return nil
}
diff --git a/services/mgmt/device/impl/proxy_invoker.go b/services/mgmt/device/impl/proxy_invoker.go
index c24b890..48b6390 100644
--- a/services/mgmt/device/impl/proxy_invoker.go
+++ b/services/mgmt/device/impl/proxy_invoker.go
@@ -139,12 +139,12 @@
// TODO(toddw): Expose a helper function that performs all error checking based
// on reflection, to simplify the repeated logic processing results.
-func (p *proxyInvoker) Signature(ctx ipc.ServerCall) ([]signature.Interface, error) {
- call, ok := ctx.(ipc.StreamServerCall)
+func (p *proxyInvoker) Signature(call ipc.ServerCall) ([]signature.Interface, error) {
+ streamCall, ok := call.(ipc.StreamServerCall)
if !ok {
return nil, fmt.Errorf("couldn't upgrade ipc.ServerCall to ipc.StreamServerCall")
}
- results, err := p.Invoke(ipc.ReservedSignature, call, nil)
+ results, err := p.Invoke(ipc.ReservedSignature, streamCall, nil)
if err != nil {
return nil, err
}
@@ -168,13 +168,13 @@
return res, nil
}
-func (p *proxyInvoker) MethodSignature(ctx ipc.ServerCall, method string) (signature.Method, error) {
+func (p *proxyInvoker) MethodSignature(call ipc.ServerCall, method string) (signature.Method, error) {
empty := signature.Method{}
- call, ok := ctx.(ipc.StreamServerCall)
+ streamCall, ok := call.(ipc.StreamServerCall)
if !ok {
return empty, fmt.Errorf("couldn't upgrade ipc.ServerCall to ipc.StreamServerCall")
}
- results, err := p.Invoke(ipc.ReservedMethodSignature, call, []interface{}{&method})
+ results, err := p.Invoke(ipc.ReservedMethodSignature, streamCall, []interface{}{&method})
if err != nil {
return empty, err
}
@@ -216,10 +216,10 @@
return nil
}
-func (p *proxyInvoker) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (p *proxyInvoker) Glob__(serverCall ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
ch := make(chan naming.VDLGlobReply)
go func() {
- p.Invoke(ipc.GlobMethod, &call{ctx, ch}, []interface{}{&pattern})
+ p.Invoke(ipc.GlobMethod, &call{serverCall, ch}, []interface{}{&pattern})
close(ch)
}()
return ch, nil
diff --git a/services/mgmt/lib/acls/hierarchical_authorizer.go b/services/mgmt/lib/acls/hierarchical_authorizer.go
index 1e7b27f..86204b9 100644
--- a/services/mgmt/lib/acls/hierarchical_authorizer.go
+++ b/services/mgmt/lib/acls/hierarchical_authorizer.go
@@ -71,12 +71,12 @@
// Authorize provides two-levels of authorization. Permissions on "Roots"
// in the namespace will apply to children paths regardless of accesses
// set on the children. Conversely, ACL exclusions are not inherited.
-func (ha *hierarchicalAuthorizer) Authorize(ctx security.Call) error {
- childErr := ha.child.Authorize(ctx)
+func (ha *hierarchicalAuthorizer) Authorize(call security.Call) error {
+ childErr := ha.child.Authorize(call)
if childErr == nil {
return nil
}
- rootErr := ha.root.Authorize(ctx)
+ rootErr := ha.root.Authorize(call)
if rootErr == nil {
return nil
}
diff --git a/services/mgmt/logreader/impl/logfile.go b/services/mgmt/logreader/impl/logfile.go
index 5b4d0e1..6013859 100644
--- a/services/mgmt/logreader/impl/logfile.go
+++ b/services/mgmt/logreader/impl/logfile.go
@@ -53,7 +53,7 @@
}
// Size returns the size of the log file, in bytes.
-func (i *logfileService) Size(ctx ipc.ServerCall) (int64, error) {
+func (i *logfileService) Size(call ipc.ServerCall) (int64, error) {
vlog.VI(1).Infof("%v.Size()", i.suffix)
fname, err := translateNameToFilename(i.root, i.suffix)
if err != nil {
@@ -62,13 +62,13 @@
fi, err := os.Stat(fname)
if err != nil {
if os.IsNotExist(err) {
- return 0, verror.New(verror.ErrNoExist, ctx.Context(), fname)
+ return 0, verror.New(verror.ErrNoExist, call.Context(), fname)
}
vlog.Errorf("Stat(%v) failed: %v", fname, err)
- return 0, verror.New(errOperationFailed, ctx.Context(), fname)
+ return 0, verror.New(errOperationFailed, call.Context(), fname)
}
if fi.IsDir() {
- return 0, verror.New(errOperationFailed, ctx.Context(), fname)
+ return 0, verror.New(errOperationFailed, call.Context(), fname)
}
return fi.Size(), nil
}
@@ -111,7 +111,7 @@
// GlobChildren__ returns the list of files in a directory streamed on a
// channel. The list is empty if the object is a file.
-func (i *logfileService) GlobChildren__(ctx ipc.ServerCall) (<-chan string, error) {
+func (i *logfileService) GlobChildren__(call ipc.ServerCall) (<-chan string, error) {
vlog.VI(1).Infof("%v.GlobChildren__()", i.suffix)
dirName, err := translateNameToFilename(i.root, i.suffix)
if err != nil {
@@ -120,9 +120,9 @@
stat, err := os.Stat(dirName)
if err != nil {
if os.IsNotExist(err) {
- return nil, verror.New(verror.ErrNoExist, ctx.Context(), dirName)
+ return nil, verror.New(verror.ErrNoExist, call.Context(), dirName)
}
- return nil, verror.New(errOperationFailed, ctx.Context(), dirName)
+ return nil, verror.New(errOperationFailed, call.Context(), dirName)
}
if !stat.IsDir() {
return nil, nil
diff --git a/services/mgmt/logreader/impl/reader.go b/services/mgmt/logreader/impl/reader.go
index 1466ce3..ea06336 100644
--- a/services/mgmt/logreader/impl/reader.go
+++ b/services/mgmt/logreader/impl/reader.go
@@ -15,7 +15,7 @@
// - it aborts when the parent RPC is canceled.
type followReader struct {
reader io.ReadSeeker
- ctx ipc.ServerCall
+ call ipc.ServerCall
offset int64
follow bool
err error
@@ -23,11 +23,11 @@
}
// newFollowReader is the factory for followReader.
-func newFollowReader(ctx ipc.ServerCall, reader io.ReadSeeker, startpos int64, follow bool) *followReader {
+func newFollowReader(call ipc.ServerCall, reader io.ReadSeeker, startpos int64, follow bool) *followReader {
_, err := reader.Seek(startpos, 0)
return &followReader{
reader: reader,
- ctx: ctx,
+ call: call,
offset: startpos,
follow: follow,
err: err,
@@ -44,9 +44,9 @@
return 0, f.err
}
for {
- if f.ctx != nil {
+ if f.call != nil {
select {
- case <-f.ctx.Context().Done():
+ case <-f.call.Context().Done():
return 0, verror.New(verror.ErrCanceled, nil)
default:
}
diff --git a/services/mgmt/profile/impl/service.go b/services/mgmt/profile/impl/service.go
index d435ac5..400cbc9 100644
--- a/services/mgmt/profile/impl/service.go
+++ b/services/mgmt/profile/impl/service.go
@@ -34,48 +34,48 @@
// STORE MANAGEMENT INTERFACE IMPLEMENTATION
-func (i *profileService) Put(context ipc.ServerCall, profile profile.Specification) error {
+func (i *profileService) Put(call ipc.ServerCall, profile profile.Specification) error {
vlog.VI(0).Infof("%v.Put(%v)", i.suffix, profile)
// Transaction is rooted at "", so tname == tid.
i.store.Lock()
defer i.store.Unlock()
- tname, err := i.store.BindTransactionRoot("").CreateTransaction(context)
+ tname, err := i.store.BindTransactionRoot("").CreateTransaction(call)
if err != nil {
return err
}
path := naming.Join(tname, "/profiles", i.suffix)
object := i.store.BindObject(path)
- if _, err := object.Put(context, profile); err != nil {
+ if _, err := object.Put(call, profile); err != nil {
return errOperationFailed
}
- if err := i.store.BindTransaction(tname).Commit(context); err != nil {
+ if err := i.store.BindTransaction(tname).Commit(call); err != nil {
return errOperationFailed
}
return nil
}
-func (i *profileService) Remove(context ipc.ServerCall) error {
+func (i *profileService) Remove(call ipc.ServerCall) error {
vlog.VI(0).Infof("%v.Remove()", i.suffix)
i.store.Lock()
defer i.store.Unlock()
// Transaction is rooted at "", so tname == tid.
- tname, err := i.store.BindTransactionRoot("").CreateTransaction(context)
+ tname, err := i.store.BindTransactionRoot("").CreateTransaction(call)
if err != nil {
return err
}
path := naming.Join(tname, "/profiles", i.suffix)
object := i.store.BindObject(path)
- found, err := object.Exists(context)
+ found, err := object.Exists(call)
if err != nil {
return errOperationFailed
}
if !found {
return errNotFound
}
- if err := object.Remove(context); err != nil {
+ if err := object.Remove(call); err != nil {
return errOperationFailed
}
- if err := i.store.BindTransaction(tname).Commit(context); err != nil {
+ if err := i.store.BindTransaction(tname).Commit(call); err != nil {
return errOperationFailed
}
return nil
@@ -83,14 +83,14 @@
// PROFILE INTERACE IMPLEMENTATION
-func (i *profileService) lookup(context ipc.ServerCall) (profile.Specification, error) {
+func (i *profileService) lookup(call ipc.ServerCall) (profile.Specification, error) {
empty := profile.Specification{}
path := naming.Join("/profiles", i.suffix)
i.store.Lock()
defer i.store.Unlock()
- entry, err := i.store.BindObject(path).Get(context)
+ entry, err := i.store.BindObject(path).Get(call)
if err != nil {
return empty, errNotFound
}
@@ -101,25 +101,25 @@
return s, nil
}
-func (i *profileService) Label(context ipc.ServerCall) (string, error) {
+func (i *profileService) Label(call ipc.ServerCall) (string, error) {
vlog.VI(0).Infof("%v.Label()", i.suffix)
- s, err := i.lookup(context)
+ s, err := i.lookup(call)
if err != nil {
return "", err
}
return s.Label, nil
}
-func (i *profileService) Description(context ipc.ServerCall) (string, error) {
+func (i *profileService) Description(call ipc.ServerCall) (string, error) {
vlog.VI(0).Infof("%v.Description()", i.suffix)
- s, err := i.lookup(context)
+ s, err := i.lookup(call)
if err != nil {
return "", err
}
return s.Description, nil
}
-func (i *profileService) Specification(context ipc.ServerCall) (profile.Specification, error) {
+func (i *profileService) Specification(call ipc.ServerCall) (profile.Specification, error) {
vlog.VI(0).Infof("%v.Specification()", i.suffix)
- return i.lookup(context)
+ return i.lookup(call)
}
diff --git a/services/mgmt/stats/impl/stats.go b/services/mgmt/stats/impl/stats.go
index b190044..caf1ee6 100644
--- a/services/mgmt/stats/impl/stats.go
+++ b/services/mgmt/stats/impl/stats.go
@@ -36,7 +36,7 @@
}
// Glob__ returns the name of all objects that match pattern.
-func (i *statsService) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (i *statsService) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
vlog.VI(1).Infof("%v.Glob__(%q)", i.suffix, pattern)
ch := make(chan naming.VDLGlobReply)
@@ -95,21 +95,21 @@
}
// Value returns the value of the receiver object.
-func (i *statsService) Value(ctx ipc.ServerCall) (*vdl.Value, error) {
+func (i *statsService) Value(call ipc.ServerCall) (*vdl.Value, error) {
vlog.VI(1).Infof("%v.Value()", i.suffix)
rv, err := libstats.Value(i.suffix)
switch {
case err == libstats.ErrNotFound:
- return nil, verror.New(verror.ErrNoExist, ctx.Context(), i.suffix)
+ return nil, verror.New(verror.ErrNoExist, call.Context(), i.suffix)
case err == libstats.ErrNoValue:
- return nil, stats.NewErrNoValue(ctx.Context(), i.suffix)
+ return nil, stats.NewErrNoValue(call.Context(), i.suffix)
case err != nil:
- return nil, verror.New(errOperationFailed, ctx.Context(), i.suffix)
+ return nil, verror.New(errOperationFailed, call.Context(), i.suffix)
}
vv, err := vdl.ValueFromReflect(reflect.ValueOf(rv))
if err != nil {
- return nil, verror.New(verror.ErrInternal, ctx.Context(), i.suffix, err)
+ return nil, verror.New(verror.ErrInternal, call.Context(), i.suffix, err)
}
return vv, nil
}
diff --git a/services/mgmt/vtrace/impl/vtrace.go b/services/mgmt/vtrace/impl/vtrace.go
index 4a55f1a..3f33148 100644
--- a/services/mgmt/vtrace/impl/vtrace.go
+++ b/services/mgmt/vtrace/impl/vtrace.go
@@ -10,11 +10,11 @@
type vtraceService struct{}
-func (v *vtraceService) Trace(ctx ipc.ServerCall, id uniqueid.Id) (vtrace.TraceRecord, error) {
- store := vtrace.GetStore(ctx.Context())
+func (v *vtraceService) Trace(call ipc.ServerCall, id uniqueid.Id) (vtrace.TraceRecord, error) {
+ store := vtrace.GetStore(call.Context())
tr := store.TraceRecord(id)
if tr == nil {
- return vtrace.TraceRecord{}, verror.New(verror.ErrNoExist, ctx.Context(), "No trace with id %x", id)
+ return vtrace.TraceRecord{}, verror.New(verror.ErrNoExist, call.Context(), "No trace with id %x", id)
}
return *tr, nil
}
diff --git a/services/mounttable/lib/collectionserver_test.go b/services/mounttable/lib/collectionserver_test.go
index 663923b..eddcd25 100644
--- a/services/mounttable/lib/collectionserver_test.go
+++ b/services/mounttable/lib/collectionserver_test.go
@@ -40,22 +40,22 @@
}
// Export implements CollectionServerMethods.Export.
-func (c *rpcContext) Export(ctx ipc.ServerCall, val []byte, overwrite bool) error {
+func (c *rpcContext) Export(call ipc.ServerCall, val []byte, overwrite bool) error {
c.Lock()
defer c.Unlock()
if b := c.contents[c.name]; overwrite || b == nil {
c.contents[c.name] = val
return nil
}
- return verror.New(naming.ErrNameExists, ctx.Context(), c.name)
+ return verror.New(naming.ErrNameExists, call.Context(), c.name)
}
// Lookup implements CollectionServerMethods.Lookup.
-func (c *rpcContext) Lookup(ctx ipc.ServerCall) ([]byte, error) {
+func (c *rpcContext) Lookup(call ipc.ServerCall) ([]byte, error) {
c.Lock()
defer c.Unlock()
if val := c.contents[c.name]; val != nil {
return val, nil
}
- return nil, verror.New(naming.ErrNoSuchName, ctx.Context(), c.name)
+ return nil, verror.New(naming.ErrNoSuchName, call.Context(), c.name)
}
diff --git a/services/mounttable/lib/mounttable.go b/services/mounttable/lib/mounttable.go
index 0b348de..6abaf60 100644
--- a/services/mounttable/lib/mounttable.go
+++ b/services/mounttable/lib/mounttable.go
@@ -161,17 +161,17 @@
}
// satisfies returns no error if the ctx + n.acls satisfies the associated one of the required Tags.
-func (n *node) satisfies(mt *mountTable, ctx ipc.ServerCall, tags []mounttable.Tag) error {
+func (n *node) satisfies(mt *mountTable, call ipc.ServerCall, tags []mounttable.Tag) error {
// No ACLs means everything (for now).
- if ctx == nil || tags == nil || n.acls == nil {
+ if call == nil || tags == nil || n.acls == nil {
return nil
}
// "Self-RPCs" are always authorized.
- if l, r := ctx.LocalBlessings().PublicKey(), ctx.RemoteBlessings().PublicKey(); l != nil && reflect.DeepEqual(l, r) {
+ if l, r := call.LocalBlessings().PublicKey(), call.RemoteBlessings().PublicKey(); l != nil && reflect.DeepEqual(l, r) {
return nil
}
// Match client's blessings against the ACLs.
- blessings, invalidB := ctx.RemoteBlessings().ForCall(ctx)
+ blessings, invalidB := call.RemoteBlessings().ForCall(call)
for _, tag := range tags {
if acl, exists := n.acls.GetACLForTag(string(tag)); exists && acl.Includes(blessings...) {
return nil
@@ -181,9 +181,9 @@
return nil
}
if len(invalidB) > 0 {
- return verror.New(verror.ErrNoAccess, ctx.Context(), blessings, invalidB)
+ return verror.New(verror.ErrNoAccess, call.Context(), blessings, invalidB)
}
- return verror.New(verror.ErrNoAccess, ctx.Context(), blessings)
+ return verror.New(verror.ErrNoAccess, call.Context(), blessings)
}
func expand(acl *access.ACL, name string) *access.ACL {
@@ -199,31 +199,31 @@
// satisfiesTemplate returns no error if the ctx + n.amTemplate satisfies the associated one of
// the required Tags.
-func (n *node) satisfiesTemplate(ctx ipc.ServerCall, tags []mounttable.Tag, name string) error {
+func (n *node) satisfiesTemplate(call ipc.ServerCall, tags []mounttable.Tag, name string) error {
if n.amTemplate == nil {
return nil
}
// Match client's blessings against the ACLs.
- blessings, invalidB := ctx.RemoteBlessings().ForCall(ctx)
+ blessings, invalidB := call.RemoteBlessings().ForCall(call)
for _, tag := range tags {
if acl, exists := n.amTemplate[string(tag)]; exists && expand(&acl, name).Includes(blessings...) {
return nil
}
}
- return verror.New(verror.ErrNoAccess, ctx.Context(), blessings, invalidB)
+ return verror.New(verror.ErrNoAccess, call.Context(), blessings, invalidB)
}
// copyACLs copies one nodes ACLs to another and adds the clients blessings as
// patterns to the Admin tag.
-func copyACLs(ctx ipc.ServerCall, cur *node) *TAMG {
- if ctx == nil {
+func copyACLs(call ipc.ServerCall, cur *node) *TAMG {
+ if call == nil {
return nil
}
if cur.acls == nil {
return nil
}
acls := cur.acls.Copy()
- blessings, _ := ctx.RemoteBlessings().ForCall(ctx)
+ blessings, _ := call.RemoteBlessings().ForCall(call)
for _, b := range blessings {
acls.Add(security.BlessingPattern(b), string(mounttable.Admin))
}
@@ -244,15 +244,15 @@
// while following the path, return that node and any remaining elems.
//
// If it returns a node, both the node and its parent are locked.
-func (mt *mountTable) traverse(ctx ipc.ServerCall, elems []string, create bool) (*node, []string, error) {
+func (mt *mountTable) traverse(call ipc.ServerCall, elems []string, create bool) (*node, []string, error) {
// Invariant is that the current node and its parent are both locked.
cur := mt.root
cur.parent.Lock()
cur.Lock()
for i, e := range elems {
vlog.VI(2).Infof("satisfying %v %v", elems[0:i], *cur)
- if ctx != nil {
- if err := cur.satisfies(mt, ctx, traverseTags); err != nil {
+ if call != nil {
+ if err := cur.satisfies(mt, call, traverseTags); err != nil {
cur.parent.Unlock()
cur.Unlock()
return nil, nil, err
@@ -277,12 +277,12 @@
}
// Create a new node and keep recursing.
cur.parent.Unlock()
- if err := cur.satisfies(mt, ctx, createTags); err != nil {
+ if err := cur.satisfies(mt, call, createTags); err != nil {
cur.Unlock()
return nil, nil, err
}
- if ctx != nil {
- if err := cur.satisfiesTemplate(ctx, createTags, e); err != nil {
+ if call != nil {
+ if err := cur.satisfiesTemplate(call, createTags, e); err != nil {
cur.Unlock()
return nil, nil, err
}
@@ -293,7 +293,7 @@
if cur.amTemplate != nil {
next.acls = createTAMGFromTemplate(cur.amTemplate, e)
} else {
- next.acls = copyACLs(ctx, cur)
+ next.acls = copyACLs(call, cur)
}
if cur.children == nil {
cur.children = make(map[string]*node)
@@ -310,8 +310,8 @@
// findNode finds a node in the table and optionally creates a path to it.
//
// If a node is found, on return it and its parent are locked.
-func (mt *mountTable) findNode(ctx ipc.ServerCall, elems []string, create bool, tags []mounttable.Tag) (*node, error) {
- n, nelems, err := mt.traverse(ctx, elems, create)
+func (mt *mountTable) findNode(call ipc.ServerCall, elems []string, create bool, tags []mounttable.Tag) (*node, error) {
+ n, nelems, err := mt.traverse(call, elems, create)
if err != nil {
return nil, err
}
@@ -323,7 +323,7 @@
n.Unlock()
return nil, nil
}
- if err := n.satisfies(mt, ctx, tags); err != nil {
+ if err := n.satisfies(mt, call, tags); err != nil {
n.parent.Unlock()
n.Unlock()
return nil, err
@@ -335,8 +335,8 @@
// any elements remaining of the path.
//
// If a mountpoint is found, on return it and its parent are locked.
-func (mt *mountTable) findMountPoint(ctx ipc.ServerCall, elems []string) (*node, []string, error) {
- n, nelems, err := mt.traverse(ctx, elems, false)
+func (mt *mountTable) findMountPoint(call ipc.ServerCall, elems []string) (*node, []string, error) {
+ n, nelems, err := mt.traverse(call, elems, false)
if err != nil {
return nil, nil, err
}
@@ -359,23 +359,23 @@
// Authorize verifies that the client has access to the requested node.
// Since we do the check at the time of access, we always return OK here.
-func (ms *mountContext) Authorize(ctx security.Call) error {
+func (ms *mountContext) Authorize(call security.Call) error {
return nil
}
// ResolveStep returns the next server in a resolution, the name remaining below that server,
// and whether or not that server is another mount table.
-func (ms *mountContext) ResolveStepX(ctx ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
- return ms.ResolveStep(ctx)
+func (ms *mountContext) ResolveStepX(call ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
+ return ms.ResolveStep(call)
}
// ResolveStep returns the next server in a resolution in the form of a MountEntry. The name
// in the mount entry is the name relative to the server's root.
-func (ms *mountContext) ResolveStep(ctx ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
+func (ms *mountContext) ResolveStep(call ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
vlog.VI(2).Infof("ResolveStep %q", ms.name)
mt := ms.mt
// Find the next mount point for the name.
- n, elems, werr := mt.findMountPoint(ctx, ms.elems)
+ n, elems, werr := mt.findMountPoint(call, ms.elems)
if werr != nil {
err = werr
return
@@ -383,9 +383,9 @@
if n == nil {
entry.Name = ms.name
if len(ms.elems) == 0 {
- err = verror.New(naming.ErrNoSuchNameRoot, ctx.Context(), ms.name)
+ err = verror.New(naming.ErrNoSuchNameRoot, call.Context(), ms.name)
} else {
- err = verror.New(naming.ErrNoSuchName, ctx.Context(), ms.name)
+ err = verror.New(naming.ErrNoSuchName, call.Context(), ms.name)
}
return
}
@@ -406,16 +406,16 @@
}
// Mount a server onto the name in the receiver.
-func (ms *mountContext) Mount(ctx ipc.ServerCall, server string, ttlsecs uint32, flags naming.MountFlag) error {
- return ms.MountX(ctx, server, nil, ttlsecs, flags)
+func (ms *mountContext) Mount(call ipc.ServerCall, server string, ttlsecs uint32, flags naming.MountFlag) error {
+ return ms.MountX(call, server, nil, ttlsecs, flags)
}
-func (ms *mountContext) MountX(ctx ipc.ServerCall, server string, patterns []security.BlessingPattern, ttlsecs uint32, flags naming.MountFlag) error {
+func (ms *mountContext) MountX(call ipc.ServerCall, server string, patterns []security.BlessingPattern, ttlsecs uint32, flags naming.MountFlag) error {
if len(patterns) == 0 {
// No patterns provided in the request, take the conservative
// approach and assume that the server being mounted will
// present the same blessings as the client calling Mount.
- blessings, _ := ctx.RemoteBlessings().ForCall(ctx)
+ blessings, _ := call.RemoteBlessings().ForCall(call)
for _, b := range blessings {
patterns = append(patterns, security.BlessingPattern(b))
}
@@ -437,12 +437,12 @@
}
// Find/create node in namespace and add the mount.
- n, werr := mt.findNode(ctx, ms.elems, true, mountTags)
+ n, werr := mt.findNode(call, ms.elems, true, mountTags)
if werr != nil {
return werr
}
if n == nil {
- return verror.New(naming.ErrNoSuchNameRoot, ctx.Context(), ms.name)
+ return verror.New(naming.ErrNoSuchNameRoot, call.Context(), ms.name)
}
// We don't need the parent lock
n.parent.Unlock()
@@ -514,10 +514,10 @@
// Unmount removes servers from the name in the receiver. If server is specified, only that
// server is removed.
-func (ms *mountContext) Unmount(ctx ipc.ServerCall, server string) error {
+func (ms *mountContext) Unmount(call ipc.ServerCall, server string) error {
vlog.VI(2).Infof("*********************Unmount %q, %s", ms.name, server)
mt := ms.mt
- n, err := mt.findNode(ctx, ms.elems, false, mountTags)
+ n, err := mt.findNode(call, ms.elems, false, mountTags)
if err != nil {
return err
}
@@ -541,7 +541,7 @@
}
// Delete removes the receiver. If all is true, any subtree is also removed.
-func (ms *mountContext) Delete(ctx ipc.ServerCall, deleteSubTree bool) error {
+func (ms *mountContext) Delete(call ipc.ServerCall, deleteSubTree bool) error {
vlog.VI(2).Infof("*********************Delete %q, %v", ms.name, deleteSubTree)
if len(ms.elems) == 0 {
// We can't delete the root.
@@ -549,7 +549,7 @@
}
mt := ms.mt
// Find and lock the parent node.
- n, err := mt.findNode(ctx, ms.elems, false, removeTags)
+ n, err := mt.findNode(call, ms.elems, false, removeTags)
if err != nil {
return err
}
@@ -572,7 +572,7 @@
}
// globStep is called with n and n.parent locked. Returns with both unlocked.
-func (mt *mountTable) globStep(n *node, name string, pattern *glob.Glob, ctx ipc.ServerCall, ch chan<- naming.VDLGlobReply) {
+func (mt *mountTable) globStep(n *node, name string, pattern *glob.Glob, call ipc.ServerCall, ch chan<- naming.VDLGlobReply) {
vlog.VI(2).Infof("globStep(%s, %s)", name, pattern)
// If this is a mount point, we're done.
@@ -600,9 +600,9 @@
// Recurse through the children. OK if client has read access to the
// directory or has traverse access to the directory and any access to the child.
allAllowed := true
- if err := n.satisfies(mt, ctx, globTags); err != nil {
+ if err := n.satisfies(mt, call, globTags); err != nil {
allAllowed = false
- if err := n.satisfies(mt, ctx, traverseTags); err != nil {
+ if err := n.satisfies(mt, call, traverseTags); err != nil {
n.parent.Unlock()
n.Unlock()
return
@@ -619,12 +619,12 @@
c.Lock()
if !allAllowed {
// If child allows any access show it. Otherwise, skip.
- if err := c.satisfies(mt, ctx, allTags); err != nil {
+ if err := c.satisfies(mt, call, allTags); err != nil {
c.Unlock()
continue
}
}
- mt.globStep(c, naming.Join(name, k), suffix, ctx, ch)
+ mt.globStep(c, naming.Join(name, k), suffix, call, ch)
n.Lock()
}
}
@@ -644,7 +644,7 @@
// To see anything, one has to have some access to the node. Don't need the parent lock anymore.
n.parent.Unlock()
- if err := n.satisfies(mt, ctx, allTags); err != nil {
+ if err := n.satisfies(mt, call, allTags); err != nil {
n.Unlock()
return
}
@@ -664,7 +664,7 @@
// a state that never existed in the mounttable. For example, if someone removes c/d and later
// adds a/b while a Glob is in progress, the Glob may return a set of nodes that includes both
// c/d and a/b.
-func (ms *mountContext) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (ms *mountContext) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
vlog.VI(2).Infof("mt.Glob %v", ms.elems)
g, err := glob.Parse(pattern)
@@ -677,7 +677,7 @@
go func() {
defer close(ch)
// If there was an access error, just ignore the entry, i.e., make it invisible.
- n, err := mt.findNode(ctx, ms.elems, false, nil)
+ n, err := mt.findNode(call, ms.elems, false, nil)
if err != nil {
return
}
@@ -685,16 +685,16 @@
// don't need to evaluate the glob expression. Send a partially resolved
// name back to the client.
if n == nil {
- ms.linkToLeaf(ctx, ch)
+ ms.linkToLeaf(call, ch)
return
}
- mt.globStep(n, "", g, ctx, ch)
+ mt.globStep(n, "", g, call, ch)
}()
return ch, nil
}
-func (ms *mountContext) linkToLeaf(ctx ipc.ServerCall, ch chan<- naming.VDLGlobReply) {
- n, elems, err := ms.mt.findMountPoint(ctx, ms.elems)
+func (ms *mountContext) linkToLeaf(call ipc.ServerCall, ch chan<- naming.VDLGlobReply) {
+ n, elems, err := ms.mt.findMountPoint(call, ms.elems)
if err != nil || n == nil {
return
}
@@ -707,18 +707,18 @@
ch <- naming.VDLGlobReplyEntry{naming.VDLMountEntry{Name: "", Servers: servers}}
}
-func (ms *mountContext) SetACL(ctx ipc.ServerCall, tam access.TaggedACLMap, etag string) error {
+func (ms *mountContext) SetACL(call ipc.ServerCall, tam access.TaggedACLMap, etag string) error {
vlog.VI(2).Infof("SetACL %q", ms.name)
mt := ms.mt
// Find/create node in namespace and add the mount.
- n, err := mt.findNode(ctx, ms.elems, true, setTags)
+ n, err := mt.findNode(call, ms.elems, true, setTags)
if err != nil {
return err
}
if n == nil {
// TODO(p): can this even happen?
- return verror.New(naming.ErrNoSuchName, ctx.Context(), ms.name)
+ return verror.New(naming.ErrNoSuchName, call.Context(), ms.name)
}
n.parent.Unlock()
defer n.Unlock()
@@ -729,17 +729,17 @@
return err
}
-func (ms *mountContext) GetACL(ctx ipc.ServerCall) (access.TaggedACLMap, string, error) {
+func (ms *mountContext) GetACL(call ipc.ServerCall) (access.TaggedACLMap, string, error) {
vlog.VI(2).Infof("GetACL %q", ms.name)
mt := ms.mt
// Find node in namespace and add the mount.
- n, err := mt.findNode(ctx, ms.elems, false, getTags)
+ n, err := mt.findNode(call, ms.elems, false, getTags)
if err != nil {
return nil, "", err
}
if n == nil {
- return nil, "", verror.New(naming.ErrNoSuchName, ctx.Context(), ms.name)
+ return nil, "", verror.New(naming.ErrNoSuchName, call.Context(), ms.name)
}
n.parent.Unlock()
defer n.Unlock()
diff --git a/services/mounttable/lib/neighborhood.go b/services/mounttable/lib/neighborhood.go
index f42ca9d..17b6b3a 100644
--- a/services/mounttable/lib/neighborhood.go
+++ b/services/mounttable/lib/neighborhood.go
@@ -142,7 +142,7 @@
return mounttable.MountTableServer(ns), nh, nil
}
-func (nh *neighborhood) Authorize(context security.Call) error {
+func (nh *neighborhood) Authorize(call security.Call) error {
// TODO(rthellend): Figure out whether it's OK to accept all requests
// unconditionally.
return nil
@@ -211,24 +211,24 @@
}
// ResolveStepX implements ResolveStepX
-func (ns *neighborhoodService) ResolveStepX(ctx ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
- return ns.ResolveStep(ctx)
+func (ns *neighborhoodService) ResolveStepX(call ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
+ return ns.ResolveStep(call)
}
// ResolveStep implements ResolveStep
-func (ns *neighborhoodService) ResolveStep(ctx ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
+func (ns *neighborhoodService) ResolveStep(call ipc.ServerCall) (entry naming.VDLMountEntry, err error) {
nh := ns.nh
vlog.VI(2).Infof("ResolveStep %v\n", ns.elems)
if len(ns.elems) == 0 {
//nothing can be mounted at the root
- err = verror.New(naming.ErrNoSuchNameRoot, ctx.Context(), ns.elems)
+ err = verror.New(naming.ErrNoSuchNameRoot, call.Context(), ns.elems)
return
}
// We can only resolve the first element and it always refers to a mount table (for now).
neighbor := nh.neighbor(ns.elems[0])
if neighbor == nil {
- err = verror.New(naming.ErrNoSuchName, ctx.Context(), ns.elems)
+ err = verror.New(naming.ErrNoSuchName, call.Context(), ns.elems)
entry.Name = ns.name
return
}
@@ -239,8 +239,8 @@
}
// Mount not implemented.
-func (ns *neighborhoodService) Mount(ctx ipc.ServerCall, server string, ttlsecs uint32, opts naming.MountFlag) error {
- return ns.MountX(ctx, server, nil, ttlsecs, opts)
+func (ns *neighborhoodService) Mount(call ipc.ServerCall, server string, ttlsecs uint32, opts naming.MountFlag) error {
+ return ns.MountX(call, server, nil, ttlsecs, opts)
}
func (ns *neighborhoodService) MountX(_ ipc.ServerCall, _ string, _ []security.BlessingPattern, _ uint32, _ naming.MountFlag) error {
return errors.New("this server does not implement Mount")
@@ -257,7 +257,7 @@
}
// Glob__ implements ipc.AllGlobber
-func (ns *neighborhoodService) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+func (ns *neighborhoodService) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
g, err := glob.Parse(pattern)
if err != nil {
return nil, err
@@ -282,21 +282,21 @@
case 1:
neighbor := nh.neighbor(ns.elems[0])
if neighbor == nil {
- return nil, verror.New(naming.ErrNoSuchName, ctx.Context(), ns.elems[0])
+ return nil, verror.New(naming.ErrNoSuchName, call.Context(), ns.elems[0])
}
ch := make(chan naming.VDLGlobReply, 1)
ch <- naming.VDLGlobReplyEntry{naming.VDLMountEntry{Name: "", Servers: neighbor, MT: true}}
close(ch)
return ch, nil
default:
- return nil, verror.New(naming.ErrNoSuchName, ctx.Context(), ns.elems)
+ return nil, verror.New(naming.ErrNoSuchName, call.Context(), ns.elems)
}
}
-func (*neighborhoodService) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+func (*neighborhoodService) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
return errors.New("this server does not implement SetACL")
}
-func (*neighborhoodService) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+func (*neighborhoodService) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
return nil, "", nil
}
diff --git a/services/security/discharger/discharger.go b/services/security/discharger/discharger.go
index 1463d00..4f67415 100644
--- a/services/security/discharger/discharger.go
+++ b/services/security/discharger/discharger.go
@@ -13,19 +13,19 @@
// namespace with no additional caveats iff the caveat is valid.
type dischargerd struct{}
-func (dischargerd) Discharge(ctx ipc.ServerCall, caveat security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
+func (dischargerd) Discharge(call ipc.ServerCall, caveat security.Caveat, _ security.DischargeImpetus) (security.WireDischarge, error) {
tp := caveat.ThirdPartyDetails()
if tp == nil {
return nil, fmt.Errorf("Caveat %v does not represent a third party caveat", caveat)
}
- if err := tp.Dischargeable(ctx); err != nil {
+ if err := tp.Dischargeable(call); err != nil {
return nil, fmt.Errorf("third-party caveat %v cannot be discharged for this context: %v", tp, err)
}
expiry, err := security.ExpiryCaveat(time.Now().Add(15 * time.Minute))
if err != nil {
return nil, fmt.Errorf("unable to create expiration caveat on the discharge: %v", err)
}
- d, err := ctx.LocalPrincipal().MintDischarge(caveat, expiry)
+ d, err := call.LocalPrincipal().MintDischarge(caveat, expiry)
if err != nil {
return nil, err
}
diff --git a/services/security/groups/server/group.go b/services/security/groups/server/group.go
index ae1556c..a569f8a 100644
--- a/services/security/groups/server/group.go
+++ b/services/security/groups/server/group.go
@@ -22,23 +22,23 @@
// It seems we need either (a) identity providers to manage group servers and
// reserve buckets for users they've blessed, or (b) some way to determine the
// user name from a blessing and enforce that group names start with user names.
-func (g *group) Create(ctx ipc.ServerCall, acl access.TaggedACLMap, entries []groups.BlessingPatternChunk) error {
+func (g *group) Create(call ipc.ServerCall, acl access.TaggedACLMap, entries []groups.BlessingPatternChunk) error {
// Perform ACL check.
// TODO(sadovsky): Enable this ACL check and acquire a lock on the group
// server ACL.
if false {
- if err := g.authorize(ctx, g.m.acl); err != nil {
+ if err := g.authorize(call, g.m.acl); err != nil {
return err
}
}
if acl == nil {
acl = access.TaggedACLMap{}
- blessings, _ := ctx.RemoteBlessings().ForCall(ctx)
+ blessings, _ := call.RemoteBlessings().ForCall(call)
if len(blessings) == 0 {
// The blessings presented by the caller do not give it a name for this
// operation. We could create a world-accessible group, but it seems safer
// to return an error.
- return groups.NewErrNoBlessings(ctx.Context())
+ return groups.NewErrNoBlessings(call.Context())
}
for _, tag := range access.AllTypicalTags() {
for _, b := range blessings {
@@ -57,34 +57,34 @@
// opaque error. (That's not a great solution either. Having per-user
// buckets seems like a better solution.)
if _, ok := err.(*ErrKeyAlreadyExists); ok {
- return verror.New(verror.ErrExist, ctx.Context(), g.name)
+ return verror.New(verror.ErrExist, call.Context(), g.name)
}
- return verror.New(verror.ErrInternal, ctx.Context(), err)
+ return verror.New(verror.ErrInternal, call.Context(), err)
}
return nil
}
-func (g *group) Delete(ctx ipc.ServerCall, etag string) error {
- return g.readModifyWrite(ctx, etag, func(gd *groupData, etagSt string) error {
+func (g *group) Delete(call ipc.ServerCall, etag string) error {
+ return g.readModifyWrite(call, etag, func(gd *groupData, etagSt string) error {
return g.m.st.Delete(g.name, etagSt)
})
}
-func (g *group) Add(ctx ipc.ServerCall, entry groups.BlessingPatternChunk, etag string) error {
- return g.update(ctx, etag, func(gd *groupData) {
+func (g *group) Add(call ipc.ServerCall, entry groups.BlessingPatternChunk, etag string) error {
+ return g.update(call, etag, func(gd *groupData) {
gd.Entries[entry] = struct{}{}
})
}
-func (g *group) Remove(ctx ipc.ServerCall, entry groups.BlessingPatternChunk, etag string) error {
- return g.update(ctx, etag, func(gd *groupData) {
+func (g *group) Remove(call ipc.ServerCall, entry groups.BlessingPatternChunk, etag string) error {
+ return g.update(call, etag, func(gd *groupData) {
delete(gd.Entries, entry)
})
}
// TODO(sadovsky): Replace fake implementation with real implementation.
-func (g *group) Get(ctx ipc.ServerCall, req groups.GetRequest, reqEtag string) (res groups.GetResponse, etag string, err error) {
- gd, etag, err := g.getInternal(ctx)
+func (g *group) Get(call ipc.ServerCall, req groups.GetRequest, reqEtag string) (res groups.GetResponse, etag string, err error) {
+ gd, etag, err := g.getInternal(call)
if err != nil {
return groups.GetResponse{}, "", err
}
@@ -92,22 +92,22 @@
}
// TODO(sadovsky): Replace fake implementation with real implementation.
-func (g *group) Rest(ctx ipc.ServerCall, req groups.RestRequest, reqEtag string) (res groups.RestResponse, etag string, err error) {
- _, etag, err = g.getInternal(ctx)
+func (g *group) Rest(call ipc.ServerCall, req groups.RestRequest, reqEtag string) (res groups.RestResponse, etag string, err error) {
+ _, etag, err = g.getInternal(call)
if err != nil {
return groups.RestResponse{}, "", err
}
return groups.RestResponse{}, etag, nil
}
-func (g *group) SetACL(ctx ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
- return g.update(ctx, etag, func(gd *groupData) {
+func (g *group) SetACL(call ipc.ServerCall, acl access.TaggedACLMap, etag string) error {
+ return g.update(call, etag, func(gd *groupData) {
gd.ACL = acl
})
}
-func (g *group) GetACL(ctx ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
- gd, etag, err := g.getInternal(ctx)
+func (g *group) GetACL(call ipc.ServerCall) (acl access.TaggedACLMap, etag string, err error) {
+ gd, etag, err := g.getInternal(call)
if err != nil {
return nil, "", err
}
@@ -118,42 +118,42 @@
// Internal helpers
// Returns a VDL-compatible error.
-func (g *group) authorize(ctx ipc.ServerCall, acl access.TaggedACLMap) error {
+func (g *group) authorize(call ipc.ServerCall, acl access.TaggedACLMap) error {
// TODO(sadovsky): We ignore the returned error since TypicalTagType is
// guaranteed to return a valid tagType. It would be nice to have an
// alternative function that assumes TypicalTagType, since presumably that's
// the overwhelmingly common case.
auth, _ := access.TaggedACLAuthorizer(acl, access.TypicalTagType())
- if err := auth.Authorize(ctx); err != nil {
+ if err := auth.Authorize(call); err != nil {
// TODO(sadovsky): Return NoAccess if appropriate.
- return verror.New(verror.ErrNoExistOrNoAccess, ctx.Context(), err)
+ return verror.New(verror.ErrNoExistOrNoAccess, call.Context(), err)
}
return nil
}
// Returns a VDL-compatible error. Performs access check.
-func (g *group) getInternal(ctx ipc.ServerCall) (gd groupData, etag string, err error) {
+func (g *group) getInternal(call ipc.ServerCall) (gd groupData, etag string, err error) {
v, etag, err := g.m.st.Get(g.name)
if err != nil {
if _, ok := err.(*ErrUnknownKey); ok {
// TODO(sadovsky): Return NoExist if appropriate.
- return groupData{}, "", verror.New(verror.ErrNoExistOrNoAccess, ctx.Context(), g.name)
+ return groupData{}, "", verror.New(verror.ErrNoExistOrNoAccess, call.Context(), g.name)
}
- return groupData{}, "", verror.New(verror.ErrInternal, ctx.Context(), err)
+ return groupData{}, "", verror.New(verror.ErrInternal, call.Context(), err)
}
gd, ok := v.(groupData)
if !ok {
- return groupData{}, "", verror.New(verror.ErrInternal, ctx.Context(), "bad value for key: "+g.name)
+ return groupData{}, "", verror.New(verror.ErrInternal, call.Context(), "bad value for key: "+g.name)
}
- if err := g.authorize(ctx, gd.ACL); err != nil {
+ if err := g.authorize(call, gd.ACL); err != nil {
return groupData{}, "", err
}
return gd, etag, nil
}
// Returns a VDL-compatible error. Performs access check.
-func (g *group) update(ctx ipc.ServerCall, etag string, fn func(gd *groupData)) error {
- return g.readModifyWrite(ctx, etag, func(gd *groupData, etagSt string) error {
+func (g *group) update(call ipc.ServerCall, etag string, fn func(gd *groupData)) error {
+ return g.readModifyWrite(call, etag, func(gd *groupData, etagSt string) error {
fn(gd)
return g.m.st.Update(g.name, *gd, etagSt)
})
@@ -162,30 +162,30 @@
// Returns a VDL-compatible error. Performs access check.
// fn should perform the "modify, write" part of "read, modify, write", and
// should return a Store error.
-func (g *group) readModifyWrite(ctx ipc.ServerCall, etag string, fn func(gd *groupData, etagSt string) error) error {
+func (g *group) readModifyWrite(call ipc.ServerCall, etag string, fn func(gd *groupData, etagSt string) error) error {
// Transaction retry loop.
for i := 0; i < 3; i++ {
- gd, etagSt, err := g.getInternal(ctx)
+ gd, etagSt, err := g.getInternal(call)
if err != nil {
return err
}
// Fail early if possible.
if etag != "" && etag != etagSt {
- return verror.NewErrBadEtag(ctx.Context())
+ return verror.NewErrBadEtag(call.Context())
}
if err := fn(&gd, etagSt); err != nil {
if err, ok := err.(*ErrBadEtag); ok {
// Retry on etag error if the original etag was empty.
if etag != "" {
- return verror.NewErrBadEtag(ctx.Context())
+ return verror.NewErrBadEtag(call.Context())
}
} else {
// Abort on non-etag error.
- return verror.New(verror.ErrInternal, ctx.Context(), err)
+ return verror.New(verror.ErrInternal, call.Context(), err)
}
} else {
return nil
}
}
- return groups.NewErrExcessiveContention(ctx.Context())
+ return groups.NewErrExcessiveContention(call.Context())
}
diff --git a/services/wsprd/app/app.go b/services/wsprd/app/app.go
index 5a84c66..cdbfded 100644
--- a/services/wsprd/app/app.go
+++ b/services/wsprd/app/app.go
@@ -670,8 +670,8 @@
}
// Signature uses the signature manager to get and cache the signature of a remote server.
-func (c *Controller) Signature(ctx ipc.ServerCall, name string) ([]signature.Interface, error) {
- return c.getSignature(ctx.Context(), name)
+func (c *Controller) Signature(call ipc.ServerCall, name string) ([]signature.Interface, error) {
+ return c.getSignature(call.Context(), name)
}
// UnlinkJSBlessings removes the given blessings from the blessings store.
@@ -736,17 +736,17 @@
return handle, encodedKey, nil
}
-func (c *Controller) RemoteBlessings(ctx ipc.ServerCall, name, method string) ([]string, error) {
+func (c *Controller) RemoteBlessings(call ipc.ServerCall, name, method string) ([]string, error) {
vlog.VI(2).Infof("requesting remote blessings for %q", name)
- cctx, cancel := context.WithTimeout(ctx.Context(), 5*time.Second)
+ cctx, cancel := context.WithTimeout(call.Context(), 5*time.Second)
defer cancel()
- call, err := v23.GetClient(cctx).StartCall(cctx, name, method, nil)
+ clientCall, err := v23.GetClient(cctx).StartCall(cctx, name, method, nil)
if err != nil {
return nil, verror.Convert(verror.ErrInternal, cctx, err)
}
- blessings, _ := call.RemoteBlessings()
+ blessings, _ := clientCall.RemoteBlessings()
return blessings, nil
}
diff --git a/services/wsprd/ipc/server/authorizer.go b/services/wsprd/ipc/server/authorizer.go
index d87f199..d9fddea 100644
--- a/services/wsprd/ipc/server/authorizer.go
+++ b/services/wsprd/ipc/server/authorizer.go
@@ -8,6 +8,6 @@
authFunc remoteAuthFunc
}
-func (a *authorizer) Authorize(ctx security.Call) error {
- return a.authFunc(ctx)
+func (a *authorizer) Authorize(call security.Call) error {
+ return a.authFunc(call)
}
diff --git a/services/wsprd/ipc/server/dispatcher_test.go b/services/wsprd/ipc/server/dispatcher_test.go
index 67022e3..ba96bc6 100644
--- a/services/wsprd/ipc/server/dispatcher_test.go
+++ b/services/wsprd/ipc/server/dispatcher_test.go
@@ -41,11 +41,11 @@
return nil
}
-func (m mockInvoker) Signature(ctx ipc.ServerCall) ([]signature.Interface, error) {
+func (m mockInvoker) Signature(call ipc.ServerCall) ([]signature.Interface, error) {
return m.sig, nil
}
-func (m mockInvoker) MethodSignature(ctx ipc.ServerCall, methodName string) (signature.Method, error) {
+func (m mockInvoker) MethodSignature(call ipc.ServerCall, methodName string) (signature.Method, error) {
method, found := m.sig[0].FindMethod(methodName)
if !found {
return signature.Method{}, fmt.Errorf("Method %q not found", methodName)
diff --git a/services/wsprd/ipc/server/invoker.go b/services/wsprd/ipc/server/invoker.go
index b41ef6c..196ff2a 100644
--- a/services/wsprd/ipc/server/invoker.go
+++ b/services/wsprd/ipc/server/invoker.go
@@ -81,22 +81,22 @@
return &ipc.GlobState{AllGlobber: i}
}
-func (i *invoker) Glob__(ctx ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
- return i.globFunc(pattern, ctx)
+func (i *invoker) Glob__(call ipc.ServerCall, pattern string) (<-chan naming.VDLGlobReply, error) {
+ return i.globFunc(pattern, call)
}
-func (i *invoker) Signature(ctx ipc.ServerCall) ([]signature.Interface, error) {
+func (i *invoker) Signature(call ipc.ServerCall) ([]signature.Interface, error) {
return i.signature, nil
}
-func (i *invoker) MethodSignature(ctx ipc.ServerCall, method string) (signature.Method, error) {
+func (i *invoker) MethodSignature(call ipc.ServerCall, method string) (signature.Method, error) {
if methodSig, ok := signature.FirstMethod(i.signature, method); ok {
return methodSig, nil
}
var innerContext *context.T
- if ctx != nil {
- innerContext = ctx.Context()
+ if call != nil {
+ innerContext = call.Context()
}
return signature.Method{}, verror.New(ErrMethodNotFoundInSignature, innerContext, method)
diff --git a/services/wsprd/ipc/server/server.go b/services/wsprd/ipc/server/server.go
index d37aa51..5194870 100644
--- a/services/wsprd/ipc/server/server.go
+++ b/services/wsprd/ipc/server/server.go
@@ -328,10 +328,10 @@
// wsprCaveatValidator validates caveats in javascript.
// It resolves each []security.Caveat in cavs to an error (or nil) and collects them in a slice.
-func (s *Server) wsprCaveatValidator(ctx security.Call, cavs [][]security.Caveat) []error {
+func (s *Server) wsprCaveatValidator(call security.Call, cavs [][]security.Caveat) []error {
flow := s.helper.CreateNewFlow(s, nil)
req := CaveatValidationRequest{
- Ctx: s.convertSecurityContext(ctx, false),
+ Ctx: s.convertSecurityContext(call, false),
Cavs: cavs,
}
@@ -354,65 +354,65 @@
// TODO(bprosnitz) Consider using a different timeout than the standard ipc timeout.
var timeoutChan <-chan time.Time
- if deadline, ok := ctx.Context().Deadline(); ok {
+ if deadline, ok := call.Context().Deadline(); ok {
timeoutChan = time.After(deadline.Sub(time.Now()))
}
select {
case <-timeoutChan:
- return makeListOfErrors(len(cavs), NewErrCaveatValidationTimeout(ctx.Context()))
+ return makeListOfErrors(len(cavs), NewErrCaveatValidationTimeout(call.Context()))
case reply := <-replyChan:
if len(reply) != len(cavs) {
vlog.VI(2).Infof("Wspr caveat validator received %d results from javascript but expected %d", len(reply), len(cavs))
- return makeListOfErrors(len(cavs), NewErrInvalidValidationResponseFromJavascript(ctx.Context()))
+ return makeListOfErrors(len(cavs), NewErrInvalidValidationResponseFromJavascript(call.Context()))
}
return reply
}
}
-func (s *Server) convertSecurityContext(ctx security.Call, includeBlessingStrings bool) SecurityContext {
+func (s *Server) convertSecurityContext(call security.Call, includeBlessingStrings bool) SecurityContext {
// TODO(bprosnitz) Local/Remote Endpoint should always be non-nil, but isn't
// due to a TODO in vc/auth.go
var localEndpoint string
- if ctx.LocalEndpoint() != nil {
- localEndpoint = ctx.LocalEndpoint().String()
+ if call.LocalEndpoint() != nil {
+ localEndpoint = call.LocalEndpoint().String()
}
var remoteEndpoint string
- if ctx.RemoteEndpoint() != nil {
- remoteEndpoint = ctx.RemoteEndpoint().String()
+ if call.RemoteEndpoint() != nil {
+ remoteEndpoint = call.RemoteEndpoint().String()
}
var localBlessings principal.BlessingsHandle
- if !ctx.LocalBlessings().IsZero() {
- localBlessings = s.convertBlessingsToHandle(ctx.LocalBlessings())
+ if !call.LocalBlessings().IsZero() {
+ localBlessings = s.convertBlessingsToHandle(call.LocalBlessings())
}
- anymtags := make([]*vdl.Value, len(ctx.MethodTags()))
- for i, mtag := range ctx.MethodTags() {
+ anymtags := make([]*vdl.Value, len(call.MethodTags()))
+ for i, mtag := range call.MethodTags() {
anymtags[i] = mtag
}
secCtx := SecurityContext{
- Method: lib.LowercaseFirstCharacter(ctx.Method()),
- Suffix: ctx.Suffix(),
+ Method: lib.LowercaseFirstCharacter(call.Method()),
+ Suffix: call.Suffix(),
MethodTags: anymtags,
LocalEndpoint: localEndpoint,
RemoteEndpoint: remoteEndpoint,
LocalBlessings: localBlessings,
- RemoteBlessings: s.convertBlessingsToHandle(ctx.RemoteBlessings()),
+ RemoteBlessings: s.convertBlessingsToHandle(call.RemoteBlessings()),
}
if includeBlessingStrings {
- secCtx.LocalBlessingStrings, _ = ctx.LocalBlessings().ForCall(ctx)
- secCtx.RemoteBlessingStrings, _ = ctx.RemoteBlessings().ForCall(ctx)
+ secCtx.LocalBlessingStrings, _ = call.LocalBlessings().ForCall(call)
+ secCtx.RemoteBlessingStrings, _ = call.RemoteBlessings().ForCall(call)
}
return secCtx
}
-type remoteAuthFunc func(ctx security.Call) error
+type remoteAuthFunc func(call security.Call) error
func (s *Server) createRemoteAuthFunc(handle int32) remoteAuthFunc {
- return func(ctx security.Call) error {
+ return func(call security.Call) error {
// Until the tests get fixed, we need to create a security context before creating the flow
// because creating the security context creates a flow and flow ids will be off.
- securityContext := s.convertSecurityContext(ctx, true)
+ securityContext := s.convertSecurityContext(call, true)
flow := s.helper.CreateNewFlow(s, nil)
replyChan := make(chan error, 1)
diff --git a/services/wsprd/namespace/request_handler.go b/services/wsprd/namespace/request_handler.go
index 508e8af..4335e7c 100644
--- a/services/wsprd/namespace/request_handler.go
+++ b/services/wsprd/namespace/request_handler.go
@@ -44,62 +44,62 @@
return nil
}
-func (s *Server) Mount(ctx ipc.ServerCall, name, server string, ttl time.Duration, replace bool) error {
+func (s *Server) Mount(call ipc.ServerCall, name, server string, ttl time.Duration, replace bool) error {
rmOpt := naming.ReplaceMountOpt(replace)
- err := s.ns.Mount(ctx.Context(), name, server, ttl, rmOpt)
+ err := s.ns.Mount(call.Context(), name, server, ttl, rmOpt)
if err != nil {
- err = verror.Convert(verror.ErrInternal, ctx.Context(), err)
+ err = verror.Convert(verror.ErrInternal, call.Context(), err)
}
return err
}
-func (s *Server) Unmount(ctx ipc.ServerCall, name, server string) error {
- return s.ns.Unmount(ctx.Context(), name, server)
+func (s *Server) Unmount(call ipc.ServerCall, name, server string) error {
+ return s.ns.Unmount(call.Context(), name, server)
}
-func (s *Server) Resolve(ctx ipc.ServerCall, name string) ([]string, error) {
- me, err := s.ns.Resolve(ctx.Context(), name)
+func (s *Server) Resolve(call ipc.ServerCall, name string) ([]string, error) {
+ me, err := s.ns.Resolve(call.Context(), name)
if err != nil {
- return nil, verror.Convert(verror.ErrInternal, ctx.Context(), err)
+ return nil, verror.Convert(verror.ErrInternal, call.Context(), err)
}
return me.Names(), nil
}
-func (s *Server) ResolveToMT(ctx ipc.ServerCall, name string) ([]string, error) {
- me, err := s.ns.ResolveToMountTable(ctx.Context(), name)
+func (s *Server) ResolveToMT(call ipc.ServerCall, name string) ([]string, error) {
+ me, err := s.ns.ResolveToMountTable(call.Context(), name)
if err != nil {
- return nil, verror.Convert(verror.ErrInternal, ctx.Context(), err)
+ return nil, verror.Convert(verror.ErrInternal, call.Context(), err)
}
return me.Names(), nil
}
-func (s *Server) FlushCacheEntry(ctx ipc.ServerCall, name string) (bool, error) {
+func (s *Server) FlushCacheEntry(call ipc.ServerCall, name string) (bool, error) {
return s.ns.FlushCacheEntry(name), nil
}
-func (s *Server) DisableCache(ctx ipc.ServerCall, disable bool) error {
+func (s *Server) DisableCache(call ipc.ServerCall, disable bool) error {
disableCacheCtl := naming.DisableCache(disable)
_ = s.ns.CacheCtl(disableCacheCtl)
return nil
}
-func (s *Server) Roots(ctx ipc.ServerCall) ([]string, error) {
+func (s *Server) Roots(call ipc.ServerCall) ([]string, error) {
return s.ns.Roots(), nil
}
-func (s *Server) SetRoots(ctx ipc.ServerCall, roots []string) error {
+func (s *Server) SetRoots(call ipc.ServerCall, roots []string) error {
if err := s.ns.SetRoots(roots...); err != nil {
- return verror.Convert(verror.ErrInternal, ctx.Context(), err)
+ return verror.Convert(verror.ErrInternal, call.Context(), err)
}
return nil
}
-func (s *Server) SetACL(ctx ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error {
- return s.ns.SetACL(ctx.Context(), name, acl, etag)
+func (s *Server) SetACL(call ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error {
+ return s.ns.SetACL(call.Context(), name, acl, etag)
}
-func (s *Server) GetACL(ctx ipc.ServerCall, name string) (access.TaggedACLMap, string, error) {
- return s.ns.GetACL(ctx.Context(), name)
+func (s *Server) GetACL(call ipc.ServerCall, name string) (access.TaggedACLMap, string, error) {
+ return s.ns.GetACL(call.Context(), name)
}
func convertToVDLEntry(value naming.MountEntry) naming.VDLMountEntry {