jwt

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StrategyRefreshBoth refresh strategy to issue refresh token on every access token renew
	StrategyRefreshBoth = "refreshBoth"
	// StrategyRefreshOnExpire refresh strategy to issue refresh token if it's expiration time is close
	StrategyRefreshOnExpire = "refreshOnExpire"
	// StrategyNoRefresh refresh strategy means refresh token issue must be explicit, only by calling NewJWT
	StrategyNoRefresh = "noRefresh"
)

Variables

This section is empty.

Functions

func NewJWTServer

func NewJWTServer(service Service, log *zap.Logger) api.JWTServer

NewJWTServer creates new JWTServer instance

func NewPBFromNewJWTRequest

func NewPBFromNewJWTRequest(msg *NewJWTRequest) *apiJWT.NewJWTRequest

NewPBFromNewJWTRequest transformer *NewJWTRequest to *apiJWT.NewJWTRequest

func NewPBFromNewJWTResponse

func NewPBFromNewJWTResponse(msg *NewJWTResponse) *apiJWT.NewJWTResponse

NewPBFromNewJWTResponse transformer *NewJWTResponse to *apiJWT.NewJWTResponse

func NewPBFromRenewJWTRequest

func NewPBFromRenewJWTRequest(msg *RenewJWTRequest) *apiJWT.RenewJWTRequest

NewPBFromRenewJWTRequest transformer *RenewJWTRequest to *apiJWT.RenewJWTRequest

func NewPBFromRenewJWTResponse

func NewPBFromRenewJWTResponse(msg *RenewJWTResponse) *apiJWT.RenewJWTResponse

NewPBFromRenewJWTResponse transformer *RenewJWTResponse to *apiJWT.RenewJWTResponse

func NewPBFromRevokeJWTRequest

func NewPBFromRevokeJWTRequest(msg *RevokeJWTRequest) *apiJWT.RevokeJWTRequest

NewPBFromRevokeJWTRequest transformer *RevokeJWTRequest to *apiJWT.RevokeJWTRequest

func NewPBFromRevokeJWTResponse

func NewPBFromRevokeJWTResponse(msg *RevokeJWTResponse) *apiJWT.RevokeJWTResponse

NewPBFromRevokeJWTResponse transformer *RevokeJWTResponse to *apiJWT.RevokeJWTResponse

func Register

func Register() *services.ServiceInfo

Register func registers KeysServer service

Types

type NewJWTRequest

type NewJWTRequest struct {
	KID    string                 `json:"kid"`
	Claims map[string]interface{} `json:"claims"`
}

NewJWTRequest message type

func NewNewJWTRequestFromPB

func NewNewJWTRequestFromPB(msg *apiJWT.NewJWTRequest) *NewJWTRequest

NewNewJWTRequestFromPB transformer *apiJWT.NewJWTRequest to *NewJWTRequest

type NewJWTResponse

type NewJWTResponse struct {
	ID           string
	AccessToken  string
	RefreshToken string
	Expiry       jwt.NumericDate
}

NewJWTResponse message type

func NewNewJWTResponseFromPB

func NewNewJWTResponseFromPB(msg *apiJWT.NewJWTResponse) *NewJWTResponse

NewNewJWTResponseFromPB transformer *apiJWT.NewJWTResponse to *NewJWTResponse

type RenewJWTRequest

type RenewJWTRequest struct {
	KID             string
	RefreshToken    string
	RefreshStrategy string
}

RenewJWTRequest message type

func NewRenewJWTRequestFromPB

func NewRenewJWTRequestFromPB(msg *apiJWT.RenewJWTRequest) *RenewJWTRequest

NewRenewJWTRequestFromPB transformer *apiJWT.RenewJWTRequest to *RenewJWTRequest

type RenewJWTResponse

type RenewJWTResponse struct {
	ID           string
	AccessToken  string
	RefreshToken string
	Expiry       jwt.NumericDate
}

RenewJWTResponse message type

func NewRenewJWTResponseFromPB

func NewRenewJWTResponseFromPB(msg *apiJWT.RenewJWTResponse) *RenewJWTResponse

NewRenewJWTResponseFromPB transformer *apiJWT.RenewJWTResponse to *RenewJWTResponse

type RevokeJWTRequest

type RevokeJWTRequest struct {
	KID          string
	ID           string
	RefreshToken string
}

RevokeJWTRequest message type

func NewRevokeJWTRequestFromPB

func NewRevokeJWTRequestFromPB(msg *apiJWT.RevokeJWTRequest) *RevokeJWTRequest

NewRevokeJWTRequestFromPB transformer *apiJWT.RevokeJWTRequest to *RevokeJWTRequest

type RevokeJWTResponse

type RevokeJWTResponse struct {
}

RevokeJWTResponse message type

func NewRevokeJWTResponseFromPB

func NewRevokeJWTResponseFromPB(msg *apiJWT.RevokeJWTResponse) *RevokeJWTResponse

NewRevokeJWTResponseFromPB transformer *apiJWT.RevokeJWTResponse to *RevokeJWTResponse

type Service

type Service interface {
	NewJWT(ctx context.Context, req *NewJWTRequest) (*NewJWTResponse, error)
	RenewJWT(ctx context.Context, req *RenewJWTRequest) (*RenewJWTResponse, error)
	RevokeJWT(ctx context.Context, req *RevokeJWTRequest) (*RevokeJWTResponse, error)
}

Service interface type

Jump to

Keyboard shortcuts

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