Documentation ¶
Index ¶
- Variables
- func ErrInternalError() errors.Error
- func ErrInvalidArgument() errors.Error
- func ErrInvalidXPluginJwtToken() errors.Error
- func ErrInvalidXTkeelAuthToken() errors.Error
- func ErrNoPermission() errors.Error
- func ErrUnauthenticated() errors.Error
- func ErrUnknown() errors.Error
- func ErrUpstreamNotEnable() errors.Error
- func ErrUpstreamNotFound() errors.Error
- func RegisterAuthenticationHTTPServer(container *go_restful.Container, srv AuthenticationHTTPServer)
- func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer)
- type AuthenticateRequest
- func (*AuthenticateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AuthenticateRequest) GetPath() string
- func (x *AuthenticateRequest) GetVerb() string
- func (*AuthenticateRequest) ProtoMessage()
- func (x *AuthenticateRequest) ProtoReflect() protoreflect.Message
- func (x *AuthenticateRequest) Reset()
- func (x *AuthenticateRequest) String() string
- type AuthenticateResponse
- func (*AuthenticateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuthenticateResponse) GetDestination() string
- func (x *AuthenticateResponse) GetMethod() string
- func (x *AuthenticateResponse) GetRole() string
- func (x *AuthenticateResponse) GetTenantId() string
- func (x *AuthenticateResponse) GetUserId() string
- func (*AuthenticateResponse) ProtoMessage()
- func (x *AuthenticateResponse) ProtoReflect() protoreflect.Message
- func (x *AuthenticateResponse) Reset()
- func (x *AuthenticateResponse) String() string
- type AuthenticationClient
- type AuthenticationHTTPHandler
- type AuthenticationHTTPServer
- type AuthenticationServer
- type Error
- type UnimplementedAuthenticationServer
- type UnsafeAuthenticationServer
Constants ¶
This section is empty.
Variables ¶
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.
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)
var File_api_authentication_v1_authentication_proto protoreflect.FileDescriptor
var File_api_authentication_v1_error_proto protoreflect.FileDescriptor
Functions ¶
func ErrInternalError ¶
func ErrInvalidArgument ¶
func ErrNoPermission ¶
func ErrUnauthenticated ¶
func ErrUnknown ¶
func ErrUpstreamNotEnable ¶
func ErrUpstreamNotFound ¶
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.
func NewAuthenticationClient ¶
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient
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) EnumDescriptor
deprecated
func (Error) Number ¶
func (x Error) Number() protoreflect.EnumNumber
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 ¶
func (UnimplementedAuthenticationServer) Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error)
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.