Documentation ¶
Index ¶
- Variables
- func HttpEntry() *http.EntrySet
- func MakeBearer(lenth int) string
- func RegisterTokenServiceServer(s *grpc.Server, srv TokenServiceServer)
- 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 (*ChangeNamespaceRequest) ProtoMessage()
- func (x *ChangeNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *ChangeNamespaceRequest) Reset()
- func (x *ChangeNamespaceRequest) String() string
- type DeleteTokenRequest
- func (*DeleteTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTokenRequest) GetAccessToken() []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) 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() *page.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 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) GetNamespace() 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 TokenServiceClient
- type TokenServiceServer
- 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 UnimplementedTokenServiceServer
- func (UnimplementedTokenServiceServer) BlockToken(context.Context, *BlockTokenRequest) (*Token, error)
- func (UnimplementedTokenServiceServer) ChangeNamespace(context.Context, *ChangeNamespaceRequest) (*Token, error)
- func (UnimplementedTokenServiceServer) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error)
- func (UnimplementedTokenServiceServer) DescribeToken(context.Context, *DescribeTokenRequest) (*Token, error)
- func (UnimplementedTokenServiceServer) IssueToken(context.Context, *IssueTokenRequest) (*Token, error)
- func (UnimplementedTokenServiceServer) QueryToken(context.Context, *QueryTokenRequest) (*Set, error)
- func (UnimplementedTokenServiceServer) RevolkToken(context.Context, *RevolkTokenRequest) (*Token, error)
- func (UnimplementedTokenServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*Token, error)
- type UnsafeTokenServiceServer
- 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 ¶
This section is empty.
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", } GrantType_value = map[string]int32{ "NULL": 0, "UNKNOWN": 1, "PASSWORD": 2, "LDAP": 3, "REFRESH": 4, "ACCESS": 5, "CLIENT": 6, "AUTH_CODE": 7, "IMPLICIT": 8, } )
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_pkg_token_pb_request_proto protoreflect.FileDescriptor
var File_pkg_token_pb_service_proto protoreflect.FileDescriptor
var File_pkg_token_pb_token_proto protoreflect.FileDescriptor
Functions ¶
func MakeBearer ¶
MakeBearer https://tools.ietf.org/html/rfc6750#section-2.1 b64token = 1*( ALPHA / DIGIT /"-" / "." / "_" / "~" / "+" / "/" ) *"="
func RegisterTokenServiceServer ¶ added in v0.2.0
func RegisterTokenServiceServer(s *grpc.Server, srv TokenServiceServer)
Types ¶
type BlockTokenRequest ¶ added in v0.2.0
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 `protobuf:"varint,3,opt,name=block_type,json=blockType,proto3,enum=keyauth.token.BlockType" json:"block_type,omitempty"` // contains filtered or unexported fields }
func NewBlockTokenRequest ¶ added in v0.2.0
func NewBlockTokenRequest(accessToken string, bt BlockType, reason string) *BlockTokenRequest
NewBlockTokenRequest todo
func (*BlockTokenRequest) Descriptor
deprecated
added in
v0.2.0
func (*BlockTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockTokenRequest.ProtoReflect.Descriptor instead.
func (*BlockTokenRequest) GetAccessToken ¶ added in v0.2.0
func (x *BlockTokenRequest) GetAccessToken() string
func (*BlockTokenRequest) GetBlockReason ¶ added in v0.2.0
func (x *BlockTokenRequest) GetBlockReason() string
func (*BlockTokenRequest) GetBlockType ¶ added in v0.2.0
func (x *BlockTokenRequest) GetBlockType() BlockType
func (*BlockTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*BlockTokenRequest) ProtoMessage()
func (*BlockTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *BlockTokenRequest) ProtoReflect() protoreflect.Message
func (*BlockTokenRequest) Reset ¶ added in v0.2.0
func (x *BlockTokenRequest) Reset()
func (*BlockTokenRequest) String ¶ added in v0.2.0
func (x *BlockTokenRequest) String() string
type BlockType ¶ added in v0.2.0
type BlockType int32
func ParseBlockTypeFromString ¶ added in v0.2.0
ParseBlockTypeFromString Parse BlockType from string
func (BlockType) Descriptor ¶ added in v0.2.0
func (BlockType) Descriptor() protoreflect.EnumDescriptor
func (BlockType) EnumDescriptor
deprecated
added in
v0.2.0
func (BlockType) MarshalJSON ¶ added in v0.2.0
MarshalJSON todo
func (BlockType) Number ¶ added in v0.2.0
func (x BlockType) Number() protoreflect.EnumNumber
func (BlockType) Type ¶ added in v0.2.0
func (BlockType) Type() protoreflect.EnumType
func (*BlockType) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON todo
type ChangeNamespaceRequest ¶ added in v0.3.2
type ChangeNamespaceRequest struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // contains filtered or unexported fields }
func NewChangeNamespaceRequest ¶ added in v0.3.2
func NewChangeNamespaceRequest() *ChangeNamespaceRequest
func (*ChangeNamespaceRequest) Descriptor
deprecated
added in
v0.3.2
func (*ChangeNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChangeNamespaceRequest.ProtoReflect.Descriptor instead.
func (*ChangeNamespaceRequest) GetNamespace ¶ added in v0.3.2
func (x *ChangeNamespaceRequest) GetNamespace() string
func (*ChangeNamespaceRequest) ProtoMessage ¶ added in v0.3.2
func (*ChangeNamespaceRequest) ProtoMessage()
func (*ChangeNamespaceRequest) ProtoReflect ¶ added in v0.3.2
func (x *ChangeNamespaceRequest) ProtoReflect() protoreflect.Message
func (*ChangeNamespaceRequest) Reset ¶ added in v0.3.2
func (x *ChangeNamespaceRequest) Reset()
func (*ChangeNamespaceRequest) String ¶ added in v0.3.2
func (x *ChangeNamespaceRequest) String() string
type DeleteTokenRequest ¶ added in v0.3.2
type DeleteTokenRequest struct { AccessToken []string `protobuf:"bytes,1,rep,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // contains filtered or unexported fields }
func NewDeleteTokenRequest ¶ added in v0.3.2
func NewDeleteTokenRequest() *DeleteTokenRequest
func (*DeleteTokenRequest) Descriptor
deprecated
added in
v0.3.2
func (*DeleteTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTokenRequest.ProtoReflect.Descriptor instead.
func (*DeleteTokenRequest) GetAccessToken ¶ added in v0.3.2
func (x *DeleteTokenRequest) GetAccessToken() []string
func (*DeleteTokenRequest) ProtoMessage ¶ added in v0.3.2
func (*DeleteTokenRequest) ProtoMessage()
func (*DeleteTokenRequest) ProtoReflect ¶ added in v0.3.2
func (x *DeleteTokenRequest) ProtoReflect() protoreflect.Message
func (*DeleteTokenRequest) Reset ¶ added in v0.3.2
func (x *DeleteTokenRequest) Reset()
func (*DeleteTokenRequest) String ¶ added in v0.3.2
func (x *DeleteTokenRequest) String() string
func (*DeleteTokenRequest) Validate ¶ added in v0.3.2
func (req *DeleteTokenRequest) Validate() error
type DeleteTokenResponse ¶ added in v0.3.2
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 ¶ added in v0.3.2
func NewDeleteTokenResponse() *DeleteTokenResponse
func (*DeleteTokenResponse) Descriptor
deprecated
added in
v0.3.2
func (*DeleteTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTokenResponse.ProtoReflect.Descriptor instead.
func (*DeleteTokenResponse) GetFailed ¶ added in v0.3.2
func (x *DeleteTokenResponse) GetFailed() []string
func (*DeleteTokenResponse) GetMessage ¶ added in v0.3.2
func (x *DeleteTokenResponse) GetMessage() string
func (*DeleteTokenResponse) GetSuccess ¶ added in v0.3.2
func (x *DeleteTokenResponse) GetSuccess() []string
func (*DeleteTokenResponse) ProtoMessage ¶ added in v0.3.2
func (*DeleteTokenResponse) ProtoMessage()
func (*DeleteTokenResponse) ProtoReflect ¶ added in v0.3.2
func (x *DeleteTokenResponse) ProtoReflect() protoreflect.Message
func (*DeleteTokenResponse) Reset ¶ added in v0.3.2
func (x *DeleteTokenResponse) Reset()
func (*DeleteTokenResponse) String ¶ added in v0.3.2
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 ¶ added in v0.2.0
func NewDescribeTokenRequestWithAccessToken(at string) *DescribeTokenRequest
NewDescribeTokenRequestWithAccessToken 实例化
func (*DescribeTokenRequest) Descriptor
deprecated
added in
v0.2.0
func (*DescribeTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeTokenRequest.ProtoReflect.Descriptor instead.
func (*DescribeTokenRequest) GetAccessToken ¶ added in v0.2.0
func (x *DescribeTokenRequest) GetAccessToken() string
func (*DescribeTokenRequest) GetRefreshToken ¶ added in v0.2.0
func (x *DescribeTokenRequest) GetRefreshToken() string
func (*DescribeTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*DescribeTokenRequest) ProtoMessage()
func (*DescribeTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *DescribeTokenRequest) ProtoReflect() protoreflect.Message
func (*DescribeTokenRequest) Reset ¶ added in v0.2.0
func (x *DescribeTokenRequest) Reset()
func (*DescribeTokenRequest) String ¶ added in v0.2.0
func (x *DescribeTokenRequest) String() string
type GrantType ¶
type GrantType int32
func ParseGrantTypeFromString ¶ added in v0.2.0
ParseGrantTypeFromString Parse GrantType from string
func (GrantType) Descriptor ¶ added in v0.2.0
func (GrantType) Descriptor() protoreflect.EnumDescriptor
func (GrantType) EnumDescriptor
deprecated
added in
v0.2.0
func (GrantType) MarshalJSON ¶ added in v0.2.0
MarshalJSON todo
func (GrantType) Number ¶ added in v0.2.0
func (x GrantType) Number() protoreflect.EnumNumber
func (GrantType) Type ¶ added in v0.2.0
func (GrantType) Type() protoreflect.EnumType
func (*GrantType) UnmarshalJSON ¶ added in v0.2.0
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 `protobuf:"varint,10,opt,name=grant_type,json=grantType,proto3,enum=keyauth.token.GrantType" json:"grant_type,omitempty"` Type TokenType `protobuf:"varint,11,opt,name=type,proto3,enum=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"` // 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 ¶ added in v0.2.0
func (m *IssueTokenRequest) AbnormalUserCheckKey() string
AbnormalUserCheckKey todo
func (*IssueTokenRequest) Descriptor
deprecated
added in
v0.2.0
func (*IssueTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssueTokenRequest.ProtoReflect.Descriptor instead.
func (*IssueTokenRequest) GetAccessExpiredAt ¶ added in v0.3.2
func (x *IssueTokenRequest) GetAccessExpiredAt() int64
func (*IssueTokenRequest) GetAccessToken ¶ added in v0.2.0
func (x *IssueTokenRequest) GetAccessToken() string
func (*IssueTokenRequest) GetAuthCode ¶ added in v0.2.0
func (x *IssueTokenRequest) GetAuthCode() string
func (*IssueTokenRequest) GetClientId ¶ added in v0.2.0
func (x *IssueTokenRequest) GetClientId() string
func (*IssueTokenRequest) GetClientSecret ¶ added in v0.2.0
func (x *IssueTokenRequest) GetClientSecret() string
func (*IssueTokenRequest) GetDescription ¶ added in v0.3.2
func (x *IssueTokenRequest) GetDescription() string
func (*IssueTokenRequest) GetDomainNameFromAccount ¶ added in v0.2.0
func (m *IssueTokenRequest) GetDomainNameFromAccount() string
GetDomainNameFromAccount todo
func (*IssueTokenRequest) GetGrantType ¶ added in v0.2.0
func (x *IssueTokenRequest) GetGrantType() GrantType
func (*IssueTokenRequest) GetPassword ¶ added in v0.2.0
func (x *IssueTokenRequest) GetPassword() string
func (*IssueTokenRequest) GetRefreshToken ¶ added in v0.2.0
func (x *IssueTokenRequest) GetRefreshToken() string
func (*IssueTokenRequest) GetRemoteIp ¶ added in v0.2.0
func (x *IssueTokenRequest) GetRemoteIp() string
func (*IssueTokenRequest) GetScope ¶ added in v0.2.0
func (x *IssueTokenRequest) GetScope() string
func (*IssueTokenRequest) GetState ¶ added in v0.2.0
func (x *IssueTokenRequest) GetState() string
func (*IssueTokenRequest) GetType ¶ added in v0.2.0
func (x *IssueTokenRequest) GetType() TokenType
func (*IssueTokenRequest) GetUserAgent ¶ added in v0.2.0
func (x *IssueTokenRequest) GetUserAgent() string
func (*IssueTokenRequest) GetUsername ¶ added in v0.2.0
func (x *IssueTokenRequest) GetUsername() string
func (*IssueTokenRequest) GetVerifyCode ¶ added in v0.2.0
func (x *IssueTokenRequest) GetVerifyCode() string
func (*IssueTokenRequest) IsLoginRequest ¶ added in v0.3.2
func (m *IssueTokenRequest) IsLoginRequest() bool
func (*IssueTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*IssueTokenRequest) ProtoMessage()
func (*IssueTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *IssueTokenRequest) ProtoReflect() protoreflect.Message
func (*IssueTokenRequest) Reset ¶ added in v0.2.0
func (x *IssueTokenRequest) Reset()
func (*IssueTokenRequest) String ¶ added in v0.2.0
func (x *IssueTokenRequest) String() string
func (*IssueTokenRequest) WithRemoteIP ¶ added in v0.2.0
func (m *IssueTokenRequest) WithRemoteIP(ip string)
WithRemoteIP todo
func (*IssueTokenRequest) WithRemoteIPFromHTTP ¶ added in v0.2.0
func (m *IssueTokenRequest) WithRemoteIPFromHTTP(r *http.Request)
WithRemoteIPFromHTTP todo
func (*IssueTokenRequest) WithUserAgent ¶ added in v0.2.0
func (m *IssueTokenRequest) WithUserAgent(userAgent string)
WithUserAgent todo
type QueryTokenRequest ¶
type QueryTokenRequest struct { Page *page.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 `protobuf:"varint,3,opt,name=grant_type,json=grantType,proto3,enum=keyauth.token.GrantType" json:"grant_type,omitempty"` // contains filtered or unexported fields }
func NewQueryTokenRequest ¶
func NewQueryTokenRequest(page *page.PageRequest) *QueryTokenRequest
NewQueryTokenRequest 请求实例
func NewQueryTokenRequestFromHTTP ¶ added in v0.3.2
func NewQueryTokenRequestFromHTTP(r *http.Request) (*QueryTokenRequest, error)
NewQueryDepartmentRequestFromHTTP 列表查询请求
func (*QueryTokenRequest) Descriptor
deprecated
added in
v0.2.0
func (*QueryTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryTokenRequest.ProtoReflect.Descriptor instead.
func (*QueryTokenRequest) GetAccount ¶ added in v0.3.2
func (x *QueryTokenRequest) GetAccount() string
func (*QueryTokenRequest) GetApplicationId ¶ added in v0.2.0
func (x *QueryTokenRequest) GetApplicationId() string
func (*QueryTokenRequest) GetGrantType ¶ added in v0.2.0
func (x *QueryTokenRequest) GetGrantType() GrantType
func (*QueryTokenRequest) GetPage ¶ added in v0.2.0
func (x *QueryTokenRequest) GetPage() *page.PageRequest
func (*QueryTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*QueryTokenRequest) ProtoMessage()
func (*QueryTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *QueryTokenRequest) ProtoReflect() protoreflect.Message
func (*QueryTokenRequest) Reset ¶ added in v0.2.0
func (x *QueryTokenRequest) Reset()
func (*QueryTokenRequest) String ¶ added in v0.2.0
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
added in
v0.2.0
func (*RevolkTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RevolkTokenRequest.ProtoReflect.Descriptor instead.
func (*RevolkTokenRequest) GetAccessToken ¶ added in v0.2.0
func (x *RevolkTokenRequest) GetAccessToken() string
func (*RevolkTokenRequest) GetClientId ¶ added in v0.2.0
func (x *RevolkTokenRequest) GetClientId() string
func (*RevolkTokenRequest) GetClientSecret ¶ added in v0.2.0
func (x *RevolkTokenRequest) GetClientSecret() string
func (*RevolkTokenRequest) GetLogoutSession ¶ added in v0.2.0
func (x *RevolkTokenRequest) GetLogoutSession() bool
func (*RevolkTokenRequest) GetRefreshToken ¶ added in v0.2.0
func (x *RevolkTokenRequest) GetRefreshToken() string
func (*RevolkTokenRequest) MakeDescribeTokenRequest ¶ added in v0.2.0
func (m *RevolkTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
MakeDescribeTokenRequest todo
func (*RevolkTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*RevolkTokenRequest) ProtoMessage()
func (*RevolkTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *RevolkTokenRequest) ProtoReflect() protoreflect.Message
func (*RevolkTokenRequest) Reset ¶ added in v0.2.0
func (x *RevolkTokenRequest) Reset()
func (*RevolkTokenRequest) String ¶ added in v0.2.0
func (x *RevolkTokenRequest) String() string
func (*RevolkTokenRequest) Validate ¶ added in v0.2.0
func (m *RevolkTokenRequest) Validate() error
Validate todo
type Set ¶
type Set struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` Items []*Token `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
added in
v0.2.0
func (*Set) ProtoMessage ¶ added in v0.2.0
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶ added in v0.2.0
func (x *Set) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct { SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id" bson:"session_id"` AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token" bson:"_id"` RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty" bson:"refresh_token"` CreateAt int64 `protobuf:"varint,5,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` AccessExpiredAt int64 `` /* 134-byte string literal not displayed */ RefreshExpiredAt int64 `` /* 138-byte string literal not displayed */ Domain string `protobuf:"bytes,8,opt,name=domain,proto3" json:"domain,omitempty" bson:"domain"` UserType types.UserType `protobuf:"varint,9,opt,name=user_type,json=userType,proto3,enum=keyauth.user.UserType" json:"user_type" bson:"user_type"` Account string `protobuf:"bytes,10,opt,name=account,proto3" json:"account" bson:"account"` ApplicationId string `protobuf:"bytes,11,opt,name=application_id,json=applicationId,proto3" json:"application_id" bson:"application_id"` ApplicationName string `protobuf:"bytes,12,opt,name=application_name,json=applicationName,proto3" json:"application_name" bson:"application_name"` ClientId string `protobuf:"bytes,13,opt,name=client_id,json=clientId,proto3" json:"client_id" bson:"client_id"` StartGrantType GrantType `` /* 150-byte string literal not displayed */ GrantType GrantType `` /* 127-byte string literal not displayed */ Type TokenType `protobuf:"varint,16,opt,name=type,proto3,enum=keyauth.token.TokenType" json:"type" bson:"type"` Namespace string `protobuf:"bytes,25,opt,name=namespace,proto3" json:"namespace" bson:"namespace"` Scope string `protobuf:"bytes,17,opt,name=scope,proto3" json:"scope" bson:"scope"` Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description" bson:"description"` IsBlock bool `protobuf:"varint,19,opt,name=is_block,json=isBlock,proto3" json:"is_block" bson:"is_block"` BlockType BlockType `` /* 127-byte string literal not displayed */ BlockAt int64 `protobuf:"varint,21,opt,name=block_at,json=blockAt,proto3" json:"block_at" bson:"block_at"` BlockReason string `protobuf:"bytes,22,opt,name=block_reason,json=blockReason,proto3" json:"block_reason" bson:"block_reason"` RemoteIp string `protobuf:"bytes,23,opt,name=remote_ip,json=remoteIp,proto3" json:"-" bson:"-"` UserAgent string `protobuf:"bytes,24,opt,name=user_agent,json=userAgent,proto3" json:"-" bson:"-"` AvailableNamespace []string `protobuf:"bytes,26,rep,name=available_namespace,json=availableNamespace,proto3" json:"available_namespace" bson:"-"` // contains filtered or unexported fields }
func (*Token) BlockMessage ¶ added in v0.2.0
BlockMessage todo
func (*Token) CheckAccessIsExpired ¶
CheckAccessIsExpired 检测token是否过期
func (*Token) CheckRefreshIsExpired ¶
CheckRefreshIsExpired 检测刷新token是否过期
func (*Token) CheckTokenApplication ¶
CheckTokenApplication 判断token是否属于该应用
func (*Token) Descriptor
deprecated
added in
v0.2.0
func (*Token) GetAccessExpiredAt ¶ added in v0.2.0
func (*Token) GetAccessToken ¶ added in v0.2.0
func (*Token) GetAccount ¶ added in v0.2.0
func (*Token) GetApplicationId ¶ added in v0.2.0
func (*Token) GetApplicationName ¶ added in v0.2.0
func (*Token) GetAvailableNamespace ¶ added in v0.3.2
func (*Token) GetBlockAt ¶ added in v0.2.0
func (*Token) GetBlockReason ¶ added in v0.2.0
func (*Token) GetBlockType ¶ added in v0.2.0
func (*Token) GetClientId ¶ added in v0.2.0
func (*Token) GetCreateAt ¶ added in v0.2.0
func (*Token) GetDescription ¶ added in v0.2.0
func (*Token) GetGrantType ¶ added in v0.2.0
func (*Token) GetIsBlock ¶ added in v0.2.0
func (*Token) GetNamespace ¶ added in v0.3.2
func (*Token) GetRefreshExpiredAt ¶ added in v0.2.0
func (*Token) GetRefreshToken ¶ added in v0.2.0
func (*Token) GetRemoteIp ¶ added in v0.2.0
func (*Token) GetSessionId ¶ added in v0.2.0
func (*Token) GetStartGrantType ¶ added in v0.2.0
func (*Token) GetUserAgent ¶ added in v0.2.0
func (*Token) GetUserType ¶ added in v0.2.0
func (*Token) HasNamespace ¶ added in v0.3.2
func (*Token) IsAvailable ¶ added in v0.2.0
IsAvailable 判断一个token的可用性
func (*Token) ProtoMessage ¶ added in v0.2.0
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶ added in v0.2.0
func (x *Token) ProtoReflect() protoreflect.Message
func (*Token) WithRemoteIP ¶ added in v0.2.0
WithRemoteIP todo
func (*Token) WithUerAgent ¶ added in v0.2.0
WithUerAgent todo
type TokenServiceClient ¶ added in v0.2.0
type TokenServiceClient 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) }
TokenServiceClient is the client API for TokenService 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 NewTokenServiceClient ¶ added in v0.2.0
func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient
type TokenServiceServer ¶ added in v0.2.0
type TokenServiceServer 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 }
TokenServiceServer is the server API for TokenService service. All implementations must embed UnimplementedTokenServiceServer for forward compatibility
type TokenType ¶ added in v0.2.0
type TokenType int32
func ParseTokenTypeFromString ¶ added in v0.2.0
ParseTokenTypeFromString Parse TokenType from string
func (TokenType) Descriptor ¶ added in v0.2.0
func (TokenType) Descriptor() protoreflect.EnumDescriptor
func (TokenType) EnumDescriptor
deprecated
added in
v0.2.0
func (TokenType) MarshalJSON ¶ added in v0.2.0
MarshalJSON todo
func (TokenType) Number ¶ added in v0.2.0
func (x TokenType) Number() protoreflect.EnumNumber
func (TokenType) Type ¶ added in v0.2.0
func (TokenType) Type() protoreflect.EnumType
func (*TokenType) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON todo
type UnimplementedTokenServiceServer ¶ added in v0.2.0
type UnimplementedTokenServiceServer struct { }
UnimplementedTokenServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTokenServiceServer) BlockToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) BlockToken(context.Context, *BlockTokenRequest) (*Token, error)
func (UnimplementedTokenServiceServer) ChangeNamespace ¶ added in v0.3.2
func (UnimplementedTokenServiceServer) ChangeNamespace(context.Context, *ChangeNamespaceRequest) (*Token, error)
func (UnimplementedTokenServiceServer) DeleteToken ¶ added in v0.3.2
func (UnimplementedTokenServiceServer) DeleteToken(context.Context, *DeleteTokenRequest) (*DeleteTokenResponse, error)
func (UnimplementedTokenServiceServer) DescribeToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) DescribeToken(context.Context, *DescribeTokenRequest) (*Token, error)
func (UnimplementedTokenServiceServer) IssueToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) IssueToken(context.Context, *IssueTokenRequest) (*Token, error)
func (UnimplementedTokenServiceServer) QueryToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) QueryToken(context.Context, *QueryTokenRequest) (*Set, error)
func (UnimplementedTokenServiceServer) RevolkToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) RevolkToken(context.Context, *RevolkTokenRequest) (*Token, error)
func (UnimplementedTokenServiceServer) ValidateToken ¶ added in v0.2.0
func (UnimplementedTokenServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*Token, error)
type UnsafeTokenServiceServer ¶ added in v0.2.0
type UnsafeTokenServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenServiceServer 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
added in
v0.2.0
func (*ValidateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
func (*ValidateTokenRequest) GetAccessToken ¶ added in v0.2.0
func (x *ValidateTokenRequest) GetAccessToken() string
func (*ValidateTokenRequest) GetEndpointId ¶ added in v0.2.0
func (x *ValidateTokenRequest) GetEndpointId() string
func (*ValidateTokenRequest) GetNamespaceId ¶ added in v0.2.0
func (x *ValidateTokenRequest) GetNamespaceId() string
func (*ValidateTokenRequest) GetRefreshToken ¶ added in v0.2.0
func (x *ValidateTokenRequest) GetRefreshToken() string
func (*ValidateTokenRequest) MakeDescribeTokenRequest ¶ added in v0.2.0
func (m *ValidateTokenRequest) MakeDescribeTokenRequest() *DescribeTokenRequest
MakeDescribeTokenRequest todo
func (*ValidateTokenRequest) ProtoMessage ¶ added in v0.2.0
func (*ValidateTokenRequest) ProtoMessage()
func (*ValidateTokenRequest) ProtoReflect ¶ added in v0.2.0
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
func (*ValidateTokenRequest) Reset ¶ added in v0.2.0
func (x *ValidateTokenRequest) Reset()
func (*ValidateTokenRequest) String ¶ added in v0.2.0
func (x *ValidateTokenRequest) String() string
func (*ValidateTokenRequest) Validate ¶
func (m *ValidateTokenRequest) Validate() error
Validate 校验参数