auth

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: Apache-2.0 Imports: 16 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 Authentication_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clouditor.Authentication",
	HandlerType: (*AuthenticationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _Authentication_Login_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth.proto",
}

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

Functions

func RegisterAuthenticationHandler added in v1.3.1

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

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

func RegisterAuthenticationHandlerClient added in v1.3.1

func RegisterAuthenticationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthenticationClient) error

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

func RegisterAuthenticationHandlerFromEndpoint added in v1.3.1

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

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

func RegisterAuthenticationHandlerServer added in v1.3.1

func RegisterAuthenticationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthenticationServer) error

RegisterAuthenticationHandlerServer registers the http handlers for service Authentication to "mux". UnaryRPC :call AuthenticationServer 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 RegisterAuthenticationHandlerFromEndpoint instead.

func RegisterAuthenticationServer

func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer)

Types

type AuthenticationClient

type AuthenticationClient interface {
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
}

AuthenticationClient is the client API for Authentication 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 AuthenticationServer

type AuthenticationServer interface {
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// contains filtered or unexported methods
}

AuthenticationServer is the server API for Authentication service. All implementations must embed UnimplementedAuthenticationServer for forward compatibility

type LoginRequest

type LoginRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) GetUsername

func (x *LoginRequest) GetUsername() 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 {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetToken

func (x *LoginResponse) GetToken() string

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 UnimplementedAuthenticationServer

type UnimplementedAuthenticationServer struct {
}

UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthenticationServer) Login

type UnsafeAuthenticationServer

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

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

type User

type User struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Email    string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	FullName string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"`
	Shadow   bool   `protobuf:"varint,5,opt,name=shadow,proto3" json:"shadow,omitempty"`
	// contains filtered or unexported fields
}

A clouditor user

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFullName

func (x *User) GetFullName() string

func (*User) GetPassword

func (x *User) GetPassword() string

func (*User) GetShadow

func (x *User) GetShadow() bool

func (*User) GetUsername

func (x *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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