forked from grailbio/base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
identity.vdl.go
369 lines (317 loc) · 12.4 KB
/
identity.vdl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
// This file was auto-generated by the vanadium vdl tool.
// Package: identity
// Package identity defines interfaces for Vanadium identity providers.
//nolint:golint
package identity
import (
v23 "v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
"v.io/v23/security"
"v.io/v23/security/access"
"v.io/v23/vdl"
)
var _ = initializeVDL() // Must be first; see initializeVDL comments for details.
// Interface definitions
// =====================
// Ec2BlesserClientMethods is the client interface
// containing Ec2Blesser methods.
//
// Ec2Blesser returns a blessing given the provided EC2 instance identity
// document.
type Ec2BlesserClientMethods interface {
// BlessEc2 uses the provided EC2 instance identity document in PKCS#7
// format to return a blessing to the client.
BlessEc2(_ *context.T, pkcs7b64 string, _ ...rpc.CallOpt) (blessing security.Blessings, _ error)
}
// Ec2BlesserClientStub embeds Ec2BlesserClientMethods and is a
// placeholder for additional management operations.
type Ec2BlesserClientStub interface {
Ec2BlesserClientMethods
}
// Ec2BlesserClient returns a client stub for Ec2Blesser.
func Ec2BlesserClient(name string) Ec2BlesserClientStub {
return implEc2BlesserClientStub{name}
}
type implEc2BlesserClientStub struct {
name string
}
func (c implEc2BlesserClientStub) BlessEc2(ctx *context.T, i0 string, opts ...rpc.CallOpt) (o0 security.Blessings, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "BlessEc2", []interface{}{i0}, []interface{}{&o0}, opts...)
return
}
// Ec2BlesserServerMethods is the interface a server writer
// implements for Ec2Blesser.
//
// Ec2Blesser returns a blessing given the provided EC2 instance identity
// document.
type Ec2BlesserServerMethods interface {
// BlessEc2 uses the provided EC2 instance identity document in PKCS#7
// format to return a blessing to the client.
BlessEc2(_ *context.T, _ rpc.ServerCall, pkcs7b64 string) (blessing security.Blessings, _ error)
}
// Ec2BlesserServerStubMethods is the server interface containing
// Ec2Blesser methods, as expected by rpc.Server.
// There is no difference between this interface and Ec2BlesserServerMethods
// since there are no streaming methods.
type Ec2BlesserServerStubMethods Ec2BlesserServerMethods
// Ec2BlesserServerStub adds universal methods to Ec2BlesserServerStubMethods.
type Ec2BlesserServerStub interface {
Ec2BlesserServerStubMethods
// DescribeInterfaces the Ec2Blesser interfaces.
Describe__() []rpc.InterfaceDesc
}
// Ec2BlesserServer returns a server stub for Ec2Blesser.
// It converts an implementation of Ec2BlesserServerMethods into
// an object that may be used by rpc.Server.
func Ec2BlesserServer(impl Ec2BlesserServerMethods) Ec2BlesserServerStub {
stub := implEc2BlesserServerStub{
impl: impl,
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := rpc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := rpc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implEc2BlesserServerStub struct {
impl Ec2BlesserServerMethods
gs *rpc.GlobState
}
func (s implEc2BlesserServerStub) BlessEc2(ctx *context.T, call rpc.ServerCall, i0 string) (security.Blessings, error) {
return s.impl.BlessEc2(ctx, call, i0)
}
func (s implEc2BlesserServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implEc2BlesserServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{Ec2BlesserDesc}
}
// Ec2BlesserDesc describes the Ec2Blesser interface.
var Ec2BlesserDesc rpc.InterfaceDesc = descEc2Blesser
// descEc2Blesser hides the desc to keep godoc clean.
var descEc2Blesser = rpc.InterfaceDesc{
Name: "Ec2Blesser",
PkgPath: "github.com/Schaudge/grailbase/security/identity",
Doc: "// Ec2Blesser returns a blessing given the provided EC2 instance identity\n// document.",
Methods: []rpc.MethodDesc{
{
Name: "BlessEc2",
Doc: "// BlessEc2 uses the provided EC2 instance identity document in PKCS#7\n// format to return a blessing to the client.",
InArgs: []rpc.ArgDesc{
{Name: "pkcs7b64", Doc: ``}, // string
},
OutArgs: []rpc.ArgDesc{
{Name: "blessing", Doc: ``}, // security.Blessings
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
},
},
}
// GoogleBlesserClientMethods is the client interface
// containing GoogleBlesser methods.
//
// GoogleBlesser returns a blessing giving the provided Google ID token.
type GoogleBlesserClientMethods interface {
BlessGoogle(_ *context.T, idToken string, _ ...rpc.CallOpt) (blessing security.Blessings, _ error)
}
// GoogleBlesserClientStub embeds GoogleBlesserClientMethods and is a
// placeholder for additional management operations.
type GoogleBlesserClientStub interface {
GoogleBlesserClientMethods
}
// GoogleBlesserClient returns a client stub for GoogleBlesser.
func GoogleBlesserClient(name string) GoogleBlesserClientStub {
return implGoogleBlesserClientStub{name}
}
type implGoogleBlesserClientStub struct {
name string
}
func (c implGoogleBlesserClientStub) BlessGoogle(ctx *context.T, i0 string, opts ...rpc.CallOpt) (o0 security.Blessings, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "BlessGoogle", []interface{}{i0}, []interface{}{&o0}, opts...)
return
}
// GoogleBlesserServerMethods is the interface a server writer
// implements for GoogleBlesser.
//
// GoogleBlesser returns a blessing giving the provided Google ID token.
type GoogleBlesserServerMethods interface {
BlessGoogle(_ *context.T, _ rpc.ServerCall, idToken string) (blessing security.Blessings, _ error)
}
// GoogleBlesserServerStubMethods is the server interface containing
// GoogleBlesser methods, as expected by rpc.Server.
// There is no difference between this interface and GoogleBlesserServerMethods
// since there are no streaming methods.
type GoogleBlesserServerStubMethods GoogleBlesserServerMethods
// GoogleBlesserServerStub adds universal methods to GoogleBlesserServerStubMethods.
type GoogleBlesserServerStub interface {
GoogleBlesserServerStubMethods
// DescribeInterfaces the GoogleBlesser interfaces.
Describe__() []rpc.InterfaceDesc
}
// GoogleBlesserServer returns a server stub for GoogleBlesser.
// It converts an implementation of GoogleBlesserServerMethods into
// an object that may be used by rpc.Server.
func GoogleBlesserServer(impl GoogleBlesserServerMethods) GoogleBlesserServerStub {
stub := implGoogleBlesserServerStub{
impl: impl,
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := rpc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := rpc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implGoogleBlesserServerStub struct {
impl GoogleBlesserServerMethods
gs *rpc.GlobState
}
func (s implGoogleBlesserServerStub) BlessGoogle(ctx *context.T, call rpc.ServerCall, i0 string) (security.Blessings, error) {
return s.impl.BlessGoogle(ctx, call, i0)
}
func (s implGoogleBlesserServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implGoogleBlesserServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{GoogleBlesserDesc}
}
// GoogleBlesserDesc describes the GoogleBlesser interface.
var GoogleBlesserDesc rpc.InterfaceDesc = descGoogleBlesser
// descGoogleBlesser hides the desc to keep godoc clean.
var descGoogleBlesser = rpc.InterfaceDesc{
Name: "GoogleBlesser",
PkgPath: "github.com/Schaudge/grailbase/security/identity",
Doc: "// GoogleBlesser returns a blessing giving the provided Google ID token.",
Methods: []rpc.MethodDesc{
{
Name: "BlessGoogle",
InArgs: []rpc.ArgDesc{
{Name: "idToken", Doc: ``}, // string
},
OutArgs: []rpc.ArgDesc{
{Name: "blessing", Doc: ``}, // security.Blessings
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
},
},
}
// K8sBlesserClientMethods is the client interface
// containing K8sBlesser methods.
//
// K8sBlesser returns a blessing giving the provided Kubernetes service accountop token.
type K8sBlesserClientMethods interface {
BlessK8s(_ *context.T, caCrt string, namespace string, token string, region string, _ ...rpc.CallOpt) (blessing security.Blessings, _ error)
}
// K8sBlesserClientStub embeds K8sBlesserClientMethods and is a
// placeholder for additional management operations.
type K8sBlesserClientStub interface {
K8sBlesserClientMethods
}
// K8sBlesserClient returns a client stub for K8sBlesser.
func K8sBlesserClient(name string) K8sBlesserClientStub {
return implK8sBlesserClientStub{name}
}
type implK8sBlesserClientStub struct {
name string
}
func (c implK8sBlesserClientStub) BlessK8s(ctx *context.T, i0 string, i1 string, i2 string, i3 string, opts ...rpc.CallOpt) (o0 security.Blessings, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "BlessK8s", []interface{}{i0, i1, i2, i3}, []interface{}{&o0}, opts...)
return
}
// K8sBlesserServerMethods is the interface a server writer
// implements for K8sBlesser.
//
// K8sBlesser returns a blessing giving the provided Kubernetes service accountop token.
type K8sBlesserServerMethods interface {
BlessK8s(_ *context.T, _ rpc.ServerCall, caCrt string, namespace string, token string, region string) (blessing security.Blessings, _ error)
}
// K8sBlesserServerStubMethods is the server interface containing
// K8sBlesser methods, as expected by rpc.Server.
// There is no difference between this interface and K8sBlesserServerMethods
// since there are no streaming methods.
type K8sBlesserServerStubMethods K8sBlesserServerMethods
// K8sBlesserServerStub adds universal methods to K8sBlesserServerStubMethods.
type K8sBlesserServerStub interface {
K8sBlesserServerStubMethods
// DescribeInterfaces the K8sBlesser interfaces.
Describe__() []rpc.InterfaceDesc
}
// K8sBlesserServer returns a server stub for K8sBlesser.
// It converts an implementation of K8sBlesserServerMethods into
// an object that may be used by rpc.Server.
func K8sBlesserServer(impl K8sBlesserServerMethods) K8sBlesserServerStub {
stub := implK8sBlesserServerStub{
impl: impl,
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := rpc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := rpc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implK8sBlesserServerStub struct {
impl K8sBlesserServerMethods
gs *rpc.GlobState
}
func (s implK8sBlesserServerStub) BlessK8s(ctx *context.T, call rpc.ServerCall, i0 string, i1 string, i2 string, i3 string) (security.Blessings, error) {
return s.impl.BlessK8s(ctx, call, i0, i1, i2, i3)
}
func (s implK8sBlesserServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implK8sBlesserServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{K8sBlesserDesc}
}
// K8sBlesserDesc describes the K8sBlesser interface.
var K8sBlesserDesc rpc.InterfaceDesc = descK8sBlesser
// descK8sBlesser hides the desc to keep godoc clean.
var descK8sBlesser = rpc.InterfaceDesc{
Name: "K8sBlesser",
PkgPath: "github.com/Schaudge/grailbase/security/identity",
Doc: "// K8sBlesser returns a blessing giving the provided Kubernetes service accountop token.",
Methods: []rpc.MethodDesc{
{
Name: "BlessK8s",
InArgs: []rpc.ArgDesc{
{Name: "caCrt", Doc: ``}, // string
{Name: "namespace", Doc: ``}, // string
{Name: "token", Doc: ``}, // string
{Name: "region", Doc: ``}, // string
},
OutArgs: []rpc.ArgDesc{
{Name: "blessing", Doc: ``}, // security.Blessings
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
},
},
}
var initializeVDLCalled bool
// initializeVDL performs vdl initialization. It is safe to call multiple times.
// If you have an init ordering issue, just insert the following line verbatim
// into your source files in this package, right after the "package foo" clause:
//
// var _ = initializeVDL()
//
// The purpose of this function is to ensure that vdl initialization occurs in
// the right order, and very early in the init sequence. In particular, vdl
// registration and package variable initialization needs to occur before
// functions like vdl.TypeOf will work properly.
//
// This function returns a dummy value, so that it can be used to initialize the
// first var in the file, to take advantage of Go's defined init order.
func initializeVDL() struct{} {
if initializeVDLCalled {
return struct{}{}
}
initializeVDLCalled = true
return struct{}{}
}