Documentation ¶
Index ¶
- Variables
- func Oauth2ErrClientIdAlreadyExists() errors.Error
- func Oauth2ErrInternalError() errors.Error
- func Oauth2ErrInternalStore() errors.Error
- func Oauth2ErrInvalidPluginId() errors.Error
- func Oauth2ErrInvalidToken() errors.Error
- func Oauth2ErrPasswordNotCompliant() errors.Error
- func Oauth2ErrPasswordNotMatch() errors.Error
- func Oauth2ErrPermissionDenied() errors.Error
- func Oauth2ErrSecretNotMatch() errors.Error
- func Oauth2ErrUnknown() errors.Error
- func RegisterOauth2HTTPServer(container *go_restful.Container, srv Oauth2HTTPServer)
- func RegisterOauth2Server(s grpc.ServiceRegistrar, srv Oauth2Server)
- type AddPluginWhiteListRequest
- func (*AddPluginWhiteListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddPluginWhiteListRequest) GetPluginId() string
- func (*AddPluginWhiteListRequest) ProtoMessage()
- func (x *AddPluginWhiteListRequest) ProtoReflect() protoreflect.Message
- func (x *AddPluginWhiteListRequest) Reset()
- func (x *AddPluginWhiteListRequest) String() string
- type Error
- type IssueAdminTokenRequest
- func (*IssueAdminTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IssueAdminTokenRequest) GetPassword() string
- func (*IssueAdminTokenRequest) ProtoMessage()
- func (x *IssueAdminTokenRequest) ProtoReflect() protoreflect.Message
- func (x *IssueAdminTokenRequest) Reset()
- func (x *IssueAdminTokenRequest) String() string
- type IssuePluginTokenRequest
- func (*IssuePluginTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IssuePluginTokenRequest) GetClientId() string
- func (x *IssuePluginTokenRequest) GetClientSecret() string
- func (*IssuePluginTokenRequest) ProtoMessage()
- func (x *IssuePluginTokenRequest) ProtoReflect() protoreflect.Message
- func (x *IssuePluginTokenRequest) Reset()
- func (x *IssuePluginTokenRequest) String() string
- type IssueTokenResponse
- func (*IssueTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *IssueTokenResponse) GetAccessToken() string
- func (x *IssueTokenResponse) GetExpiresIn() int32
- func (x *IssueTokenResponse) GetRefreshToken() string
- func (x *IssueTokenResponse) GetTokenType() string
- func (*IssueTokenResponse) ProtoMessage()
- func (x *IssueTokenResponse) ProtoReflect() protoreflect.Message
- func (x *IssueTokenResponse) Reset()
- func (x *IssueTokenResponse) String() string
- type Oauth2Client
- type Oauth2HTTPHandler
- func (h *Oauth2HTTPHandler) AddPluginWhiteList(req *go_restful.Request, resp *go_restful.Response)
- func (h *Oauth2HTTPHandler) IssueAdminToken(req *go_restful.Request, resp *go_restful.Response)
- func (h *Oauth2HTTPHandler) IssuePluginToken(req *go_restful.Request, resp *go_restful.Response)
- func (h *Oauth2HTTPHandler) UpdateAdminPassword(req *go_restful.Request, resp *go_restful.Response)
- func (h *Oauth2HTTPHandler) VerifyToken(req *go_restful.Request, resp *go_restful.Response)
- type Oauth2HTTPServer
- type Oauth2Server
- type UnimplementedOauth2Server
- func (UnimplementedOauth2Server) AddPluginWhiteList(context.Context, *AddPluginWhiteListRequest) (*emptypb.Empty, error)
- func (UnimplementedOauth2Server) IssueAdminToken(context.Context, *IssueAdminTokenRequest) (*IssueTokenResponse, error)
- func (UnimplementedOauth2Server) IssuePluginToken(context.Context, *IssuePluginTokenRequest) (*IssueTokenResponse, error)
- func (UnimplementedOauth2Server) UpdateAdminPassword(context.Context, *UpdateAdminPasswordRequest) (*emptypb.Empty, error)
- func (UnimplementedOauth2Server) VerifyToken(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- type UnsafeOauth2Server
- type UpdateAdminPasswordRequest
- func (*UpdateAdminPasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateAdminPasswordRequest) GetNewPassword() string
- func (*UpdateAdminPasswordRequest) ProtoMessage()
- func (x *UpdateAdminPasswordRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateAdminPasswordRequest) Reset()
- func (x *UpdateAdminPasswordRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Error_name = map[int32]string{ 0: "OAUTH2_ERR_UNKNOWN", 1: "OAUTH2_ERR_SECRET_NOT_MATCH", 2: "OAUTH2_ERR_CLIENT_ID_ALREADY_EXISTS", 3: "OAUTH2_ERR_INVALID_PLUGIN_ID", 4: "OAUTH2_ERR_INTERNAL_STORE", 5: "OAUTH2_ERR_INTERNAL_ERROR", 6: "OAUTH2_ERR_PASSWORD_NOT_MATCH", 7: "OAUTH2_ERR_INVALID_TOKEN", 8: "OAUTH2_ERR_PERMISSION_DENIED", 9: "OAUTH2_ERR_PASSWORD_NOT_COMPLIANT", } Error_value = map[string]int32{ "OAUTH2_ERR_UNKNOWN": 0, "OAUTH2_ERR_SECRET_NOT_MATCH": 1, "OAUTH2_ERR_CLIENT_ID_ALREADY_EXISTS": 2, "OAUTH2_ERR_INVALID_PLUGIN_ID": 3, "OAUTH2_ERR_INTERNAL_STORE": 4, "OAUTH2_ERR_INTERNAL_ERROR": 5, "OAUTH2_ERR_PASSWORD_NOT_MATCH": 6, "OAUTH2_ERR_INVALID_TOKEN": 7, "OAUTH2_ERR_PERMISSION_DENIED": 8, "OAUTH2_ERR_PASSWORD_NOT_COMPLIANT": 9, } )
Enum value maps for Error.
var File_api_oauth2_v1_error_proto protoreflect.FileDescriptor
var File_api_oauth2_v1_oauth2_proto protoreflect.FileDescriptor
var Oauth2_ServiceDesc = grpc.ServiceDesc{ ServiceName: "io.tkeel.rudder.api.oauth2.v1.Oauth2", HandlerType: (*Oauth2Server)(nil), Methods: []grpc.MethodDesc{ { MethodName: "IssuePluginToken", Handler: _Oauth2_IssuePluginToken_Handler, }, { MethodName: "AddPluginWhiteList", Handler: _Oauth2_AddPluginWhiteList_Handler, }, { MethodName: "IssueAdminToken", Handler: _Oauth2_IssueAdminToken_Handler, }, { MethodName: "VerifyToken", Handler: _Oauth2_VerifyToken_Handler, }, { MethodName: "UpdateAdminPassword", Handler: _Oauth2_UpdateAdminPassword_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/oauth2/v1/oauth2.proto", }
Oauth2_ServiceDesc is the grpc.ServiceDesc for Oauth2 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func Oauth2ErrClientIdAlreadyExists ¶ added in v0.3.0
func Oauth2ErrInternalError ¶ added in v0.3.0
func Oauth2ErrInternalStore ¶ added in v0.3.0
func Oauth2ErrInvalidPluginId ¶ added in v0.3.0
func Oauth2ErrInvalidToken ¶ added in v0.4.0
func Oauth2ErrPasswordNotCompliant ¶ added in v0.4.0
func Oauth2ErrPasswordNotMatch ¶ added in v0.3.0
func Oauth2ErrPermissionDenied ¶ added in v0.4.0
func Oauth2ErrSecretNotMatch ¶ added in v0.3.0
func Oauth2ErrUnknown ¶ added in v0.3.0
func RegisterOauth2HTTPServer ¶
func RegisterOauth2HTTPServer(container *go_restful.Container, srv Oauth2HTTPServer)
func RegisterOauth2Server ¶
func RegisterOauth2Server(s grpc.ServiceRegistrar, srv Oauth2Server)
Types ¶
type AddPluginWhiteListRequest ¶ added in v0.3.0
type AddPluginWhiteListRequest struct { PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"` // contains filtered or unexported fields }
func (*AddPluginWhiteListRequest) Descriptor
deprecated
added in
v0.3.0
func (*AddPluginWhiteListRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddPluginWhiteListRequest.ProtoReflect.Descriptor instead.
func (*AddPluginWhiteListRequest) GetPluginId ¶ added in v0.3.0
func (x *AddPluginWhiteListRequest) GetPluginId() string
func (*AddPluginWhiteListRequest) ProtoMessage ¶ added in v0.3.0
func (*AddPluginWhiteListRequest) ProtoMessage()
func (*AddPluginWhiteListRequest) ProtoReflect ¶ added in v0.3.0
func (x *AddPluginWhiteListRequest) ProtoReflect() protoreflect.Message
func (*AddPluginWhiteListRequest) Reset ¶ added in v0.3.0
func (x *AddPluginWhiteListRequest) Reset()
func (*AddPluginWhiteListRequest) String ¶ added in v0.3.0
func (x *AddPluginWhiteListRequest) String() string
type Error ¶
type Error int32
@plugins=protoc-gen-go-errors 错误
const ( // @msg=未知类型 // @code=UNKNOWN Error_OAUTH2_ERR_UNKNOWN Error = 0 // @msg=Secret不匹配 // @code=PERMISSION_DENIED Error_OAUTH2_ERR_SECRET_NOT_MATCH Error = 1 // @msg=白名单中已存在 // @code=ALREADY_EXISTS Error_OAUTH2_ERR_CLIENT_ID_ALREADY_EXISTS Error = 2 // @msg=无效的插件ID // @code=PERMISSION_DENIED Error_OAUTH2_ERR_INVALID_PLUGIN_ID Error = 3 // @msg=请求后端存储错误 // @code=INTERNAL Error_OAUTH2_ERR_INTERNAL_STORE Error = 4 // @msg=内部错误 // @code=INTERNAL Error_OAUTH2_ERR_INTERNAL_ERROR Error = 5 // @msg=password不匹配 // @code=PERMISSION_DENIED Error_OAUTH2_ERR_PASSWORD_NOT_MATCH Error = 6 // @msg=token无效 // @code=PERMISSION_DENIED Error_OAUTH2_ERR_INVALID_TOKEN Error = 7 // @msg=无权限 // @code=PERMISSION_DENIED Error_OAUTH2_ERR_PERMISSION_DENIED Error = 8 // @msg=密码不合规范 // @code=UNKNOWN Error_OAUTH2_ERR_PASSWORD_NOT_COMPLIANT Error = 9 )
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 IssueAdminTokenRequest ¶ added in v0.3.0
type IssueAdminTokenRequest struct { Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*IssueAdminTokenRequest) Descriptor
deprecated
added in
v0.3.0
func (*IssueAdminTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssueAdminTokenRequest.ProtoReflect.Descriptor instead.
func (*IssueAdminTokenRequest) GetPassword ¶ added in v0.3.0
func (x *IssueAdminTokenRequest) GetPassword() string
func (*IssueAdminTokenRequest) ProtoMessage ¶ added in v0.3.0
func (*IssueAdminTokenRequest) ProtoMessage()
func (*IssueAdminTokenRequest) ProtoReflect ¶ added in v0.3.0
func (x *IssueAdminTokenRequest) ProtoReflect() protoreflect.Message
func (*IssueAdminTokenRequest) Reset ¶ added in v0.3.0
func (x *IssueAdminTokenRequest) Reset()
func (*IssueAdminTokenRequest) String ¶ added in v0.3.0
func (x *IssueAdminTokenRequest) String() string
type IssuePluginTokenRequest ¶ added in v0.3.0
type IssuePluginTokenRequest 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"` // contains filtered or unexported fields }
func (*IssuePluginTokenRequest) Descriptor
deprecated
added in
v0.3.0
func (*IssuePluginTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssuePluginTokenRequest.ProtoReflect.Descriptor instead.
func (*IssuePluginTokenRequest) GetClientId ¶ added in v0.3.0
func (x *IssuePluginTokenRequest) GetClientId() string
func (*IssuePluginTokenRequest) GetClientSecret ¶ added in v0.3.0
func (x *IssuePluginTokenRequest) GetClientSecret() string
func (*IssuePluginTokenRequest) ProtoMessage ¶ added in v0.3.0
func (*IssuePluginTokenRequest) ProtoMessage()
func (*IssuePluginTokenRequest) ProtoReflect ¶ added in v0.3.0
func (x *IssuePluginTokenRequest) ProtoReflect() protoreflect.Message
func (*IssuePluginTokenRequest) Reset ¶ added in v0.3.0
func (x *IssuePluginTokenRequest) Reset()
func (*IssuePluginTokenRequest) String ¶ added in v0.3.0
func (x *IssuePluginTokenRequest) String() string
type IssueTokenResponse ¶ added in v0.3.0
type IssueTokenResponse struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` ExpiresIn int32 `protobuf:"varint,4,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` // contains filtered or unexported fields }
func (*IssueTokenResponse) Descriptor
deprecated
added in
v0.3.0
func (*IssueTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use IssueTokenResponse.ProtoReflect.Descriptor instead.
func (*IssueTokenResponse) GetAccessToken ¶ added in v0.3.0
func (x *IssueTokenResponse) GetAccessToken() string
func (*IssueTokenResponse) GetExpiresIn ¶ added in v0.3.0
func (x *IssueTokenResponse) GetExpiresIn() int32
func (*IssueTokenResponse) GetRefreshToken ¶ added in v0.3.0
func (x *IssueTokenResponse) GetRefreshToken() string
func (*IssueTokenResponse) GetTokenType ¶ added in v0.3.0
func (x *IssueTokenResponse) GetTokenType() string
func (*IssueTokenResponse) ProtoMessage ¶ added in v0.3.0
func (*IssueTokenResponse) ProtoMessage()
func (*IssueTokenResponse) ProtoReflect ¶ added in v0.3.0
func (x *IssueTokenResponse) ProtoReflect() protoreflect.Message
func (*IssueTokenResponse) Reset ¶ added in v0.3.0
func (x *IssueTokenResponse) Reset()
func (*IssueTokenResponse) String ¶ added in v0.3.0
func (x *IssueTokenResponse) String() string
type Oauth2Client ¶
type Oauth2Client interface { // TKEEL_COMMENT // {"response":{"raw_data":true}} IssuePluginToken(ctx context.Context, in *IssuePluginTokenRequest, opts ...grpc.CallOption) (*IssueTokenResponse, error) AddPluginWhiteList(ctx context.Context, in *AddPluginWhiteListRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) IssueAdminToken(ctx context.Context, in *IssueAdminTokenRequest, opts ...grpc.CallOption) (*IssueTokenResponse, error) VerifyToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) UpdateAdminPassword(ctx context.Context, in *UpdateAdminPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
Oauth2Client is the client API for Oauth2 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 NewOauth2Client ¶
func NewOauth2Client(cc grpc.ClientConnInterface) Oauth2Client
type Oauth2HTTPHandler ¶
type Oauth2HTTPHandler struct {
// contains filtered or unexported fields
}
func (*Oauth2HTTPHandler) AddPluginWhiteList ¶ added in v0.3.0
func (h *Oauth2HTTPHandler) AddPluginWhiteList(req *go_restful.Request, resp *go_restful.Response)
func (*Oauth2HTTPHandler) IssueAdminToken ¶ added in v0.3.0
func (h *Oauth2HTTPHandler) IssueAdminToken(req *go_restful.Request, resp *go_restful.Response)
func (*Oauth2HTTPHandler) IssuePluginToken ¶ added in v0.3.0
func (h *Oauth2HTTPHandler) IssuePluginToken(req *go_restful.Request, resp *go_restful.Response)
func (*Oauth2HTTPHandler) UpdateAdminPassword ¶ added in v0.4.0
func (h *Oauth2HTTPHandler) UpdateAdminPassword(req *go_restful.Request, resp *go_restful.Response)
func (*Oauth2HTTPHandler) VerifyToken ¶ added in v0.4.0
func (h *Oauth2HTTPHandler) VerifyToken(req *go_restful.Request, resp *go_restful.Response)
type Oauth2HTTPServer ¶
type Oauth2HTTPServer interface { AddPluginWhiteList(context.Context, *AddPluginWhiteListRequest) (*emptypb.Empty, error) IssueAdminToken(context.Context, *IssueAdminTokenRequest) (*IssueTokenResponse, error) IssuePluginToken(context.Context, *IssuePluginTokenRequest) (*IssueTokenResponse, error) UpdateAdminPassword(context.Context, *UpdateAdminPasswordRequest) (*emptypb.Empty, error) VerifyToken(context.Context, *emptypb.Empty) (*emptypb.Empty, error) }
type Oauth2Server ¶
type Oauth2Server interface { // TKEEL_COMMENT // {"response":{"raw_data":true}} IssuePluginToken(context.Context, *IssuePluginTokenRequest) (*IssueTokenResponse, error) AddPluginWhiteList(context.Context, *AddPluginWhiteListRequest) (*emptypb.Empty, error) IssueAdminToken(context.Context, *IssueAdminTokenRequest) (*IssueTokenResponse, error) VerifyToken(context.Context, *emptypb.Empty) (*emptypb.Empty, error) UpdateAdminPassword(context.Context, *UpdateAdminPasswordRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
Oauth2Server is the server API for Oauth2 service. All implementations must embed UnimplementedOauth2Server for forward compatibility
type UnimplementedOauth2Server ¶
type UnimplementedOauth2Server struct { }
UnimplementedOauth2Server must be embedded to have forward compatible implementations.
func (UnimplementedOauth2Server) AddPluginWhiteList ¶ added in v0.3.0
func (UnimplementedOauth2Server) AddPluginWhiteList(context.Context, *AddPluginWhiteListRequest) (*emptypb.Empty, error)
func (UnimplementedOauth2Server) IssueAdminToken ¶ added in v0.3.0
func (UnimplementedOauth2Server) IssueAdminToken(context.Context, *IssueAdminTokenRequest) (*IssueTokenResponse, error)
func (UnimplementedOauth2Server) IssuePluginToken ¶ added in v0.3.0
func (UnimplementedOauth2Server) IssuePluginToken(context.Context, *IssuePluginTokenRequest) (*IssueTokenResponse, error)
func (UnimplementedOauth2Server) UpdateAdminPassword ¶ added in v0.4.0
func (UnimplementedOauth2Server) UpdateAdminPassword(context.Context, *UpdateAdminPasswordRequest) (*emptypb.Empty, error)
func (UnimplementedOauth2Server) VerifyToken ¶ added in v0.4.0
type UnsafeOauth2Server ¶
type UnsafeOauth2Server interface {
// contains filtered or unexported methods
}
UnsafeOauth2Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to Oauth2Server will result in compilation errors.
type UpdateAdminPasswordRequest ¶ added in v0.4.0
type UpdateAdminPasswordRequest struct { NewPassword string `protobuf:"bytes,1,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` // contains filtered or unexported fields }
func (*UpdateAdminPasswordRequest) Descriptor
deprecated
added in
v0.4.0
func (*UpdateAdminPasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateAdminPasswordRequest.ProtoReflect.Descriptor instead.
func (*UpdateAdminPasswordRequest) GetNewPassword ¶ added in v0.4.0
func (x *UpdateAdminPasswordRequest) GetNewPassword() string
func (*UpdateAdminPasswordRequest) ProtoMessage ¶ added in v0.4.0
func (*UpdateAdminPasswordRequest) ProtoMessage()
func (*UpdateAdminPasswordRequest) ProtoReflect ¶ added in v0.4.0
func (x *UpdateAdminPasswordRequest) ProtoReflect() protoreflect.Message
func (*UpdateAdminPasswordRequest) Reset ¶ added in v0.4.0
func (x *UpdateAdminPasswordRequest) Reset()
func (*UpdateAdminPasswordRequest) String ¶ added in v0.4.0
func (x *UpdateAdminPasswordRequest) String() string