v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error_name = map[int32]string{
		0: "ERR_UNKNOWN",
		1: "ERR_INVALID_ARGUMENT",
		2: "ERR_UNAUTHENTICATED",
		3: "ERR_INTERNAL_ERROR",
		4: "ERR_UPSTREAM_NOT_ENABLE",
		5: "ERR_NO_PERMISSION",
		6: "ERR_INVALID_X_PLUGIN_JWT_TOKEN",
		7: "ERR_INVALID_X_TKEEL_AUTH_TOKEN",
		8: "ERR_UPSTREAM_NOT_FOUND",
	}
	Error_value = map[string]int32{
		"ERR_UNKNOWN":                    0,
		"ERR_INVALID_ARGUMENT":           1,
		"ERR_UNAUTHENTICATED":            2,
		"ERR_INTERNAL_ERROR":             3,
		"ERR_UPSTREAM_NOT_ENABLE":        4,
		"ERR_NO_PERMISSION":              5,
		"ERR_INVALID_X_PLUGIN_JWT_TOKEN": 6,
		"ERR_INVALID_X_TKEEL_AUTH_TOKEN": 7,
		"ERR_UPSTREAM_NOT_FOUND":         8,
	}
)

Enum value maps for Error.

View Source
var Authentication_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "io.tkeel.security.api.authentication.v1.authentication",
	HandlerType: (*AuthenticationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Authenticate",
			Handler:    _Authentication_Authenticate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/authentication/v1/authentication.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)

View Source
var File_api_authentication_v1_authentication_proto protoreflect.FileDescriptor
View Source
var File_api_authentication_v1_error_proto protoreflect.FileDescriptor

Functions

func ErrInternalError

func ErrInternalError() errors.Error

func ErrInvalidArgument

func ErrInvalidArgument() errors.Error

func ErrInvalidXPluginJwtToken

func ErrInvalidXPluginJwtToken() errors.Error

func ErrInvalidXTkeelAuthToken

func ErrInvalidXTkeelAuthToken() errors.Error

func ErrNoPermission

func ErrNoPermission() errors.Error

func ErrUnauthenticated

func ErrUnauthenticated() errors.Error

func ErrUnknown

func ErrUnknown() errors.Error

func ErrUpstreamNotEnable

func ErrUpstreamNotEnable() errors.Error

func ErrUpstreamNotFound

func ErrUpstreamNotFound() errors.Error

func RegisterAuthenticationHTTPServer

func RegisterAuthenticationHTTPServer(container *go_restful.Container, srv AuthenticationHTTPServer)

func RegisterAuthenticationServer

func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer)

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Verb string `protobuf:"bytes,3,opt,name=verb,proto3" json:"verb,omitempty"`
	// contains filtered or unexported fields
}

认证请求.

func (*AuthenticateRequest) Descriptor deprecated

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

Deprecated: Use AuthenticateRequest.ProtoReflect.Descriptor instead.

func (*AuthenticateRequest) GetPath

func (x *AuthenticateRequest) GetPath() string

func (*AuthenticateRequest) GetVerb

func (x *AuthenticateRequest) GetVerb() string

func (*AuthenticateRequest) ProtoMessage

func (*AuthenticateRequest) ProtoMessage()

func (*AuthenticateRequest) ProtoReflect

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

func (*AuthenticateRequest) Reset

func (x *AuthenticateRequest) Reset()

func (*AuthenticateRequest) String

func (x *AuthenticateRequest) String() string

type AuthenticateResponse

type AuthenticateResponse struct {
	UserId      string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	TenantId    string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Role        string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"`
	Destination string `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"`
	Method      string `protobuf:"bytes,5,opt,name=method,proto3" json:"method,omitempty"`
	// contains filtered or unexported fields
}

认证返回值

func (*AuthenticateResponse) Descriptor deprecated

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

Deprecated: Use AuthenticateResponse.ProtoReflect.Descriptor instead.

func (*AuthenticateResponse) GetDestination

func (x *AuthenticateResponse) GetDestination() string

func (*AuthenticateResponse) GetMethod

func (x *AuthenticateResponse) GetMethod() string

func (*AuthenticateResponse) GetRole

func (x *AuthenticateResponse) GetRole() string

func (*AuthenticateResponse) GetTenantId

func (x *AuthenticateResponse) GetTenantId() string

func (*AuthenticateResponse) GetUserId

func (x *AuthenticateResponse) GetUserId() string

func (*AuthenticateResponse) ProtoMessage

func (*AuthenticateResponse) ProtoMessage()

func (*AuthenticateResponse) ProtoReflect

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

func (*AuthenticateResponse) Reset

func (x *AuthenticateResponse) Reset()

func (*AuthenticateResponse) String

func (x *AuthenticateResponse) String() string

type AuthenticationClient

type AuthenticationClient interface {
	Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, 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 AuthenticationHTTPHandler

type AuthenticationHTTPHandler struct {
	// contains filtered or unexported fields
}

func (*AuthenticationHTTPHandler) Authenticate

func (h *AuthenticationHTTPHandler) Authenticate(req *go_restful.Request, resp *go_restful.Response)

type AuthenticationHTTPServer

type AuthenticationHTTPServer interface {
	Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error)
}

type AuthenticationServer

type AuthenticationServer interface {
	Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error)
	// contains filtered or unexported methods
}

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

type Error

type Error int32

@plugins=protoc-gen-go-errors 错误

const (
	// @msg=未知类型
	// @code=UNKNOWN
	Error_ERR_UNKNOWN Error = 0
	// @msg=请求参数无效
	// @code=INVALID_ARGUMENT
	Error_ERR_INVALID_ARGUMENT Error = 1
	// @msg=认证错误
	// @code=UNAUTHENTICATED
	Error_ERR_UNAUTHENTICATED Error = 2
	// @msg=内部错误
	// @code=INTERNAL
	Error_ERR_INTERNAL_ERROR Error = 3
	// @msg=上游插件未启用
	// @code=PERMISSION_DENIED
	Error_ERR_UPSTREAM_NOT_ENABLE Error = 4
	// @msg=无权限
	// @code=PERMISSION_DENIED
	Error_ERR_NO_PERMISSION Error = 5
	// @msg=无效的x-plugin-jwttoken
	// @code=UNAUTHENTICATED
	Error_ERR_INVALID_X_PLUGIN_JWT_TOKEN Error = 6
	// @msg=无效的x-tKeel-authtoken
	// @code=UNAUTHENTICATED
	Error_ERR_INVALID_X_TKEEL_AUTH_TOKEN Error = 7
	// @msg=上游插件未找到
	// @code=NOT_FOUND
	Error_ERR_UPSTREAM_NOT_FOUND Error = 8
)

func (Error) Descriptor

func (Error) Descriptor() protoreflect.EnumDescriptor

func (Error) Enum

func (x Error) Enum() *Error

func (Error) EnumDescriptor deprecated

func (Error) EnumDescriptor() ([]byte, []int)

Deprecated: Use Error.Descriptor instead.

func (Error) Number

func (x Error) Number() protoreflect.EnumNumber

func (Error) String

func (x Error) String() string

func (Error) Type

func (Error) Type() protoreflect.EnumType

type UnimplementedAuthenticationServer

type UnimplementedAuthenticationServer struct {
}

UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthenticationServer) Authenticate

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.

Jump to

Keyboard shortcuts

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