blob: 46d76892cab09eb2c4799be53aca060d1e3483bd [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.
// The app package contains the struct that keeps per javascript app state and handles translating
// javascript requests to vanadium requests and vice versa.
package app
import (
"time"
"v.io/v23/security"
"v.io/v23/vtrace"
"v.io/x/ref/services/wspr/internal/principal"
"v.io/x/ref/services/wspr/internal/rpc/server"
)
type RpcRequest struct {
Name string
Method string
NumInArgs int32
NumOutArgs int32
IsStreaming bool
Deadline time.WireDeadline
TraceRequest vtrace.Request
CallOptions []RpcCallOption
}
// TODO(nlacasse): It would be nice if RpcCallOption were a struct with
// optional types, like:
//
// type RpcCallOptions struct {
// AllowedServersPolicy ?[]security.BlessingPattern
// RetryTimeout ?time.Duration
// }
//
// Unfortunately, optional types are currently only supported for structs, not
// slices or primitive types. Once optional types are better supported, switch
// this to a struct with optional types.
type RpcCallOption union {
AllowedServersPolicy []security.BlessingPattern
RetryTimeout time.Duration
UseGranter GranterHandle
}
type RpcResponse struct {
OutArgs []any
TraceResponse vtrace.Response
}
type GranterHandle int32
type GranterRequest struct {
GranterHandle GranterHandle
Call server.SecurityCall
}
type GranterResponse struct {
Blessings principal.BlessingsHandle
Err error
}