| // This file was auto-generated by the veyron vdl tool. |
| // Source: identity.vdl |
| |
| // Package identity defines services for identity providers in the veyron ecosystem. |
| package identity |
| |
| import ( |
| "v.io/core/veyron2/security" |
| |
| // The non-user imports are prefixed with "__" to prevent collisions. |
| __veyron2 "v.io/core/veyron2" |
| __context "v.io/core/veyron2/context" |
| __ipc "v.io/core/veyron2/ipc" |
| __vdlutil "v.io/core/veyron2/vdl/vdlutil" |
| __wiretype "v.io/core/veyron2/wiretype" |
| ) |
| |
| // TODO(toddw): Remove this line once the new signature support is done. |
| // It corrects a bug where __wiretype is unused in VDL pacakges where only |
| // bootstrap types are used on interfaces. |
| const _ = __wiretype.TypeIDInvalid |
| |
| // OAuthBlesserClientMethods is the client interface |
| // containing OAuthBlesser methods. |
| // |
| // OAuthBlesser exchanges OAuth access tokens for |
| // an email address from an OAuth-based identity provider and uses the email |
| // address obtained to bless the client. |
| // |
| // OAuth is described in RFC 6749 (http://tools.ietf.org/html/rfc6749), |
| // though the Google implementation also has informative documentation at |
| // https://developers.google.com/accounts/docs/OAuth2 |
| // |
| // WARNING: There is no binding between the channel over which the access token |
| // was obtained (typically https) and the channel used to make the RPC (a |
| // veyron virtual circuit). |
| // Thus, if Mallory possesses the access token associated with Alice's account, |
| // she may be able to obtain a blessing with Alice's name on it. |
| type OAuthBlesserClientMethods interface { |
| // BlessUsingAccessToken uses the provided access token to obtain the email |
| // address and returns a blessing along with the email address. |
| BlessUsingAccessToken(ctx *__context.T, token string, opts ...__ipc.CallOpt) (blessing security.WireBlessings, email string, err error) |
| } |
| |
| // OAuthBlesserClientStub adds universal methods to OAuthBlesserClientMethods. |
| type OAuthBlesserClientStub interface { |
| OAuthBlesserClientMethods |
| __ipc.UniversalServiceMethods |
| } |
| |
| // OAuthBlesserClient returns a client stub for OAuthBlesser. |
| func OAuthBlesserClient(name string, opts ...__ipc.BindOpt) OAuthBlesserClientStub { |
| var client __ipc.Client |
| for _, opt := range opts { |
| if clientOpt, ok := opt.(__ipc.Client); ok { |
| client = clientOpt |
| } |
| } |
| return implOAuthBlesserClientStub{name, client} |
| } |
| |
| type implOAuthBlesserClientStub struct { |
| name string |
| client __ipc.Client |
| } |
| |
| func (c implOAuthBlesserClientStub) c(ctx *__context.T) __ipc.Client { |
| if c.client != nil { |
| return c.client |
| } |
| return __veyron2.RuntimeFromContext(ctx).Client() |
| } |
| |
| func (c implOAuthBlesserClientStub) BlessUsingAccessToken(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (o0 security.WireBlessings, o1 string, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessUsingAccessToken", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &o1, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implOAuthBlesserClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| // OAuthBlesserServerMethods is the interface a server writer |
| // implements for OAuthBlesser. |
| // |
| // OAuthBlesser exchanges OAuth access tokens for |
| // an email address from an OAuth-based identity provider and uses the email |
| // address obtained to bless the client. |
| // |
| // OAuth is described in RFC 6749 (http://tools.ietf.org/html/rfc6749), |
| // though the Google implementation also has informative documentation at |
| // https://developers.google.com/accounts/docs/OAuth2 |
| // |
| // WARNING: There is no binding between the channel over which the access token |
| // was obtained (typically https) and the channel used to make the RPC (a |
| // veyron virtual circuit). |
| // Thus, if Mallory possesses the access token associated with Alice's account, |
| // she may be able to obtain a blessing with Alice's name on it. |
| type OAuthBlesserServerMethods interface { |
| // BlessUsingAccessToken uses the provided access token to obtain the email |
| // address and returns a blessing along with the email address. |
| BlessUsingAccessToken(ctx __ipc.ServerContext, token string) (blessing security.WireBlessings, email string, err error) |
| } |
| |
| // OAuthBlesserServerStubMethods is the server interface containing |
| // OAuthBlesser methods, as expected by ipc.Server. |
| // There is no difference between this interface and OAuthBlesserServerMethods |
| // since there are no streaming methods. |
| type OAuthBlesserServerStubMethods OAuthBlesserServerMethods |
| |
| // OAuthBlesserServerStub adds universal methods to OAuthBlesserServerStubMethods. |
| type OAuthBlesserServerStub interface { |
| OAuthBlesserServerStubMethods |
| // Describe the OAuthBlesser interfaces. |
| Describe__() []__ipc.InterfaceDesc |
| // Signature will be replaced with Describe__. |
| Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) |
| } |
| |
| // OAuthBlesserServer returns a server stub for OAuthBlesser. |
| // It converts an implementation of OAuthBlesserServerMethods into |
| // an object that may be used by ipc.Server. |
| func OAuthBlesserServer(impl OAuthBlesserServerMethods) OAuthBlesserServerStub { |
| stub := implOAuthBlesserServerStub{ |
| 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 := __ipc.NewGlobState(stub); gs != nil { |
| stub.gs = gs |
| } else if gs := __ipc.NewGlobState(impl); gs != nil { |
| stub.gs = gs |
| } |
| return stub |
| } |
| |
| type implOAuthBlesserServerStub struct { |
| impl OAuthBlesserServerMethods |
| gs *__ipc.GlobState |
| } |
| |
| func (s implOAuthBlesserServerStub) BlessUsingAccessToken(ctx __ipc.ServerContext, i0 string) (security.WireBlessings, string, error) { |
| return s.impl.BlessUsingAccessToken(ctx, i0) |
| } |
| |
| func (s implOAuthBlesserServerStub) Globber() *__ipc.GlobState { |
| return s.gs |
| } |
| |
| func (s implOAuthBlesserServerStub) Describe__() []__ipc.InterfaceDesc { |
| return []__ipc.InterfaceDesc{OAuthBlesserDesc} |
| } |
| |
| // OAuthBlesserDesc describes the OAuthBlesser interface. |
| var OAuthBlesserDesc __ipc.InterfaceDesc = descOAuthBlesser |
| |
| // descOAuthBlesser hides the desc to keep godoc clean. |
| var descOAuthBlesser = __ipc.InterfaceDesc{ |
| Name: "OAuthBlesser", |
| PkgPath: "v.io/core/veyron/services/identity", |
| 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.", |
| Methods: []__ipc.MethodDesc{ |
| { |
| Name: "BlessUsingAccessToken", |
| Doc: "// BlessUsingAccessToken uses the provided access token to obtain the email\n// address and returns a blessing along with the email address.", |
| InArgs: []__ipc.ArgDesc{ |
| {"token", ``}, // string |
| }, |
| OutArgs: []__ipc.ArgDesc{ |
| {"blessing", ``}, // security.WireBlessings |
| {"email", ``}, // string |
| {"err", ``}, // error |
| }, |
| }, |
| }, |
| } |
| |
| func (s implOAuthBlesserServerStub) Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) { |
| // TODO(toddw): Replace with new Describe__ implementation. |
| result := __ipc.ServiceSignature{Methods: make(map[string]__ipc.MethodSignature)} |
| result.Methods["BlessUsingAccessToken"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "token", Type: 3}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "blessing", Type: 74}, |
| {Name: "email", Type: 3}, |
| {Name: "err", Type: 75}, |
| }, |
| } |
| |
| result.TypeDefs = []__vdlutil.Any{ |
| __wiretype.NamedPrimitiveType{Type: 0x32, Name: "byte", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x41, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x42, Name: "ValidatorVOM"}, |
| }, |
| "v.io/core/veyron2/security.Caveat", []string(nil)}, |
| __wiretype.SliceType{Elem: 0x43, Name: "", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "v.io/core/veyron2/security.Hash", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x42, Name: "Purpose"}, |
| __wiretype.FieldType{Type: 0x45, Name: "Hash"}, |
| __wiretype.FieldType{Type: 0x42, Name: "R"}, |
| __wiretype.FieldType{Type: 0x42, Name: "S"}, |
| }, |
| "v.io/core/veyron2/security.Signature", []string(nil)}, |
| __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x3, Name: "Extension"}, |
| __wiretype.FieldType{Type: 0x42, Name: "PublicKey"}, |
| __wiretype.FieldType{Type: 0x44, Name: "Caveats"}, |
| __wiretype.FieldType{Type: 0x46, Name: "Signature"}, |
| }, |
| "v.io/core/veyron2/security.Certificate", []string(nil)}, |
| __wiretype.SliceType{Elem: 0x47, Name: "", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x48, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x49, Name: "CertificateChains"}, |
| }, |
| "v.io/core/veyron2/security.WireBlessings", []string(nil)}, |
| __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}} |
| |
| return result, nil |
| } |
| |
| // MacaroonBlesserClientMethods is the client interface |
| // containing MacaroonBlesser methods. |
| // |
| // MacaroonBlesser returns a blessing given the provided macaroon string. |
| type MacaroonBlesserClientMethods interface { |
| // Bless uses the provided macaroon (which contains email and caveats) |
| // to return a blessing for the client. |
| Bless(ctx *__context.T, macaroon string, opts ...__ipc.CallOpt) (blessing security.WireBlessings, err error) |
| } |
| |
| // MacaroonBlesserClientStub adds universal methods to MacaroonBlesserClientMethods. |
| type MacaroonBlesserClientStub interface { |
| MacaroonBlesserClientMethods |
| __ipc.UniversalServiceMethods |
| } |
| |
| // MacaroonBlesserClient returns a client stub for MacaroonBlesser. |
| func MacaroonBlesserClient(name string, opts ...__ipc.BindOpt) MacaroonBlesserClientStub { |
| var client __ipc.Client |
| for _, opt := range opts { |
| if clientOpt, ok := opt.(__ipc.Client); ok { |
| client = clientOpt |
| } |
| } |
| return implMacaroonBlesserClientStub{name, client} |
| } |
| |
| type implMacaroonBlesserClientStub struct { |
| name string |
| client __ipc.Client |
| } |
| |
| func (c implMacaroonBlesserClientStub) c(ctx *__context.T) __ipc.Client { |
| if c.client != nil { |
| return c.client |
| } |
| return __veyron2.RuntimeFromContext(ctx).Client() |
| } |
| |
| func (c implMacaroonBlesserClientStub) Bless(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (o0 security.WireBlessings, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "Bless", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implMacaroonBlesserClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| // MacaroonBlesserServerMethods is the interface a server writer |
| // implements for MacaroonBlesser. |
| // |
| // MacaroonBlesser returns a blessing given the provided macaroon string. |
| type MacaroonBlesserServerMethods interface { |
| // Bless uses the provided macaroon (which contains email and caveats) |
| // to return a blessing for the client. |
| Bless(ctx __ipc.ServerContext, macaroon string) (blessing security.WireBlessings, err error) |
| } |
| |
| // MacaroonBlesserServerStubMethods is the server interface containing |
| // MacaroonBlesser methods, as expected by ipc.Server. |
| // There is no difference between this interface and MacaroonBlesserServerMethods |
| // since there are no streaming methods. |
| type MacaroonBlesserServerStubMethods MacaroonBlesserServerMethods |
| |
| // MacaroonBlesserServerStub adds universal methods to MacaroonBlesserServerStubMethods. |
| type MacaroonBlesserServerStub interface { |
| MacaroonBlesserServerStubMethods |
| // Describe the MacaroonBlesser interfaces. |
| Describe__() []__ipc.InterfaceDesc |
| // Signature will be replaced with Describe__. |
| Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) |
| } |
| |
| // MacaroonBlesserServer returns a server stub for MacaroonBlesser. |
| // It converts an implementation of MacaroonBlesserServerMethods into |
| // an object that may be used by ipc.Server. |
| func MacaroonBlesserServer(impl MacaroonBlesserServerMethods) MacaroonBlesserServerStub { |
| stub := implMacaroonBlesserServerStub{ |
| 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 := __ipc.NewGlobState(stub); gs != nil { |
| stub.gs = gs |
| } else if gs := __ipc.NewGlobState(impl); gs != nil { |
| stub.gs = gs |
| } |
| return stub |
| } |
| |
| type implMacaroonBlesserServerStub struct { |
| impl MacaroonBlesserServerMethods |
| gs *__ipc.GlobState |
| } |
| |
| func (s implMacaroonBlesserServerStub) Bless(ctx __ipc.ServerContext, i0 string) (security.WireBlessings, error) { |
| return s.impl.Bless(ctx, i0) |
| } |
| |
| func (s implMacaroonBlesserServerStub) Globber() *__ipc.GlobState { |
| return s.gs |
| } |
| |
| func (s implMacaroonBlesserServerStub) Describe__() []__ipc.InterfaceDesc { |
| return []__ipc.InterfaceDesc{MacaroonBlesserDesc} |
| } |
| |
| // MacaroonBlesserDesc describes the MacaroonBlesser interface. |
| var MacaroonBlesserDesc __ipc.InterfaceDesc = descMacaroonBlesser |
| |
| // descMacaroonBlesser hides the desc to keep godoc clean. |
| var descMacaroonBlesser = __ipc.InterfaceDesc{ |
| Name: "MacaroonBlesser", |
| PkgPath: "v.io/core/veyron/services/identity", |
| Doc: "// MacaroonBlesser returns a blessing given the provided macaroon string.", |
| Methods: []__ipc.MethodDesc{ |
| { |
| Name: "Bless", |
| Doc: "// Bless uses the provided macaroon (which contains email and caveats)\n// to return a blessing for the client.", |
| InArgs: []__ipc.ArgDesc{ |
| {"macaroon", ``}, // string |
| }, |
| OutArgs: []__ipc.ArgDesc{ |
| {"blessing", ``}, // security.WireBlessings |
| {"err", ``}, // error |
| }, |
| }, |
| }, |
| } |
| |
| func (s implMacaroonBlesserServerStub) Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) { |
| // TODO(toddw): Replace with new Describe__ implementation. |
| result := __ipc.ServiceSignature{Methods: make(map[string]__ipc.MethodSignature)} |
| result.Methods["Bless"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "macaroon", Type: 3}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "blessing", Type: 74}, |
| {Name: "err", Type: 75}, |
| }, |
| } |
| |
| result.TypeDefs = []__vdlutil.Any{ |
| __wiretype.NamedPrimitiveType{Type: 0x32, Name: "byte", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x41, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x42, Name: "ValidatorVOM"}, |
| }, |
| "v.io/core/veyron2/security.Caveat", []string(nil)}, |
| __wiretype.SliceType{Elem: 0x43, Name: "", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "v.io/core/veyron2/security.Hash", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x42, Name: "Purpose"}, |
| __wiretype.FieldType{Type: 0x45, Name: "Hash"}, |
| __wiretype.FieldType{Type: 0x42, Name: "R"}, |
| __wiretype.FieldType{Type: 0x42, Name: "S"}, |
| }, |
| "v.io/core/veyron2/security.Signature", []string(nil)}, |
| __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x3, Name: "Extension"}, |
| __wiretype.FieldType{Type: 0x42, Name: "PublicKey"}, |
| __wiretype.FieldType{Type: 0x44, Name: "Caveats"}, |
| __wiretype.FieldType{Type: 0x46, Name: "Signature"}, |
| }, |
| "v.io/core/veyron2/security.Certificate", []string(nil)}, |
| __wiretype.SliceType{Elem: 0x47, Name: "", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x48, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x49, Name: "CertificateChains"}, |
| }, |
| "v.io/core/veyron2/security.WireBlessings", []string(nil)}, |
| __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}} |
| |
| return result, nil |
| } |