blob: 980412342961bce83106849dbe51ce925fa476f9 [file] [log] [blame]
Matt Rosencrantz786f7272015-02-11 15:18:07 -08001package app
2
Matt Rosencrantzfeefb772015-02-18 14:58:49 -08003import (
Matt Rosencrantzec3b9502015-02-19 12:53:13 -08004 "signature"
Matt Rosencrantzfeefb772015-02-18 14:58:49 -08005 "time"
6
Jiri Simsa1f1302c2015-02-23 16:18:34 -08007 "v.io/v23/security"
Matt Rosencrantzfeefb772015-02-18 14:58:49 -08008)
9
Matt Rosencrantz786f7272015-02-11 15:18:07 -080010type Controller interface {
Matt Rosencrantzfeefb772015-02-18 14:58:49 -080011 // Serve instructs WSPR to start listening for calls on behalf
12 // of a javascript server.
13 Serve(name string, serverId uint32) error
14 // Stop instructs WSPR to stop listening for calls for the
15 // given javascript server.
16 Stop(serverId uint32) error
17 // AddName adds a published name to an existing server.
18 AddName(serverId uint32, name string) error
19 // RemoveName removes a published name from an existing server.
20 RemoveName(serverId uint32, name string) error
21
22 // UnlinkJSBlessings removes the given blessings from the blessings store.
23 UnlinkJSBlessings(handle int32) error
24 // BlessPublicKey creates a new blessing.
25 BlessPublicKey(fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string | error)
26 // CreateBlessings creates a new principal self-blessed with the given extension.
27 CreateBlessings(extension string) (handle int32, publicKey string | error)
Matt Rosencrantzec3b9502015-02-19 12:53:13 -080028
29 // RemoteBlessings fetches the remote blessings for a given name and method.
30 RemoteBlessings(name, method string) ([]string | error)
31 // Signature fetches the signature for a given name.
32 Signature(name string) ([]signature.Interface | error)
Matt Rosencrantz786f7272015-02-11 15:18:07 -080033}