blob: 06eda35dc92d2ed89254a51436d4f58507c57f2c [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package server
import (
"time"
"v.io/v23/security"
"v.io/v23/vtrace"
"v.io/x/ref/services/wspr/internal/principal"
)
type SecurityCall struct {
Method string
Suffix string
MethodTags []any
LocalBlessings principal.JsBlessings
LocalBlessingStrings []string
RemoteBlessings principal.JsBlessings
RemoteBlessingStrings []string
LocalEndpoint string
RemoteEndpoint string
}
type CaveatValidationRequest struct {
Call SecurityCall
Cavs [][]security.Caveat
}
type CaveatValidationResponse struct {
Results []error
}
error (
CaveatValidationTimeout() {"en": "Caveat validation has timed out"}
InvalidValidationResponseFromJavascript() {"en": "Invalid validation response from javascript"}
ServerStopped() {RetryBackoff, "en": "Server has been stopped"}
)
type ServerRpcRequestCall struct {
SecurityCall SecurityCall
Deadline time.WireDeadline
TraceRequest vtrace.Request
GrantedBlessings ?principal.JsBlessings
}
// A request from the proxy to javascript to handle an RPC
type ServerRpcRequest struct {
ServerId uint32
Handle int32
Method string
Args []any
Call ServerRpcRequestCall
}