blob: 97d99971a7fce8333154a7a86d795cae6d64e1fc [file] [log] [blame]
Asim Shankar61071792014-07-22 13:03:18 -07001// This file was auto-generated by the veyron vdl tool.
2// Source: identity.vdl
3
4// Package identity defines services for identity providers in the veyron ecosystem.
5package identity
6
7import (
Jiri Simsa764efb72014-12-25 20:57:03 -08008 "v.io/core/veyron2/security"
Asim Shankarb3a82ba2014-10-29 11:41:27 -07009
Todd Wang702385a2014-11-07 01:54:08 -080010 // The non-user imports are prefixed with "__" to prevent collisions.
Jiri Simsa764efb72014-12-25 20:57:03 -080011 __veyron2 "v.io/core/veyron2"
12 __context "v.io/core/veyron2/context"
13 __ipc "v.io/core/veyron2/ipc"
Asim Shankar61071792014-07-22 13:03:18 -070014)
15
Todd Wang702385a2014-11-07 01:54:08 -080016// OAuthBlesserClientMethods is the client interface
17// containing OAuthBlesser methods.
18//
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -070019// OAuthBlesser exchanges OAuth access tokens for
Asim Shankar7a721752014-08-02 14:27:23 -070020// an email address from an OAuth-based identity provider and uses the email
21// address obtained to bless the client.
Asim Shankar61071792014-07-22 13:03:18 -070022//
Asim Shankar7a721752014-08-02 14:27:23 -070023// OAuth is described in RFC 6749 (http://tools.ietf.org/html/rfc6749),
24// though the Google implementation also has informative documentation at
25// https://developers.google.com/accounts/docs/OAuth2
26//
Nicolas LaCasse057eeda2014-10-03 13:39:15 -070027// WARNING: There is no binding between the channel over which the access token
28// was obtained (typically https) and the channel used to make the RPC (a
29// veyron virtual circuit).
30// Thus, if Mallory possesses the access token associated with Alice's account,
31// she may be able to obtain a blessing with Alice's name on it.
Todd Wang702385a2014-11-07 01:54:08 -080032type OAuthBlesserClientMethods interface {
Asim Shankar7a721752014-08-02 14:27:23 -070033 // BlessUsingAccessToken uses the provided access token to obtain the email
Ankur3c33d422014-10-09 11:53:25 -070034 // address and returns a blessing along with the email address.
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -080035 BlessUsingAccessToken(ctx *__context.T, token string, opts ...__ipc.CallOpt) (blessing security.WireBlessings, email string, err error)
Asim Shankar61071792014-07-22 13:03:18 -070036}
37
Todd Wang702385a2014-11-07 01:54:08 -080038// OAuthBlesserClientStub adds universal methods to OAuthBlesserClientMethods.
39type OAuthBlesserClientStub interface {
40 OAuthBlesserClientMethods
41 __ipc.UniversalServiceMethods
Asim Shankar61071792014-07-22 13:03:18 -070042}
43
Todd Wang702385a2014-11-07 01:54:08 -080044// OAuthBlesserClient returns a client stub for OAuthBlesser.
45func OAuthBlesserClient(name string, opts ...__ipc.BindOpt) OAuthBlesserClientStub {
46 var client __ipc.Client
47 for _, opt := range opts {
48 if clientOpt, ok := opt.(__ipc.Client); ok {
Matt Rosencrantzbf85d542014-08-22 13:31:14 -070049 client = clientOpt
Asim Shankar61071792014-07-22 13:03:18 -070050 }
Asim Shankar61071792014-07-22 13:03:18 -070051 }
Todd Wang702385a2014-11-07 01:54:08 -080052 return implOAuthBlesserClientStub{name, client}
Asim Shankar61071792014-07-22 13:03:18 -070053}
54
Todd Wang702385a2014-11-07 01:54:08 -080055type implOAuthBlesserClientStub struct {
56 name string
57 client __ipc.Client
58}
59
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -080060func (c implOAuthBlesserClientStub) c(ctx *__context.T) __ipc.Client {
Todd Wang702385a2014-11-07 01:54:08 -080061 if c.client != nil {
62 return c.client
63 }
Suharsh Sivakumarbe80c1b2015-01-07 18:51:16 -080064 return __veyron2.GetClient(ctx)
Todd Wang702385a2014-11-07 01:54:08 -080065}
66
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -080067func (c implOAuthBlesserClientStub) BlessUsingAccessToken(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (o0 security.WireBlessings, o1 string, err error) {
Todd Wang702385a2014-11-07 01:54:08 -080068 var call __ipc.Call
69 if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessUsingAccessToken", []interface{}{i0}, opts...); err != nil {
70 return
71 }
72 if ierr := call.Finish(&o0, &o1, &err); ierr != nil {
73 err = ierr
74 }
75 return
76}
77
Todd Wang702385a2014-11-07 01:54:08 -080078// OAuthBlesserServerMethods is the interface a server writer
79// implements for OAuthBlesser.
Asim Shankar61071792014-07-22 13:03:18 -070080//
Todd Wang702385a2014-11-07 01:54:08 -080081// OAuthBlesser exchanges OAuth access tokens for
82// an email address from an OAuth-based identity provider and uses the email
83// address obtained to bless the client.
84//
85// OAuth is described in RFC 6749 (http://tools.ietf.org/html/rfc6749),
86// though the Google implementation also has informative documentation at
87// https://developers.google.com/accounts/docs/OAuth2
88//
89// WARNING: There is no binding between the channel over which the access token
90// was obtained (typically https) and the channel used to make the RPC (a
91// veyron virtual circuit).
92// Thus, if Mallory possesses the access token associated with Alice's account,
93// she may be able to obtain a blessing with Alice's name on it.
94type OAuthBlesserServerMethods interface {
95 // BlessUsingAccessToken uses the provided access token to obtain the email
96 // address and returns a blessing along with the email address.
97 BlessUsingAccessToken(ctx __ipc.ServerContext, token string) (blessing security.WireBlessings, email string, err error)
98}
99
100// OAuthBlesserServerStubMethods is the server interface containing
Todd Wang1fe7cdd2014-11-12 12:51:49 -0800101// OAuthBlesser methods, as expected by ipc.Server.
102// There is no difference between this interface and OAuthBlesserServerMethods
103// since there are no streaming methods.
104type OAuthBlesserServerStubMethods OAuthBlesserServerMethods
Todd Wang702385a2014-11-07 01:54:08 -0800105
106// OAuthBlesserServerStub adds universal methods to OAuthBlesserServerStubMethods.
107type OAuthBlesserServerStub interface {
108 OAuthBlesserServerStubMethods
Todd Wang5739dda2014-11-16 22:44:02 -0800109 // Describe the OAuthBlesser interfaces.
110 Describe__() []__ipc.InterfaceDesc
Todd Wang702385a2014-11-07 01:54:08 -0800111}
112
113// OAuthBlesserServer returns a server stub for OAuthBlesser.
114// It converts an implementation of OAuthBlesserServerMethods into
115// an object that may be used by ipc.Server.
116func OAuthBlesserServer(impl OAuthBlesserServerMethods) OAuthBlesserServerStub {
117 stub := implOAuthBlesserServerStub{
118 impl: impl,
Asim Shankar61071792014-07-22 13:03:18 -0700119 }
Todd Wang702385a2014-11-07 01:54:08 -0800120 // Initialize GlobState; always check the stub itself first, to handle the
121 // case where the user has the Glob method defined in their VDL source.
122 if gs := __ipc.NewGlobState(stub); gs != nil {
123 stub.gs = gs
124 } else if gs := __ipc.NewGlobState(impl); gs != nil {
125 stub.gs = gs
Robin Thellend94bc4642014-11-05 18:05:08 -0800126 }
Robin Thellend94bc4642014-11-05 18:05:08 -0800127 return stub
Asim Shankar61071792014-07-22 13:03:18 -0700128}
129
Todd Wang702385a2014-11-07 01:54:08 -0800130type implOAuthBlesserServerStub struct {
131 impl OAuthBlesserServerMethods
132 gs *__ipc.GlobState
Matt Rosencrantzbf85d542014-08-22 13:31:14 -0700133}
134
Todd Wang1fe7cdd2014-11-12 12:51:49 -0800135func (s implOAuthBlesserServerStub) BlessUsingAccessToken(ctx __ipc.ServerContext, i0 string) (security.WireBlessings, string, error) {
136 return s.impl.BlessUsingAccessToken(ctx, i0)
Asim Shankar61071792014-07-22 13:03:18 -0700137}
138
Robin Thellend39ac3232014-12-02 09:50:41 -0800139func (s implOAuthBlesserServerStub) Globber() *__ipc.GlobState {
Todd Wang702385a2014-11-07 01:54:08 -0800140 return s.gs
Asim Shankar61071792014-07-22 13:03:18 -0700141}
142
Todd Wang5739dda2014-11-16 22:44:02 -0800143func (s implOAuthBlesserServerStub) Describe__() []__ipc.InterfaceDesc {
144 return []__ipc.InterfaceDesc{OAuthBlesserDesc}
145}
146
147// OAuthBlesserDesc describes the OAuthBlesser interface.
148var OAuthBlesserDesc __ipc.InterfaceDesc = descOAuthBlesser
149
150// descOAuthBlesser hides the desc to keep godoc clean.
151var descOAuthBlesser = __ipc.InterfaceDesc{
152 Name: "OAuthBlesser",
Jiri Simsa764efb72014-12-25 20:57:03 -0800153 PkgPath: "v.io/core/veyron/services/identity",
Todd Wang5739dda2014-11-16 22:44:02 -0800154 Doc: "// OAuthBlesser exchanges OAuth access tokens for\n// an email address from an OAuth-based identity provider and uses the email\n// address obtained to bless the client.\n//\n// OAuth is described in RFC 6749 (http://tools.ietf.org/html/rfc6749),\n// though the Google implementation also has informative documentation at\n// https://developers.google.com/accounts/docs/OAuth2\n//\n// WARNING: There is no binding between the channel over which the access token\n// was obtained (typically https) and the channel used to make the RPC (a\n// veyron virtual circuit).\n// Thus, if Mallory possesses the access token associated with Alice's account,\n// she may be able to obtain a blessing with Alice's name on it.",
155 Methods: []__ipc.MethodDesc{
156 {
157 Name: "BlessUsingAccessToken",
158 Doc: "// BlessUsingAccessToken uses the provided access token to obtain the email\n// address and returns a blessing along with the email address.",
159 InArgs: []__ipc.ArgDesc{
160 {"token", ``}, // string
161 },
162 OutArgs: []__ipc.ArgDesc{
163 {"blessing", ``}, // security.WireBlessings
164 {"email", ``}, // string
165 {"err", ``}, // error
166 },
167 },
168 },
Asim Shankar61071792014-07-22 13:03:18 -0700169}
170
Todd Wang702385a2014-11-07 01:54:08 -0800171// MacaroonBlesserClientMethods is the client interface
172// containing MacaroonBlesser methods.
173//
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700174// MacaroonBlesser returns a blessing given the provided macaroon string.
Todd Wang702385a2014-11-07 01:54:08 -0800175type MacaroonBlesserClientMethods interface {
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700176 // Bless uses the provided macaroon (which contains email and caveats)
177 // to return a blessing for the client.
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -0800178 Bless(ctx *__context.T, macaroon string, opts ...__ipc.CallOpt) (blessing security.WireBlessings, err error)
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700179}
180
Todd Wang702385a2014-11-07 01:54:08 -0800181// MacaroonBlesserClientStub adds universal methods to MacaroonBlesserClientMethods.
182type MacaroonBlesserClientStub interface {
183 MacaroonBlesserClientMethods
184 __ipc.UniversalServiceMethods
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700185}
186
Todd Wang702385a2014-11-07 01:54:08 -0800187// MacaroonBlesserClient returns a client stub for MacaroonBlesser.
188func MacaroonBlesserClient(name string, opts ...__ipc.BindOpt) MacaroonBlesserClientStub {
189 var client __ipc.Client
190 for _, opt := range opts {
191 if clientOpt, ok := opt.(__ipc.Client); ok {
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700192 client = clientOpt
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700193 }
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700194 }
Todd Wang702385a2014-11-07 01:54:08 -0800195 return implMacaroonBlesserClientStub{name, client}
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700196}
197
Todd Wang702385a2014-11-07 01:54:08 -0800198type implMacaroonBlesserClientStub struct {
199 name string
200 client __ipc.Client
201}
202
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -0800203func (c implMacaroonBlesserClientStub) c(ctx *__context.T) __ipc.Client {
Todd Wang702385a2014-11-07 01:54:08 -0800204 if c.client != nil {
205 return c.client
206 }
Suharsh Sivakumarbe80c1b2015-01-07 18:51:16 -0800207 return __veyron2.GetClient(ctx)
Todd Wang702385a2014-11-07 01:54:08 -0800208}
209
Matt Rosencrantz4f8ac602014-12-29 14:42:48 -0800210func (c implMacaroonBlesserClientStub) Bless(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (o0 security.WireBlessings, err error) {
Todd Wang702385a2014-11-07 01:54:08 -0800211 var call __ipc.Call
212 if call, err = c.c(ctx).StartCall(ctx, c.name, "Bless", []interface{}{i0}, opts...); err != nil {
213 return
214 }
215 if ierr := call.Finish(&o0, &err); ierr != nil {
216 err = ierr
217 }
218 return
219}
220
Todd Wang702385a2014-11-07 01:54:08 -0800221// MacaroonBlesserServerMethods is the interface a server writer
222// implements for MacaroonBlesser.
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700223//
Todd Wang702385a2014-11-07 01:54:08 -0800224// MacaroonBlesser returns a blessing given the provided macaroon string.
225type MacaroonBlesserServerMethods interface {
226 // Bless uses the provided macaroon (which contains email and caveats)
227 // to return a blessing for the client.
228 Bless(ctx __ipc.ServerContext, macaroon string) (blessing security.WireBlessings, err error)
229}
230
231// MacaroonBlesserServerStubMethods is the server interface containing
Todd Wang1fe7cdd2014-11-12 12:51:49 -0800232// MacaroonBlesser methods, as expected by ipc.Server.
233// There is no difference between this interface and MacaroonBlesserServerMethods
234// since there are no streaming methods.
235type MacaroonBlesserServerStubMethods MacaroonBlesserServerMethods
Todd Wang702385a2014-11-07 01:54:08 -0800236
237// MacaroonBlesserServerStub adds universal methods to MacaroonBlesserServerStubMethods.
238type MacaroonBlesserServerStub interface {
239 MacaroonBlesserServerStubMethods
Todd Wang5739dda2014-11-16 22:44:02 -0800240 // Describe the MacaroonBlesser interfaces.
241 Describe__() []__ipc.InterfaceDesc
Todd Wang702385a2014-11-07 01:54:08 -0800242}
243
244// MacaroonBlesserServer returns a server stub for MacaroonBlesser.
245// It converts an implementation of MacaroonBlesserServerMethods into
246// an object that may be used by ipc.Server.
247func MacaroonBlesserServer(impl MacaroonBlesserServerMethods) MacaroonBlesserServerStub {
248 stub := implMacaroonBlesserServerStub{
249 impl: impl,
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700250 }
Todd Wang702385a2014-11-07 01:54:08 -0800251 // Initialize GlobState; always check the stub itself first, to handle the
252 // case where the user has the Glob method defined in their VDL source.
253 if gs := __ipc.NewGlobState(stub); gs != nil {
254 stub.gs = gs
255 } else if gs := __ipc.NewGlobState(impl); gs != nil {
256 stub.gs = gs
Robin Thellend94bc4642014-11-05 18:05:08 -0800257 }
Robin Thellend94bc4642014-11-05 18:05:08 -0800258 return stub
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700259}
260
Todd Wang702385a2014-11-07 01:54:08 -0800261type implMacaroonBlesserServerStub struct {
262 impl MacaroonBlesserServerMethods
263 gs *__ipc.GlobState
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700264}
265
Todd Wang1fe7cdd2014-11-12 12:51:49 -0800266func (s implMacaroonBlesserServerStub) Bless(ctx __ipc.ServerContext, i0 string) (security.WireBlessings, error) {
267 return s.impl.Bless(ctx, i0)
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700268}
269
Robin Thellend39ac3232014-12-02 09:50:41 -0800270func (s implMacaroonBlesserServerStub) Globber() *__ipc.GlobState {
Todd Wang702385a2014-11-07 01:54:08 -0800271 return s.gs
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700272}
273
Todd Wang5739dda2014-11-16 22:44:02 -0800274func (s implMacaroonBlesserServerStub) Describe__() []__ipc.InterfaceDesc {
275 return []__ipc.InterfaceDesc{MacaroonBlesserDesc}
276}
277
278// MacaroonBlesserDesc describes the MacaroonBlesser interface.
279var MacaroonBlesserDesc __ipc.InterfaceDesc = descMacaroonBlesser
280
281// descMacaroonBlesser hides the desc to keep godoc clean.
282var descMacaroonBlesser = __ipc.InterfaceDesc{
283 Name: "MacaroonBlesser",
Jiri Simsa764efb72014-12-25 20:57:03 -0800284 PkgPath: "v.io/core/veyron/services/identity",
Todd Wang5739dda2014-11-16 22:44:02 -0800285 Doc: "// MacaroonBlesser returns a blessing given the provided macaroon string.",
286 Methods: []__ipc.MethodDesc{
287 {
288 Name: "Bless",
289 Doc: "// Bless uses the provided macaroon (which contains email and caveats)\n// to return a blessing for the client.",
290 InArgs: []__ipc.ArgDesc{
291 {"macaroon", ``}, // string
292 },
293 OutArgs: []__ipc.ArgDesc{
294 {"blessing", ``}, // security.WireBlessings
295 {"err", ``}, // error
296 },
297 },
298 },
Suharsh Sivakumard308c7e2014-10-03 12:46:50 -0700299}