iam

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Overview

Package iam is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Iam_Login_FullMethodName  = "/vortexproto.iam.v1.Iam/Login"
	Iam_WhoAmI_FullMethodName = "/vortexproto.iam.v1.Iam/WhoAmI"
)

Variables

View Source
var File_iam_v1_iam_proto protoreflect.FileDescriptor
View Source
var Iam_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vortexproto.iam.v1.Iam",
	HandlerType: (*IamServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "WhoAmI",
			Handler:    _Iam_WhoAmI_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Login",
			Handler:       _Iam_Login_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "iam/v1/iam.proto",
}

Iam_ServiceDesc is the grpc.ServiceDesc for Iam service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterIamHandler

func RegisterIamHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterIamHandler registers the http handlers for service Iam to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterIamHandlerClient

func RegisterIamHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IamClient) error

RegisterIamHandlerClient registers the http handlers for service Iam to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IamClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IamClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "IamClient" to call the correct interceptors.

func RegisterIamHandlerFromEndpoint

func RegisterIamHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterIamHandlerFromEndpoint is same as RegisterIamHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterIamHandlerServer

func RegisterIamHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IamServer) error

RegisterIamHandlerServer registers the http handlers for service Iam to "mux". UnaryRPC :call IamServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIamHandlerFromEndpoint instead.

func RegisterIamServer

func RegisterIamServer(s grpc.ServiceRegistrar, srv IamServer)

Types

type ClientOptions

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type GrpcClient

type GrpcClient struct {
	IamClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)

NewClient returns a client connection to the 'vortex' service.

func (*GrpcClient) Close

func (c *GrpcClient) Close()

type IamClient

type IamClient interface {
	// Create an account for the Vortex Platform.
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (Iam_LoginClient, error)
	// Testing endpoint.
	WhoAmI(ctx context.Context, in *WhoAmIRequest, opts ...grpc.CallOption) (*WhoAmIResponse, error)
}

IamClient is the client API for Iam service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Iam service definition.

func NewIamClient

func NewIamClient(cc grpc.ClientConnInterface) IamClient

type IamServer

type IamServer interface {
	// Create an account for the Vortex Platform.
	Login(*LoginRequest, Iam_LoginServer) error
	// Testing endpoint.
	WhoAmI(context.Context, *WhoAmIRequest) (*WhoAmIResponse, error)
	// contains filtered or unexported methods
}

IamServer is the server API for Iam service. All implementations must embed UnimplementedIamServer for forward compatibility

Iam service definition.

type Iam_LoginClient added in v0.1.2

type Iam_LoginClient interface {
	Recv() (*LoginResponse, error)
	grpc.ClientStream
}

type Iam_LoginServer added in v0.1.2

type Iam_LoginServer interface {
	Send(*LoginResponse) error
	grpc.ServerStream
}

type LoginRequest

type LoginRequest struct {

	// Optional. If set, use to call user profile.
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	Id          string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Password    string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// Optional. If non-empty, do a device auth flow.
	DeviceAuth string `protobuf:"bytes,4,opt,name=device_auth,json=deviceAuth,proto3" json:"device_auth,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Login rpc.

func (*LoginRequest) Descriptor deprecated

func (*LoginRequest) Descriptor() ([]byte, []int)

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetAccessToken added in v0.1.2

func (x *LoginRequest) GetAccessToken() string

func (*LoginRequest) GetDeviceAuth added in v0.1.2

func (x *LoginRequest) GetDeviceAuth() string

func (*LoginRequest) GetId

func (x *LoginRequest) GetId() string

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

func (x *LoginRequest) ProtoReflect() protoreflect.Message

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

type LoginResponse

type LoginResponse struct {
	DeviceAuth  *LoginResponse_DeviceAuth `protobuf:"bytes,1,opt,name=device_auth,json=deviceAuth,proto3" json:"device_auth,omitempty"`
	AccessToken string                    `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	Status      *status.Status            `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Login rpc.

func (*LoginResponse) Descriptor deprecated

func (*LoginResponse) Descriptor() ([]byte, []int)

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetAccessToken added in v0.1.2

func (x *LoginResponse) GetAccessToken() string

func (*LoginResponse) GetDeviceAuth added in v0.1.2

func (x *LoginResponse) GetDeviceAuth() *LoginResponse_DeviceAuth

func (*LoginResponse) GetStatus added in v0.1.2

func (x *LoginResponse) GetStatus() *status.Status

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

func (x *LoginResponse) ProtoReflect() protoreflect.Message

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type LoginResponse_DeviceAuth added in v0.1.2

type LoginResponse_DeviceAuth struct {
	UserCode                string `protobuf:"bytes,1,opt,name=user_code,json=userCode,proto3" json:"user_code,omitempty"`
	VerificationUriComplete string `` /* 132-byte string literal not displayed */
	ExpiresIn               int64  `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse_DeviceAuth) Descriptor deprecated added in v0.1.2

