blob: 980412342961bce83106849dbe51ce925fa476f9 [file] [log] [blame]
package app
import (
"signature"
"time"
"v.io/v23/security"
)
type Controller interface {
// Serve instructs WSPR to start listening for calls on behalf
// of a javascript server.
Serve(name string, serverId uint32) error
// Stop instructs WSPR to stop listening for calls for the
// given javascript server.
Stop(serverId uint32) error
// AddName adds a published name to an existing server.
AddName(serverId uint32, name string) error
// RemoveName removes a published name from an existing server.
RemoveName(serverId uint32, name string) error
// UnlinkJSBlessings removes the given blessings from the blessings store.
UnlinkJSBlessings(handle int32) error
// BlessPublicKey creates a new blessing.
BlessPublicKey(fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string | error)
// CreateBlessings creates a new principal self-blessed with the given extension.
CreateBlessings(extension string) (handle int32, publicKey string | error)
// RemoteBlessings fetches the remote blessings for a given name and method.
RemoteBlessings(name, method string) ([]string | error)
// Signature fetches the signature for a given name.
Signature(name string) ([]signature.Interface | error)
}