auth

package
v0.0.0-...-0451d2a Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package auth is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "auth.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Identify",
			Handler:    _AuthService_Identify_Handler,
		},
		{
			MethodName: "Issue",
			Handler:    _AuthService_Issue_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth/v1/auth.proto",
}

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

View Source
var File_auth_v1_auth_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	Identify(ctx context.Context, in *IdentifyRequest, opts ...grpc.CallOption) (*Identity, error)
	Issue(ctx context.Context, in *IssueRequest, opts ...grpc.CallOption) (*Key, error)
}

AuthServiceClient is the client API for AuthService 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.

type AuthServiceServer

type AuthServiceServer interface {
	Identify(context.Context, *IdentifyRequest) (*Identity, error)
	Issue(context.Context, *IssueRequest) (*Key, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type IdentifyRequest

type IdentifyRequest struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*IdentifyRequest) Descriptor deprecated

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

Deprecated: Use IdentifyRequest.ProtoReflect.Descriptor instead.

func (*IdentifyRequest) GetToken

func (x *IdentifyRequest) GetToken() string

func (*IdentifyRequest) ProtoMessage

func (*IdentifyRequest) ProtoMessage()

func (*IdentifyRequest) ProtoReflect

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

func (*IdentifyRequest) Reset

func (x *IdentifyRequest) Reset()

func (*IdentifyRequest) String

func (x *IdentifyRequest) String() string

type Identity

type Identity struct {
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Identity) Descriptor deprecated

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

Deprecated: Use Identity.ProtoReflect.Descriptor instead.

func (*Identity) GetSessionId

func (x *Identity) GetSessionId() string

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) ProtoReflect

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

func (*Identity) Reset

func (x *Identity) Reset()

func (*Identity) String

func (x *Identity) String() string

type IssueRequest

type IssueRequest struct {
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	TTL       int64  `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"`
	// contains filtered or unexported fields
}

func (*IssueRequest) Descriptor deprecated

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

Deprecated: Use IssueRequest.ProtoReflect.Descriptor instead.

func (*IssueRequest) GetSessionId

func (x *IssueRequest) GetSessionId() string

func (*IssueRequest) GetTTL

func (x *IssueRequest) GetTTL() int64

func (*IssueRequest) ProtoMessage

func (*IssueRequest) ProtoMessage()

func (*IssueRequest) ProtoReflect

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

func (*IssueRequest) Reset

func (x *IssueRequest) Reset()

func (*IssueRequest) String

func (x *IssueRequest) String() string

type Key

type Key struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*Key) Descriptor deprecated

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

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetToken

func (x *Key) GetToken() string

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

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

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) Identify

func (UnimplementedAuthServiceServer) Issue

type UnsafeAuthServiceServer

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

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

Jump to

Keyboard shortcuts

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