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