| // 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" |
| |
| "signature" |
| "v.io/v23/security" |
| "v.io/v23/vtrace" |
| "v.io/x/ref/services/wspr/internal/principal" |
| ) |
| |
| type Context struct { |
| Language string |
| } |
| |
| type SecurityCall struct { |
| Method string |
| Suffix string |
| MethodTags []any |
| LocalBlessings principal.BlessingsId |
| LocalBlessingStrings []string |
| RemoteBlessings principal.BlessingsId |
| RemoteBlessingStrings []string |
| LocalEndpoint string |
| RemoteEndpoint string |
| } |
| |
| type CaveatValidationRequest struct { |
| Call SecurityCall |
| Context Context |
| 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 |
| Context Context |
| TraceRequest vtrace.Request |
| GrantedBlessings principal.BlessingsId |
| } |
| |
| // A request from the proxy to javascript to handle an RPC |
| type ServerRpcRequest struct { |
| ServerId uint32 |
| Handle int32 |
| Method string |
| Args []any |
| Call ServerRpcRequestCall |
| } |
| |
| // A reply from javascript to a lookup request. |
| type LookupReply struct { |
| Handle int32 |
| HasAuthorizer bool |
| HasGlobber bool |
| Signature []signature.Interface |
| Err error |
| } |
| |
| // A reply from javascript to an auth request. |
| type AuthReply struct { |
| Err error |
| } |