func (*LoginResponse_DeviceAuth) Descriptor() ([]byte, []int)

Deprecated: Use LoginResponse_DeviceAuth.ProtoReflect.Descriptor instead.

func (*LoginResponse_DeviceAuth) GetExpiresIn added in v0.1.3

func (x *LoginResponse_DeviceAuth) GetExpiresIn() int64

func (*LoginResponse_DeviceAuth) GetUserCode added in v0.1.2

func (x *LoginResponse_DeviceAuth) GetUserCode() string

func (*LoginResponse_DeviceAuth) GetVerificationUriComplete added in v0.1.2

func (x *LoginResponse_DeviceAuth) GetVerificationUriComplete() string

func (*LoginResponse_DeviceAuth) ProtoMessage added in v0.1.2

func (*LoginResponse_DeviceAuth) ProtoMessage()

func (*LoginResponse_DeviceAuth) ProtoReflect added in v0.1.2

func (x *LoginResponse_DeviceAuth) ProtoReflect() protoreflect.Message

func (*LoginResponse_DeviceAuth) Reset added in v0.1.2

func (x *LoginResponse_DeviceAuth) Reset()

func (*LoginResponse_DeviceAuth) String added in v0.1.2

func (x *LoginResponse_DeviceAuth) String() string

type UnimplementedIamServer

type UnimplementedIamServer struct {
}

UnimplementedIamServer must be embedded to have forward compatible implementations.

func (UnimplementedIamServer) Login

func (UnimplementedIamServer) WhoAmI

type UnsafeIamServer

type UnsafeIamServer interface {
	// contains filtered or unexported methods
}

UnsafeIamServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IamServer will result in compilation errors.

type WhoAmIRequest

type WhoAmIRequest struct {
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// contains filtered or unexported fields
}

Request message for the WhoAmI rpc.

func (*WhoAmIRequest) Descriptor deprecated

func (*WhoAmIRequest) Descriptor() ([]byte, []int)

Deprecated: Use WhoAmIRequest.ProtoReflect.Descriptor instead.

func (*WhoAmIRequest) GetAccessToken added in v0.1.5

func (x *WhoAmIRequest) GetAccessToken() string

func (*WhoAmIRequest) ProtoMessage

func (*WhoAmIRequest) ProtoMessage()

func (*WhoAmIRequest) ProtoReflect

func (x *WhoAmIRequest) ProtoReflect() protoreflect.Message

func (*WhoAmIRequest) Reset

func (x *WhoAmIRequest) Reset()

func (*WhoAmIRequest) String

func (x *WhoAmIRequest) String() string

type WhoAmIResponse

type WhoAmIResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

Request message for the WhoAmI rpc.

func (*WhoAmIResponse) Descriptor deprecated

func (*WhoAmIResponse) Descriptor() ([]byte, []int)

Deprecated: Use WhoAmIResponse.ProtoReflect.Descriptor instead.

func (*WhoAmIResponse) GetEmail

func (x *WhoAmIResponse) GetEmail() string

func (*WhoAmIResponse) GetId

func (x *WhoAmIResponse) GetId() string

func (*WhoAmIResponse) GetName

func (x *WhoAmIResponse) GetName() string

func (*WhoAmIResponse) ProtoMessage

func (*WhoAmIResponse) ProtoMessage()

func (*WhoAmIResponse) ProtoReflect

func (x *WhoAmIResponse) ProtoReflect() protoreflect.Message

func (*WhoAmIResponse) Reset

func (x *WhoAmIResponse) Reset()

func (*WhoAmIResponse) String

func (x *WhoAmIResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL