Documentation ¶
Index ¶
- Constants
- Variables
- func HttpEntry() *http.EntrySet
- func MakeBearer(lenth int) string
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type BlockTokenRequest
- func (*BlockTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BlockTokenRequest) GetAccessToken() string
- func (x *BlockTokenRequest) GetBlockReason() string
- func (x *BlockTokenRequest) GetBlockType() BlockType
- func (*BlockTokenRequest) ProtoMessage()
- func (x *BlockTokenRequest) ProtoReflect() protoreflect.Message
- func (x *BlockTokenRequest) Reset()
- func (x *BlockTokenRequest) String() string
- type BlockType
- func (BlockType) Descriptor() protoreflect.EnumDescriptor
- func (x BlockType) Enum() *BlockType
- func (BlockType) EnumDescriptor() ([]byte, []int)deprecated
- func (t BlockType) Equal(target BlockType) bool
- func (t BlockType) IsIn(targets ...BlockType) bool
- func (t BlockType) MarshalJSON() ([]byte, error)
- func (x BlockType) Number() protoreflect.EnumNumber
- func (x BlockType) String() string
- func (BlockType) Type() protoreflect.EnumType
- func (t *BlockType) UnmarshalJSON(b []byte) error
- type ChangeNamespaceRequest
- func (*ChangeNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ChangeNamespaceRequest) GetNamespace() string
- func (x *ChangeNamespaceRequest) GetToken() string
- func (*ChangeNamespaceRequest) ProtoMessage()
- func (x *ChangeNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *ChangeNamespaceRequest) Reset()
- func (x *ChangeNamespaceRequest) String() string
- func (req *ChangeNamespaceRequest) Validate() error
- type DeleteTokenRequest
- func (*DeleteTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTokenRequest) GetAccessToken() []string
- func (x *DeleteTokenRequest) GetAccount() string
- func (x *DeleteTokenRequest) GetDomain() string
- func (*DeleteTokenRequest) ProtoMessage()
- func (x *DeleteTokenRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteTokenRequest) Reset()
- func (x *DeleteTokenRequest) String() string
- func (req *DeleteTokenRequest) Validate() error
- type DeleteTokenResponse
- func (*DeleteTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTokenResponse) GetFailed() []string
- func (x *DeleteTokenResponse) GetMessage() string
- func (x *DeleteTokenResponse) GetSuccess() []string
- func (*DeleteTokenResponse) ProtoMessage()
- func (x *DeleteTokenResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteTokenResponse) Reset()
- func (x *DeleteTokenResponse) String() string
- type DescribeTokenRequest
- func (*DescribeTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeTokenRequest) GetAccessToken() string
- func (x *DescribeTokenRequest) GetRefreshToken() string
- func (*DescribeTokenRequest) ProtoMessage()
- func (x *DescribeTokenRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeTokenRequest) Reset()
- func (x *DescribeTokenRequest) String() string
- func (m *DescribeTokenRequest) Validate() error
- type GrantType
- func (GrantType) Descriptor() protoreflect.EnumDescriptor
- func (x GrantType) Enum() *GrantType
- func (GrantType) EnumDescriptor() ([]byte, []int)deprecated
- func (t GrantType) Equal(target GrantType) bool
- func (t GrantType) IsIn(targets ...GrantType) bool
- func (t GrantType) MarshalJSON() ([]byte, error)
- func (x GrantType) Number() protoreflect.EnumNumber
- func (x GrantType) String() string
- func (GrantType) Type() protoreflect.EnumType
- func (t *GrantType) UnmarshalJSON(b []byte) error
- type IssueTokenRequest
- func (m *IssueTokenRequest) AbnormalUserCheckKey() string
- func (*IssueTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IssueTokenRequest) GetAccessExpiredAt() int64
- func (x *IssueTokenRequest) GetAccessToken() string
- func (x *IssueTokenRequest) GetAuthCode() string
- func (x *IssueTokenRequest) GetClientId() string
- func (x *IssueTokenRequest) GetClientSecret() string
- func (x *IssueTokenRequest) GetDescription() string
- func (m *IssueTokenRequest) GetDomainNameFromAccount() string
- func (x *IssueTokenRequest) GetGrantType() GrantType
- func (x *IssueTokenRequest) GetPassword() string
- func (x *IssueTokenRequest) GetRefreshToken() string
- func (x *IssueTokenRequest) GetRemoteIp() string
- func (x *IssueTokenRequest) GetScope() string
- func (x *IssueTokenRequest) GetService() string
- func (x *IssueTokenRequest) GetState() string
- func (x *IssueTokenRequest) GetType() TokenType
- func (x *IssueTokenRequest) GetUserAgent() string
- func (x *IssueTokenRequest) GetUsername() string
- func (x *IssueTokenRequest) GetVerifyCode() string
- func (m *IssueTokenRequest) IsLoginRequest() bool
- func (*IssueTokenRequest) ProtoMessage()
- func (x *IssueTokenRequest) ProtoReflect() protoreflect.Message
- func (x *IssueTokenRequest) Reset()
- func (x *IssueTokenRequest) String() string
- func (m *IssueTokenRequest) Validate() error
- func (m *IssueTokenRequest) WithRemoteIP(ip string)
- func (m *IssueTokenRequest) WithRemoteIPFromHTTP(r *http.Request)
- func (m *IssueTokenRequest) WithUserAgent(userAgent string)
- type QueryTokenRequest
- func (*QueryTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryTokenRequest) GetAccount() string
- func (x *QueryTokenRequest) GetApplicationId() string
- func (x *QueryTokenRequest) GetGrantType() GrantType
- func (x *QueryTokenRequest) GetPage() *request.PageRequest
- func (*QueryTokenRequest) ProtoMessage()
- func (x *QueryTokenRequest) ProtoReflect() protoreflect.Message
- func (x *QueryTokenRequest) Reset()
- func (x *QueryTokenRequest) String() string
- type RevolkTokenRequest
- func (*RevolkTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RevolkTokenRequest) GetAccessToken() string
- func (x *RevolkTokenRequest) GetClientId() string
- func (x *RevolkTokenRequest) GetClientSecret() string
- func (x *RevolkTokenRequest) GetLogoutSession() bool
- func (x *RevolkTokenRequest) GetRefreshToken() string
- func (m *RevolkTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
- func (*RevolkTokenRequest) ProtoMessage()
- func (x *RevolkTokenRequest) ProtoReflect() protoreflect.Message
- func (x *RevolkTokenRequest) Reset()
- func (x *RevolkTokenRequest) String() string
- func (m *RevolkTokenRequest) Validate() error
- type ServiceClient
- type ServiceServer
- type Set
- type Token
- func (t *Token) BlockMessage() string
- func (t *Token) CheckAccessIsExpired() bool
- func (t *Token) CheckRefreshIsExpired() bool
- func (t *Token) CheckTokenApplication(applicationID string) error
- func (*Token) Descriptor() ([]byte, []int)deprecated
- func (t *Token) Desensitize()
- func (t *Token) EndAt() int64
- func (x *Token) GetAccessExpiredAt() int64
- func (x *Token) GetAccessToken() string
- func (x *Token) GetAccount() string
- func (x *Token) GetApplicationId() string
- func (x *Token) GetApplicationName() string
- func (x *Token) GetAvailableNamespace() []string
- func (x *Token) GetBlockAt() int64
- func (x *Token) GetBlockReason() string
- func (x *Token) GetBlockType() BlockType
- func (x *Token) GetClientId() string
- func (x *Token) GetCreateAt() int64
- func (x *Token) GetDescription() string
- func (x *Token) GetDomain() string
- func (x *Token) GetGrantType() GrantType
- func (x *Token) GetIsBlock() bool
- func (x *Token) GetNamespaceId() string
- func (x *Token) GetNamespaceName() string
- func (x *Token) GetRefreshExpiredAt() int64
- func (x *Token) GetRefreshToken() string
- func (t *Token) GetRemoteIP() string
- func (x *Token) GetRemoteIp() string
- func (x *Token) GetScope() string
- func (x *Token) GetSessionId() string
- func (x *Token) GetStartGrantType() GrantType
- func (x *Token) GetType() TokenType
- func (x *Token) GetUserAgent() string
- func (x *Token) GetUserType() types.UserType
- func (t *Token) HasNamespace(ns string) bool
- func (t *Token) IsAvailable() error
- func (t *Token) IsOwner(account string) bool
- func (t *Token) IsRefresh() bool
- func (*Token) ProtoMessage()
- func (x *Token) ProtoReflect() protoreflect.Message
- func (x *Token) Reset()
- func (x *Token) String() string
- func (t *Token) WithRemoteIP(ip string)
- func (t *Token) WithUerAgent(ua string)
- type TokenType
- func (TokenType) Descriptor() protoreflect.EnumDescriptor
- func (x TokenType) Enum() *TokenType
- func (TokenType) EnumDescriptor() ([]byte, []int)deprecated
- func (t TokenType) Equal(target TokenType) bool
- func (t TokenType) IsIn(targets ...TokenType) bool
- func (t TokenType) MarshalJSON() ([]byte, error)
- func (x TokenType) Number() protoreflect.EnumNumber
- func (x TokenType) String() string
- func (TokenType) Type() protoreflect.EnumType
- func (t *TokenType) UnmarshalJSON(b []byte) error
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) BlockToken(context.Context, *BlockTokenRequest) (*Token, error)
- func (UnimplementedServiceServer) ChangeNamespace(context.Context, *ChangeNamespaceRequest) (*Token, error)
- func (UnimplementedServiceServer) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error)
- func (UnimplementedServiceServer) DescribeToken(context.Context, *DescribeTokenRequest) (*Token, error)
- func (UnimplementedServiceServer) IssueToken(context.Context, *IssueTokenRequest) (*Token, error)
- func (UnimplementedServiceServer) QueryToken(context.Context, *QueryTokenRequest) (*Set, error)
- func (UnimplementedServiceServer) RevolkToken(context.Context, *RevolkTokenRequest) (*Token, error)
- func (UnimplementedServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*Token, error)
- type UnsafeServiceServer
- type ValidateTokenRequest
- func (*ValidateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateTokenRequest) GetAccessToken() string
- func (x *ValidateTokenRequest) GetEndpointId() string
- func (x *ValidateTokenRequest) GetNamespaceId() string
- func (x *ValidateTokenRequest) GetRefreshToken() string
- func (m *ValidateTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
- func (*ValidateTokenRequest) ProtoMessage()
- func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateTokenRequest) Reset()
- func (x *ValidateTokenRequest) String() string
- func (m *ValidateTokenRequest) Validate() error
Constants ¶
const (
AppName = "token"
)
Variables ¶
var ( GrantType_name = map[int32]string{ 0: "NULL", 1: "UNKNOWN", 2: "PASSWORD", 3: "LDAP", 4: "REFRESH", 5: "ACCESS", 6: "CLIENT", 7: "AUTH_CODE", 8: "IMPLICIT", 9: "WECHAT_WORK", } GrantType_value = map[string]int32{ "NULL": 0, "UNKNOWN": 1, "PASSWORD": 2, "LDAP": 3, "REFRESH": 4, "ACCESS": 5, "CLIENT": 6, "AUTH_CODE": 7, "IMPLICIT": 8, "WECHAT_WORK": 9, } )
Enum value maps for GrantType.
var ( TokenType_name = map[int32]string{ 0: "BEARER", 1: "MAC", 2: "JWT", } TokenType_value = map[string]int32{ "BEARER": 0, "MAC": 1, "JWT": 2, } )
Enum value maps for TokenType.
var ( BlockType_name = map[int32]string{ 0: "SESSION_TERMINATED", 1: "OTHER_CLIENT_LOGGED_IN", 2: "OTHER_PLACE_LOGGED_IN", 3: "OTHER_IP_LOGGED_IN", } BlockType_value = map[string]int32{ "SESSION_TERMINATED": 0, "OTHER_CLIENT_LOGGED_IN": 1, "OTHER_PLACE_LOGGED_IN": 2, "OTHER_IP_LOGGED_IN": 3, } )
Enum value maps for BlockType.
var File_apps_token_pb_request_proto protoreflect.FileDescriptor
var File_apps_token_pb_service_proto protoreflect.FileDescriptor
var File_apps_token_pb_token_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.keyauth.token.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "IssueToken", Handler: _Service_IssueToken_Handler, }, { MethodName: "ValidateToken", Handler: _Service_ValidateToken_Handler, }, { MethodName: "DescribeToken", Handler: _Service_DescribeToken_Handler, }, { MethodName: "RevolkToken", Handler: _Service_RevolkToken_Handler, }, { MethodName: "BlockToken", Handler: _Service_BlockToken_Handler, }, { MethodName: "ChangeNamespace", Handler: _Service_ChangeNamespace_Handler, }, { MethodName: "QueryToken", Handler: _Service_QueryToken_Handler, }, { MethodName: "DeleteToken", Handler: _Service_DeleteToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/token/pb/service.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func MakeBearer ¶
MakeBearer https://tools.ietf.org/html/rfc6750#section-2.1 b64token = 1*( ALPHA / DIGIT /"-" / "." / "_" / "~" / "+" / "/" ) *"="
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type BlockTokenRequest ¶
type BlockTokenRequest struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` BlockReason string `protobuf:"bytes,2,opt,name=block_reason,json=blockReason,proto3" json:"block_reason,omitempty"` BlockType BlockType `` /* 129-byte string literal not displayed */ // contains filtered or unexported fields }
func NewBlockTokenRequest ¶
func NewBlockTokenRequest(accessToken string, bt BlockType, reason string) *BlockTokenRequest
NewBlockTokenRequest todo
func (*BlockTokenRequest) Descriptor
deprecated
func (*BlockTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockTokenRequest.ProtoReflect.Descriptor instead.
func (*BlockTokenRequest) GetAccessToken ¶
func (x *BlockTokenRequest) GetAccessToken() string
func (*BlockTokenRequest) GetBlockReason ¶
func (x *BlockTokenRequest) GetBlockReason() string
func (*BlockTokenRequest) GetBlockType ¶
func (x *BlockTokenRequest) GetBlockType() BlockType
func (*BlockTokenRequest) ProtoMessage ¶
func (*BlockTokenRequest) ProtoMessage()
func (*BlockTokenRequest) ProtoReflect ¶
func (x *BlockTokenRequest) ProtoReflect() protoreflect.Message
func (*BlockTokenRequest) Reset ¶
func (x *BlockTokenRequest) Reset()
func (*BlockTokenRequest) String ¶
func (x *BlockTokenRequest) String() string
type BlockType ¶
type BlockType int32
func ParseBlockTypeFromString ¶
ParseBlockTypeFromString Parse BlockType from string
func (BlockType) Descriptor ¶
func (BlockType) Descriptor() protoreflect.EnumDescriptor
func (BlockType) EnumDescriptor
deprecated
func (BlockType) Number ¶
func (x BlockType) Number() protoreflect.EnumNumber
func (BlockType) Type ¶
func (BlockType) Type() protoreflect.EnumType
func (*BlockType) UnmarshalJSON ¶
UnmarshalJSON todo
type ChangeNamespaceRequest ¶
type ChangeNamespaceRequest struct { // @gotags: json:"namespace" validate:"required" Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace" validate:"required"` // @gotags: json:"token" validate:"required" Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" validate:"required"` // contains filtered or unexported fields }
func NewChangeNamespaceRequest ¶
func NewChangeNamespaceRequest() *ChangeNamespaceRequest
func (*ChangeNamespaceRequest) Descriptor
deprecated
func (*ChangeNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChangeNamespaceRequest.ProtoReflect.Descriptor instead.
func (*ChangeNamespaceRequest) GetNamespace ¶
func (x *ChangeNamespaceRequest) GetNamespace() string
func (*ChangeNamespaceRequest) GetToken ¶
func (x *ChangeNamespaceRequest) GetToken() string
func (*ChangeNamespaceRequest) ProtoMessage ¶
func (*ChangeNamespaceRequest) ProtoMessage()
func (*ChangeNamespaceRequest) ProtoReflect ¶
func (x *ChangeNamespaceRequest) ProtoReflect() protoreflect.Message
func (*ChangeNamespaceRequest) Reset ¶
func (x *ChangeNamespaceRequest) Reset()
func (*ChangeNamespaceRequest) String ¶
func (x *ChangeNamespaceRequest) String() string
func (*ChangeNamespaceRequest) Validate ¶
func (req *ChangeNamespaceRequest) Validate() error
type DeleteTokenRequest ¶
type DeleteTokenRequest struct { AccessToken []string `protobuf:"bytes,1,rep,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` // contains filtered or unexported fields }
func NewDeleteTokenRequest ¶
func NewDeleteTokenRequest() *DeleteTokenRequest
func (*DeleteTokenRequest) Descriptor
deprecated
func (*DeleteTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTokenRequest.ProtoReflect.Descriptor instead.
func (*DeleteTokenRequest) GetAccessToken ¶
func (x *DeleteTokenRequest) GetAccessToken() []string
func (*DeleteTokenRequest) GetAccount ¶
func (x *DeleteTokenRequest) GetAccount() string
func (*DeleteTokenRequest) GetDomain ¶
func (x *DeleteTokenRequest) GetDomain() string
func (*DeleteTokenRequest) ProtoMessage ¶
func (*DeleteTokenRequest) ProtoMessage()
func (*DeleteTokenRequest) ProtoReflect ¶
func (x *DeleteTokenRequest) ProtoReflect() protoreflect.Message
func (*DeleteTokenRequest) Reset ¶
func (x *DeleteTokenRequest) Reset()
func (*DeleteTokenRequest) String ¶
func (x *DeleteTokenRequest) String() string
func (*DeleteTokenRequest) Validate ¶
func (req *DeleteTokenRequest) Validate() error
type DeleteTokenResponse ¶
type DeleteTokenResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Success []string `protobuf:"bytes,2,rep,name=success,proto3" json:"success,omitempty"` Failed []string `protobuf:"bytes,3,rep,name=failed,proto3" json:"failed,omitempty"` // contains filtered or unexported fields }
func NewDeleteTokenResponse ¶
func NewDeleteTokenResponse() *DeleteTokenResponse
func (*DeleteTokenResponse) Descriptor
deprecated
func (*DeleteTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTokenResponse.ProtoReflect.Descriptor instead.
func (*DeleteTokenResponse) GetFailed ¶
func (x *DeleteTokenResponse) GetFailed() []string
func (*DeleteTokenResponse) GetMessage ¶
func (x *DeleteTokenResponse) GetMessage() string
func (*DeleteTokenResponse) GetSuccess ¶
func (x *DeleteTokenResponse) GetSuccess() []string
func (*DeleteTokenResponse) ProtoMessage ¶
func (*DeleteTokenResponse) ProtoMessage()
func (*DeleteTokenResponse) ProtoReflect ¶
func (x *DeleteTokenResponse) ProtoReflect() protoreflect.Message
func (*DeleteTokenResponse) Reset ¶
func (x *DeleteTokenResponse) Reset()
func (*DeleteTokenResponse) String ¶
func (x *DeleteTokenResponse) String() string
type DescribeTokenRequest ¶
type DescribeTokenRequest struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func NewDescribeTokenRequest ¶
func NewDescribeTokenRequest() *DescribeTokenRequest
NewDescribeTokenRequest 实例化
func NewDescribeTokenRequestWithAccessToken ¶
func NewDescribeTokenRequestWithAccessToken(at string) *DescribeTokenRequest
NewDescribeTokenRequestWithAccessToken 实例化
func (*DescribeTokenRequest) Descriptor
deprecated
func (*DescribeTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeTokenRequest.ProtoReflect.Descriptor instead.
func (*DescribeTokenRequest) GetAccessToken ¶
func (x *DescribeTokenRequest) GetAccessToken() string
func (*DescribeTokenRequest) GetRefreshToken ¶
func (x *DescribeTokenRequest) GetRefreshToken() string
func (*DescribeTokenRequest) ProtoMessage ¶
func (*DescribeTokenRequest) ProtoMessage()
func (*DescribeTokenRequest) ProtoReflect ¶
func (x *DescribeTokenRequest) ProtoReflect() protoreflect.Message
func (*DescribeTokenRequest) Reset ¶
func (x *DescribeTokenRequest) Reset()
func (*DescribeTokenRequest) String ¶
func (x *DescribeTokenRequest) String() string
type GrantType ¶
type GrantType int32
const ( GrantType_NULL GrantType = 0 GrantType_UNKNOWN GrantType = 1 GrantType_PASSWORD GrantType = 2 GrantType_LDAP GrantType = 3 GrantType_REFRESH GrantType = 4 GrantType_ACCESS GrantType = 5 GrantType_CLIENT GrantType = 6 GrantType_AUTH_CODE GrantType = 7 GrantType_IMPLICIT GrantType = 8 GrantType_WECHAT_WORK GrantType = 9 )
func ParseGrantTypeFromString ¶
ParseGrantTypeFromString Parse GrantType from string
func (GrantType) Descriptor ¶
func (GrantType) Descriptor() protoreflect.EnumDescriptor
func (GrantType) EnumDescriptor
deprecated
func (GrantType) Number ¶
func (x GrantType) Number() protoreflect.EnumNumber
func (GrantType) Type ¶
func (GrantType) Type() protoreflect.EnumType
func (*GrantType) UnmarshalJSON ¶
UnmarshalJSON todo
type IssueTokenRequest ¶
type IssueTokenRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` VerifyCode string `protobuf:"bytes,3,opt,name=verify_code,json=verifyCode,proto3" json:"verify_code,omitempty"` Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` RefreshToken string `protobuf:"bytes,6,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` AccessToken string `protobuf:"bytes,7,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` AuthCode string `protobuf:"bytes,8,opt,name=auth_code,json=authCode,proto3" json:"auth_code,omitempty"` State string `protobuf:"bytes,9,opt,name=state,proto3" json:"state,omitempty"` GrantType GrantType `` /* 130-byte string literal not displayed */ Type TokenType `protobuf:"varint,11,opt,name=type,proto3,enum=infraboard.keyauth.token.TokenType" json:"type,omitempty"` AccessExpiredAt int64 `protobuf:"varint,15,opt,name=access_expired_at,json=accessExpiredAt,proto3" json:"access_expired_at,omitempty"` Description string `protobuf:"bytes,16,opt,name=description,proto3" json:"description,omitempty"` Scope string `protobuf:"bytes,12,opt,name=scope,proto3" json:"scope,omitempty"` UserAgent string `protobuf:"bytes,13,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` RemoteIp string `protobuf:"bytes,14,opt,name=remote_ip,json=remoteIp,proto3" json:"remote_ip,omitempty"` Service string `protobuf:"bytes,17,opt,name=service,proto3" json:"service,omitempty"` // contains filtered or unexported fields }
func NewIssueTokenByPassword ¶
func NewIssueTokenByPassword(clientID, clientSecret, user, pass string) *IssueTokenRequest
NewIssueTokenByPassword todo
func NewIssueTokenRequest ¶
func NewIssueTokenRequest() *IssueTokenRequest
NewIssueTokenRequest 默认请求
func (*IssueTokenRequest) AbnormalUserCheckKey ¶
func (m *IssueTokenRequest) AbnormalUserCheckKey() string
AbnormalUserCheckKey todo
func (*IssueTokenRequest) Descriptor
deprecated
func (*IssueTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssueTokenRequest.ProtoReflect.Descriptor instead.
func (*IssueTokenRequest) GetAccessExpiredAt ¶
func (x *IssueTokenRequest) GetAccessExpiredAt() int64
func (*IssueTokenRequest) GetAccessToken ¶
func (x *IssueTokenRequest) GetAccessToken() string
func (*IssueTokenRequest) GetAuthCode ¶
func (x *IssueTokenRequest) GetAuthCode() string
func (*IssueTokenRequest) GetClientId ¶
func (x *IssueTokenRequest) GetClientId() string
func (*IssueTokenRequest) GetClientSecret ¶
func (x *IssueTokenRequest) GetClientSecret() string
func (*IssueTokenRequest) GetDescription ¶
func (x *IssueTokenRequest) GetDescription() string
func (*IssueTokenRequest) GetDomainNameFromAccount ¶
func (m *IssueTokenRequest) GetDomainNameFromAccount() string
GetDomainNameFromAccount todo
func (*IssueTokenRequest) GetGrantType ¶
func (x *IssueTokenRequest) GetGrantType() GrantType
func (*IssueTokenRequest) GetPassword ¶
func (x *IssueTokenRequest) GetPassword() string
func (*IssueTokenRequest) GetRefreshToken ¶
func (x *IssueTokenRequest) GetRefreshToken() string
func (*IssueTokenRequest) GetRemoteIp ¶
func (x *IssueTokenRequest) GetRemoteIp() string
func (*IssueTokenRequest) GetScope ¶
func (x *IssueTokenRequest) GetScope() string
func (*IssueTokenRequest) GetService ¶
func (x *IssueTokenRequest) GetService() string
func (*IssueTokenRequest) GetState ¶
func (x *IssueTokenRequest) GetState() string
func (*IssueTokenRequest) GetType ¶
func (x *IssueTokenRequest) GetType() TokenType
func (*IssueTokenRequest) GetUserAgent ¶
func (x *IssueTokenRequest) GetUserAgent() string
func (*IssueTokenRequest) GetUsername ¶
func (x *IssueTokenRequest) GetUsername() string
func (*IssueTokenRequest) GetVerifyCode ¶
func (x *IssueTokenRequest) GetVerifyCode() string
func (*IssueTokenRequest) IsLoginRequest ¶
func (m *IssueTokenRequest) IsLoginRequest() bool
func (*IssueTokenRequest) ProtoMessage ¶
func (*IssueTokenRequest) ProtoMessage()
func (*IssueTokenRequest) ProtoReflect ¶
func (x *IssueTokenRequest) ProtoReflect() protoreflect.Message
func (*IssueTokenRequest) Reset ¶
func (x *IssueTokenRequest) Reset()
func (*IssueTokenRequest) String ¶
func (x *IssueTokenRequest) String() string
func (*IssueTokenRequest) WithRemoteIP ¶
func (m *IssueTokenRequest) WithRemoteIP(ip string)
WithRemoteIP todo
func (*IssueTokenRequest) WithRemoteIPFromHTTP ¶
func (m *IssueTokenRequest) WithRemoteIPFromHTTP(r *http.Request)
WithRemoteIPFromHTTP todo
func (*IssueTokenRequest) WithUserAgent ¶
func (m *IssueTokenRequest) WithUserAgent(userAgent string)
WithUserAgent todo
type QueryTokenRequest ¶
type QueryTokenRequest struct { Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page,omitempty"` ApplicationId string `protobuf:"bytes,2,opt,name=application_id,json=applicationId,proto3" json:"application_id,omitempty"` Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"` GrantType GrantType `` /* 129-byte string literal not displayed */ // contains filtered or unexported fields }
func NewQueryTokenRequest ¶
func NewQueryTokenRequest(page *request.PageRequest) *QueryTokenRequest
NewQueryTokenRequest 请求实例
func NewQueryTokenRequestFromHTTP ¶
func NewQueryTokenRequestFromHTTP(r *http.Request) (*QueryTokenRequest, error)
NewQueryDepartmentRequestFromHTTP 列表查询请求
func (*QueryTokenRequest) Descriptor
deprecated
func (*QueryTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryTokenRequest.ProtoReflect.Descriptor instead.
func (*QueryTokenRequest) GetAccount ¶
func (x *QueryTokenRequest) GetAccount() string
func (*QueryTokenRequest) GetApplicationId ¶
func (x *QueryTokenRequest) GetApplicationId() string
func (*QueryTokenRequest) GetGrantType ¶
func (x *QueryTokenRequest) GetGrantType() GrantType
func (*QueryTokenRequest) GetPage ¶
func (x *QueryTokenRequest) GetPage() *request.PageRequest
func (*QueryTokenRequest) ProtoMessage ¶
func (*QueryTokenRequest) ProtoMessage()
func (*QueryTokenRequest) ProtoReflect ¶
func (x *QueryTokenRequest) ProtoReflect() protoreflect.Message
func (*QueryTokenRequest) Reset ¶
func (x *QueryTokenRequest) Reset()
func (*QueryTokenRequest) String ¶
func (x *QueryTokenRequest) String() string
type RevolkTokenRequest ¶
type RevolkTokenRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` LogoutSession bool `protobuf:"varint,3,opt,name=logout_session,json=logoutSession,proto3" json:"logout_session,omitempty"` AccessToken string `protobuf:"bytes,4,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,5,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func NewRevolkTokenRequest ¶
func NewRevolkTokenRequest(clientID, clientSecret string) *RevolkTokenRequest
NewRevolkTokenRequest 撤销Token请求
func (*RevolkTokenRequest) Descriptor
deprecated
func (*RevolkTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RevolkTokenRequest.ProtoReflect.Descriptor instead.
func (*RevolkTokenRequest) GetAccessToken ¶
func (x *RevolkTokenRequest) GetAccessToken() string
func (*RevolkTokenRequest) GetClientId ¶
func (x *RevolkTokenRequest) GetClientId() string
func (*RevolkTokenRequest) GetClientSecret ¶
func (x *RevolkTokenRequest) GetClientSecret() string
func (*RevolkTokenRequest) GetLogoutSession ¶
func (x *RevolkTokenRequest) GetLogoutSession() bool
func (*RevolkTokenRequest) GetRefreshToken ¶
func (x *RevolkTokenRequest) GetRefreshToken() string
func (*RevolkTokenRequest) MakeDescribeTokenRequest ¶
func (m *RevolkTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
MakeDescribeTokenRequest todo
func (*RevolkTokenRequest) ProtoMessage ¶
func (*RevolkTokenRequest) ProtoMessage()
func (*RevolkTokenRequest) ProtoReflect ¶
func (x *RevolkTokenRequest) ProtoReflect() protoreflect.Message
func (*RevolkTokenRequest) Reset ¶
func (x *RevolkTokenRequest) Reset()
func (*RevolkTokenRequest) String ¶
func (x *RevolkTokenRequest) String() string
type ServiceClient ¶
type ServiceClient interface { IssueToken(ctx context.Context, in *IssueTokenRequest, opts ...grpc.CallOption) (*Token, error) ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*Token, error) DescribeToken(ctx context.Context, in *DescribeTokenRequest, opts ...grpc.CallOption) (*Token, error) RevolkToken(ctx context.Context, in *RevolkTokenRequest, opts ...grpc.CallOption) (*Token, error) BlockToken(ctx context.Context, in *BlockTokenRequest, opts ...grpc.CallOption) (*Token, error) ChangeNamespace(ctx context.Context, in *ChangeNamespaceRequest, opts ...grpc.CallOption) (*Token, error) QueryToken(ctx context.Context, in *QueryTokenRequest, opts ...grpc.CallOption) (*Set, error) DeleteToken(ctx context.Context, in *DeleteTokenRequest, opts ...grpc.CallOption) (*DeleteTokenResponse, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { IssueToken(context.Context, *IssueTokenRequest) (*Token, error) ValidateToken(context.Context, *ValidateTokenRequest) (*Token, error) DescribeToken(context.Context, *DescribeTokenRequest) (*Token, error) RevolkToken(context.Context, *RevolkTokenRequest) (*Token, error) BlockToken(context.Context, *BlockTokenRequest) (*Token, error) ChangeNamespace(context.Context, *ChangeNamespaceRequest) (*Token, error) QueryToken(context.Context, *QueryTokenRequest) (*Set, error) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Set ¶
type Set struct { // @gotags: bson:"total" json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` // @gotags: bson:"items" json:"items" Items []*Token `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct { // @gotags: bson:"session_id" json:"session_id" SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id" bson:"session_id"` // @gotags: bson:"_id" json:"access_token" AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token" bson:"_id"` // @gotags: bson:"refresh_token" json:"refresh_token,omitempty" RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty" bson:"refresh_token"` // @gotags: bson:"create_at" json:"create_at,omitempty" CreateAt int64 `protobuf:"varint,5,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` // @gotags: bson:"access_expired_at" json:"access_expired_at,omitempty" AccessExpiredAt int64 `` /* 134-byte string literal not displayed */ // @gotags: bson:"refresh_expired_at" json:"refresh_expired_at,omitempty" RefreshExpiredAt int64 `` /* 138-byte string literal not displayed */ // @gotags: bson:"domain" json:"domain,omitempty" Domain string `protobuf:"bytes,8,opt,name=domain,proto3" json:"domain,omitempty" bson:"domain"` // @gotags: bson:"user_type" json:"user_type" UserType types.UserType `` /* 131-byte string literal not displayed */ // @gotags: bson:"account" json:"account" Account string `protobuf:"bytes,10,opt,name=account,proto3" json:"account" bson:"account"` // @gotags: bson:"application_id" json:"application_id" ApplicationId string `protobuf:"bytes,11,opt,name=application_id,json=applicationId,proto3" json:"application_id" bson:"application_id"` // @gotags: bson:"application_name" json:"application_name" ApplicationName string `protobuf:"bytes,12,opt,name=application_name,json=applicationName,proto3" json:"application_name" bson:"application_name"` // @gotags: bson:"client_id" json:"client_id" ClientId string `protobuf:"bytes,13,opt,name=client_id,json=clientId,proto3" json:"client_id" bson:"client_id"` // @gotags: bson:"start_grant_type" json:"start_grant_type" StartGrantType GrantType `` /* 161-byte string literal not displayed */ // @gotags: bson:"grant_type" json:"grant_type" GrantType GrantType `` /* 138-byte string literal not displayed */ // @gotags: bson:"type" json:"type" Type TokenType `protobuf:"varint,16,opt,name=type,proto3,enum=infraboard.keyauth.token.TokenType" json:"type" bson:"type"` // @gotags: bson:"namespace_id" json:"namespace_id" NamespaceId string `protobuf:"bytes,25,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id" bson:"namespace_id"` // @gotags: bson:"namespace_name" json:"namespace_name" NamespaceName string `protobuf:"bytes,27,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name" bson:"namespace_name"` // @gotags: bson:"scope" json:"scope" Scope string `protobuf:"bytes,17,opt,name=scope,proto3" json:"scope" bson:"scope"` // @gotags: bson:"description" json:"description" Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description" bson:"description"` // @gotags: bson:"is_block" json:"is_block" IsBlock bool `protobuf:"varint,19,opt,name=is_block,json=isBlock,proto3" json:"is_block" bson:"is_block"` // @gotags: bson:"block_type" json:"block_type" BlockType BlockType `` /* 138-byte string literal not displayed */ // @gotags: bson:"block_at" json:"block_at" BlockAt int64 `protobuf:"varint,21,opt,name=block_at,json=blockAt,proto3" json:"block_at" bson:"block_at"` // @gotags: bson:"block_reason" json:"block_reason" BlockReason string `protobuf:"bytes,22,opt,name=block_reason,json=blockReason,proto3" json:"block_reason" bson:"block_reason"` // @gotags: bson:"-" json:"-" RemoteIp string `protobuf:"bytes,23,opt,name=remote_ip,json=remoteIp,proto3" json:"-" bson:"-"` // @gotags: bson:"-" json:"-" UserAgent string `protobuf:"bytes,24,opt,name=user_agent,json=userAgent,proto3" json:"-" bson:"-"` // @gotags: bson:"-" json:"available_namespace" AvailableNamespace []string `protobuf:"bytes,26,rep,name=available_namespace,json=availableNamespace,proto3" json:"available_namespace" bson:"-"` // contains filtered or unexported fields }
func (*Token) CheckAccessIsExpired ¶
CheckAccessIsExpired 检测token是否过期
func (*Token) CheckRefreshIsExpired ¶
CheckRefreshIsExpired 检测刷新token是否过期
func (*Token) CheckTokenApplication ¶
CheckTokenApplication 判断token是否属于该应用
func (*Token) Descriptor
deprecated
func (*Token) GetAccessExpiredAt ¶
func (*Token) GetAccessToken ¶
func (*Token) GetAccount ¶
func (*Token) GetApplicationId ¶
func (*Token) GetApplicationName ¶
func (*Token) GetAvailableNamespace ¶
func (*Token) GetBlockAt ¶
func (*Token) GetBlockReason ¶
func (*Token) GetBlockType ¶
func (*Token) GetClientId ¶
func (*Token) GetCreateAt ¶
func (*Token) GetDescription ¶
func (*Token) GetGrantType ¶
func (*Token) GetIsBlock ¶
func (*Token) GetNamespaceId ¶ added in v0.7.2
func (*Token) GetNamespaceName ¶ added in v0.7.2
func (*Token) GetRefreshExpiredAt ¶
func (*Token) GetRefreshToken ¶
func (*Token) GetRemoteIp ¶
func (*Token) GetSessionId ¶
func (*Token) GetStartGrantType ¶
func (*Token) GetUserAgent ¶
func (*Token) GetUserType ¶
func (*Token) HasNamespace ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type TokenType ¶
type TokenType int32
func ParseTokenTypeFromString ¶
ParseTokenTypeFromString Parse TokenType from string
func (TokenType) Descriptor ¶
func (TokenType) Descriptor() protoreflect.EnumDescriptor
func (TokenType) EnumDescriptor
deprecated
func (TokenType) Number ¶
func (x TokenType) Number() protoreflect.EnumNumber
func (TokenType) Type ¶
func (TokenType) Type() protoreflect.EnumType
func (*TokenType) UnmarshalJSON ¶
UnmarshalJSON todo
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) BlockToken ¶
func (UnimplementedServiceServer) BlockToken(context.Context, *BlockTokenRequest) (*Token, error)
func (UnimplementedServiceServer) ChangeNamespace ¶
func (UnimplementedServiceServer) ChangeNamespace(context.Context, *ChangeNamespaceRequest) (*Token, error)
func (UnimplementedServiceServer) DeleteToken ¶
func (UnimplementedServiceServer) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error)
func (UnimplementedServiceServer) DescribeToken ¶
func (UnimplementedServiceServer) DescribeToken(context.Context, *DescribeTokenRequest) (*Token, error)
func (UnimplementedServiceServer) IssueToken ¶
func (UnimplementedServiceServer) IssueToken(context.Context, *IssueTokenRequest) (*Token, error)
func (UnimplementedServiceServer) QueryToken ¶
func (UnimplementedServiceServer) QueryToken(context.Context, *QueryTokenRequest) (*Set, error)
func (UnimplementedServiceServer) RevolkToken ¶
func (UnimplementedServiceServer) RevolkToken(context.Context, *RevolkTokenRequest) (*Token, error)
func (UnimplementedServiceServer) ValidateToken ¶
func (UnimplementedServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*Token, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.
type ValidateTokenRequest ¶
type ValidateTokenRequest struct { NamespaceId string `protobuf:"bytes,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` EndpointId string `protobuf:"bytes,2,opt,name=endpoint_id,json=endpointId,proto3" json:"endpoint_id,omitempty"` AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func NewValidateTokenRequest ¶
func NewValidateTokenRequest() *ValidateTokenRequest
NewValidateTokenRequest 实例化
func (*ValidateTokenRequest) Descriptor
deprecated
func (*ValidateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
func (*ValidateTokenRequest) GetAccessToken ¶
func (x *ValidateTokenRequest) GetAccessToken() string
func (*ValidateTokenRequest) GetEndpointId ¶
func (x *ValidateTokenRequest) GetEndpointId() string
func (*ValidateTokenRequest) GetNamespaceId ¶
func (x *ValidateTokenRequest) GetNamespaceId() string
func (*ValidateTokenRequest) GetRefreshToken ¶
func (x *ValidateTokenRequest) GetRefreshToken() string
func (*ValidateTokenRequest) MakeDescribeTokenRequest ¶
func (m *ValidateTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
MakeDescribeTokenRequest todo
func (*ValidateTokenRequest) ProtoMessage ¶
func (*ValidateTokenRequest) ProtoMessage()
func (*ValidateTokenRequest) ProtoReflect ¶
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
func (*ValidateTokenRequest) Reset ¶
func (x *ValidateTokenRequest) Reset()
func (*ValidateTokenRequest) String ¶
func (x *ValidateTokenRequest) String() string
func (*ValidateTokenRequest) Validate ¶
func (m *ValidateTokenRequest) Validate() error
Validate 校验参数