jwt_srv

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterJWTServer

func RegisterJWTServer(s *grpc.Server, srv JWTServer)

Types

type AccessAndRefreshToken

type AccessAndRefreshToken struct {
	AcccessToken         string   `protobuf:"bytes,1,opt,name=acccessToken,proto3" json:"acccessToken,omitempty"`
	RefreshToken         string   `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	Message              string   `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AccessAndRefreshToken) Descriptor

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

func (*AccessAndRefreshToken) GetAcccessToken

func (m *AccessAndRefreshToken) GetAcccessToken() string

func (*AccessAndRefreshToken) GetMessage

func (m *AccessAndRefreshToken) GetMessage() string

func (*AccessAndRefreshToken) GetRefreshToken

func (m *AccessAndRefreshToken) GetRefreshToken() string

func (*AccessAndRefreshToken) ProtoMessage

func (*AccessAndRefreshToken) ProtoMessage()

func (*AccessAndRefreshToken) Reset

func (m *AccessAndRefreshToken) Reset()

func (*AccessAndRefreshToken) String

func (m *AccessAndRefreshToken) String() string

func (*AccessAndRefreshToken) XXX_DiscardUnknown

func (m *AccessAndRefreshToken) XXX_DiscardUnknown()

func (*AccessAndRefreshToken) XXX_Marshal

func (m *AccessAndRefreshToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccessAndRefreshToken) XXX_Merge

func (m *AccessAndRefreshToken) XXX_Merge(src proto.Message)

func (*AccessAndRefreshToken) XXX_Size

func (m *AccessAndRefreshToken) XXX_Size() int

func (*AccessAndRefreshToken) XXX_Unmarshal

func (m *AccessAndRefreshToken) XXX_Unmarshal(b []byte) error

type Claims

