jwt

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Algorithm string `json:"algorithm" yaml:"algorithm" mapstructure:"algorithm"`
	// TODO: 使用Issuer
	Issuer     string `json:"issuer" yaml:"issuer" mapstructure:"issuer"`
	Secret     string `json:"secret" yaml:"secret" mapstructure:"secret"`
	PublicKey  string `json:"public_key" yaml:"public_key" mapstructure:"public_key"`
	PrivateKey string `json:"private_key" yaml:"private_key" mapstructure:"private_key"`
}

type IssueVerifier

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

func Default

func Default() *IssueVerifier

func New

func New(config Config) (*IssueVerifier, error)

func (*IssueVerifier) Issue

func (i *IssueVerifier) Issue(claims jwt.Claims) (string, error)

func (*IssueVerifier) Verify

func (i *IssueVerifier) Verify(tokenString string, claims jwt.Claims) (*jwt.Token, error)

Jump to

Keyboard shortcuts

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