jwt_srv

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterJWTHandler

func RegisterJWTHandler(s server.Server, hdlr JWTHandler, opts ...server.HandlerOption) error

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 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 JWTHandler

type JWTHandler 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
}

type JWTService

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

func NewJWTService

func NewJWTService(name string, c client.Client) JWTService

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

Jump to

Keyboard shortcuts

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