type Claims struct {
	UserIdentity         string   `protobuf:"bytes,1,opt,name=userIdentity,proto3" json:"userIdentity,omitempty"`
	Scopes               []string `protobuf:"bytes,2,rep,name=scopes,proto3" json:"scopes,omitempty"`
	IsFresh              bool     `protobuf:"varint,3,opt,name=isFresh,proto3" json:"isFresh,omitempty"`
	IsRefresh            bool     `protobuf:"varint,4,opt,name=isRefresh,proto3" json:"isRefresh,omitempty"`
	CreationUTC          int64    `protobuf:"varint,5,opt,name=creationUTC,proto3" json:"creationUTC,omitempty"`
	ExpirationUTC        int64    `protobuf:"varint,6,opt,name=expirationUTC,proto3" json:"expirationUTC,omitempty"`
	Message              string   `protobuf:"bytes,7,opt,name=message,proto3" json:"message,omitempty"`
	Valid                bool     `protobuf:"varint,8,opt,name=valid,proto3" json:"valid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Claims) Descriptor

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

func (*Claims) GetCreationUTC

func (m *Claims) GetCreationUTC() int64

func (*Claims) GetExpirationUTC

func (m *Claims) GetExpirationUTC() int64

func (*Claims) GetIsFresh

func (m *Claims) GetIsFresh() bool

func (*Claims) GetIsRefresh

func (m *Claims) GetIsRefresh() bool

func (*Claims) GetMessage

func (m *Claims) GetMessage() string

func (*Claims) GetScopes

func (m *Claims) GetScopes() []string

func (*Claims) GetUserIdentity

func (m *Claims) GetUserIdentity() string

func (*Claims) GetValid

func (m *Claims) GetValid() bool

func (*Claims) ProtoMessage

func (*Claims) ProtoMessage()

func (*Claims) Reset

func (m *Claims) Reset()

func (*Claims) String

func (m *Claims) String() string

func (*Claims) XXX_DiscardUnknown

func (m *Claims) XXX_DiscardUnknown()

func (*Claims) XXX_Marshal

func (m *Claims) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Claims) XXX_Merge

func (m *Claims) XXX_Merge(src proto.Message)

func (*Claims) XXX_Size

func (m *Claims) XXX_Size() int

func (*Claims) XXX_Unmarshal

func (m *Claims) XXX_Unmarshal(b []byte) error

type JWTClient

type JWTClient interface {
	FreshToken(ctx context.Context, in *JWTData, opts ...grpc.CallOption) (*Token, error)
	AccessAndRefreshTokens(ctx context.Context, in *JWTData, opts ...grpc.CallOption) (*AccessAndRefreshToken, error)
	RefreshTokens(ctx context.Context, in *Token, opts ...grpc.CallOption) (*AccessAndRefreshToken, error)
	ValidateToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Claims, error)
}

JWTClient is the client API for JWT service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewJWTClient

func NewJWTClient(cc *grpc.ClientConn) JWTClient

type JWTData

type JWTData struct {
	UserIdentity         string   `protobuf:"bytes,1,opt,name=userIdentity,proto3" json:"userIdentity,omitempty"`
	Scopes               []string `protobuf:"bytes,2,rep,name=scopes,proto3" json:"scopes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*JWTData) Descriptor

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

func (*JWTData) GetScopes

func (m *JWTData) GetScopes() []string

func (*JWTData) GetUserIdentity

func (m *JWTData) GetUserIdentity() string

func (*JWTData) ProtoMessage

func (*JWTData) ProtoMessage()

func (*JWTData) Reset

func (m *JWTData) Reset()

func (*JWTData) String

func (m *JWTData) String() string

func (*JWTData) XXX_DiscardUnknown

func (m *JWTData) XXX_DiscardUnknown()

func (*JWTData) XXX_Marshal

func (m *JWTData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JWTData) XXX_Merge

func (m *JWTData) XXX_Merge(src proto.Message)

func (*JWTData) XXX_Size

func (m *JWTData) XXX_Size() int

func (*JWTData) XXX_Unmarshal

func (m *JWTData) XXX_Unmarshal(b []byte) error

type JWTServer

type JWTServer interface {
	FreshToken(context.Context, *JWTData) (*Token, error)
	AccessAndRefreshTokens(context.Context, *JWTData) (*AccessAndRefreshToken, error)
	RefreshTokens(context.Context, *Token) (*AccessAndRefreshToken, error)
	ValidateToken(context.Context, *Token) (*Claims, error)
}

JWTServer is the server API for JWT service.

type Token

type Token struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	TokenType            string   `protobuf:"bytes,2,opt,name=tokenType,proto3" json:"tokenType,omitempty"`
	Message              string   `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Token) Descriptor

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

func (*Token) GetMessage

func (m *Token) GetMessage() string

func (*Token) GetToken

func (m *Token) GetToken() string

func (*Token) GetTokenType

func (m *Token) GetTokenType() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) String

func (m *Token) String() string

func (*Token) XXX_DiscardUnknown

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal

func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token) XXX_Merge

func (m *Token) XXX_Merge(src proto.Message)

func (*Token) XXX_Size

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal

func (m *Token) XXX_Unmarshal(b []byte) error

type TokenValid

type TokenValid struct {
	Valid                bool     `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TokenValid) Descriptor

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

func (*TokenValid) GetValid

func (m *TokenValid) GetValid() bool

func (*TokenValid) ProtoMessage

func (*TokenValid) ProtoMessage()

func (*TokenValid) Reset

func (m *TokenValid) Reset()

func (*TokenValid) String

func (m *TokenValid) String() string

func (*TokenValid) XXX_DiscardUnknown

func (m *TokenValid) XXX_DiscardUnknown()

func (*TokenValid) XXX_Marshal

func (m *TokenValid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenValid) XXX_Merge

func (m *TokenValid) XXX_Merge(src proto.Message)

func (*TokenValid) XXX_Size

func (m *TokenValid) XXX_Size() int

func (*TokenValid) XXX_Unmarshal

func (m *TokenValid) XXX_Unmarshal(b []byte) error

type UnimplementedJWTServer

type UnimplementedJWTServer struct {
}

UnimplementedJWTServer can be embedded to have forward compatible implementations.

func (*UnimplementedJWTServer) AccessAndRefreshTokens

func (*UnimplementedJWTServer) AccessAndRefreshTokens(ctx context.Context, req *JWTData) (*AccessAndRefreshToken, error)

func (*UnimplementedJWTServer) FreshToken

func (*UnimplementedJWTServer) FreshToken(ctx context.Context, req *JWTData) (*Token, error)

func (*UnimplementedJWTServer) RefreshTokens

func (*UnimplementedJWTServer) ValidateToken

func (*UnimplementedJWTServer) ValidateToken(ctx context.Context, req *Token) (*Claims, error)

Jump to

Keyboard shortcuts

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