jwtsigner_pb

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pbschema_jwtsigner_proto protoreflect.FileDescriptor
View Source
var Jwtsigner_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "jwt.signer.jwtsigner",
	HandlerType: (*JwtsignerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Meta",
			Handler:    _Jwtsigner_Meta_Handler,
		},
		{
			MethodName: "Sign",
			Handler:    _Jwtsigner_Sign_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pbschema/jwtsigner.proto",
}

Jwtsigner_ServiceDesc is the grpc.ServiceDesc for Jwtsigner service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterJwtsignerServer

func RegisterJwtsignerServer(s grpc.ServiceRegistrar, srv JwtsignerServer)

Types

type JwtsignerClient

type JwtsignerClient interface {
	//查看jwt服务元信息的算法
	Meta(ctx context.Context, in *MetaRequest, opts ...grpc.CallOption) (*MetaResponse, error)
	// Sign 为JSON字符串签名
	Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error)
}

JwtsignerClient is the client API for Jwtsigner 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 NewJwtsignerClient

func NewJwtsignerClient(cc grpc.ClientConnInterface) JwtsignerClient

type JwtsignerServer

type JwtsignerServer interface {
	//查看jwt服务元信息的算法
	Meta(context.Context, *MetaRequest) (*MetaResponse, error)
	// Sign 为JSON字符串签名
	Sign(context.Context, *SignRequest) (*SignResponse, error)
	// contains filtered or unexported methods
}

JwtsignerServer is the server API for Jwtsigner service. All implementations must embed UnimplementedJwtsignerServer for forward compatibility

type MetaRequest

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

func (*MetaRequest) Descriptor deprecated

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

Deprecated: Use MetaRequest.ProtoReflect.Descriptor instead.

func (*MetaRequest) ProtoMessage

func (*MetaRequest) ProtoMessage()

func (*MetaRequest) ProtoReflect

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

func (*MetaRequest) Reset

func (x *MetaRequest) Reset()

func (*MetaRequest) String

func (x *MetaRequest) String() string

type MetaResponse

type MetaResponse struct {
	Status *jwt_pb.ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Data   *jwt_pb.SignerMeta     `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*MetaResponse) Descriptor deprecated

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

Deprecated: Use MetaResponse.ProtoReflect.Descriptor instead.

func (*MetaResponse) GetData

func (x *MetaResponse) GetData() *jwt_pb.SignerMeta

func (*MetaResponse) GetStatus

func (x *MetaResponse) GetStatus() *jwt_pb.ResponseStatus

func (*MetaResponse) ProtoMessage

func (*MetaResponse) ProtoMessage()

func (*MetaResponse) ProtoReflect

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

func (*MetaResponse) Reset

func (x *MetaResponse) Reset()

func (*MetaResponse) String

func (x *MetaResponse) String() string

type SignRequest

type SignRequest struct {
	Sub        string   `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"`                //设置主题,一般用于放用户id
	Exp        int64    `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"`               //超时时间,秒级时间戳
	Nbf        int64    `protobuf:"varint,3,opt,name=nbf,proto3" json:"nbf,omitempty"`               //生效时间,秒级时间戳
	Refreshexp int64    `protobuf:"varint,4,opt,name=refreshexp,proto3" json:"refreshexp,omitempty"` //refresh_token的实效时间,秒级时间戳
	Payload    []byte   `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"`        //其他负载,请以json格式传输
	Jti        string   `protobuf:"bytes,6,opt,name=jti,proto3" json:"jti,omitempty"`                //设置token的id
	Aud        []string `protobuf:"bytes,7,rep,name=aud,proto3" json:"aud,omitempty"`                //设置签名接收方,一般是app名或者url
	// contains filtered or unexported fields
}

func (*SignRequest) Descriptor deprecated

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

Deprecated: Use SignRequest.ProtoReflect.Descriptor instead.

func (*SignRequest) GetAud

func (x *SignRequest) GetAud() []string

func (*SignRequest) GetExp

func (x *SignRequest) GetExp() int64

func (*SignRequest) GetJti

func (x *SignRequest) GetJti() string

func (*SignRequest) GetNbf

func (x *SignRequest) GetNbf() int64

func (*SignRequest) GetPayload

func (x *SignRequest) GetPayload() []byte

func (*SignRequest) GetRefreshexp

func (x *SignRequest) GetRefreshexp() int64

func (*SignRequest) GetSub

func (x *SignRequest) GetSub() string

func (*SignRequest) ProtoMessage

func (*SignRequest) ProtoMessage()

func (*SignRequest) ProtoReflect

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

func (*SignRequest) Reset

func (x *SignRequest) Reset()

func (*SignRequest) String

func (x *SignRequest) String() string

type SignResponse

type SignResponse struct {
	Status *jwt_pb.ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Token  *jwt_pb.Token          `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*SignResponse) Descriptor deprecated

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

Deprecated: Use SignResponse.ProtoReflect.Descriptor instead.

func (*SignResponse) GetStatus

func (x *SignResponse) GetStatus() *jwt_pb.ResponseStatus

func (*SignResponse) GetToken

func (x *SignResponse) GetToken() *jwt_pb.Token

func (*SignResponse) ProtoMessage

func (*SignResponse) ProtoMessage()

func (*SignResponse) ProtoReflect

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

func (*SignResponse) Reset

func (x *SignResponse) Reset()

func (*SignResponse) String

func (x *SignResponse) String() string

type UnimplementedJwtsignerServer

type UnimplementedJwtsignerServer struct {
}

UnimplementedJwtsignerServer must be embedded to have forward compatible implementations.

func (UnimplementedJwtsignerServer) Meta

func (UnimplementedJwtsignerServer) Sign

type UnsafeJwtsignerServer

type UnsafeJwtsignerServer interface {
	// contains filtered or unexported methods
}

UnsafeJwtsignerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JwtsignerServer will result in compilation errors.

Jump to

Keyboard shortcuts

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