auth

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(c *gin.Context)

Types

type JWTTokenChecker

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

func (*JWTTokenChecker) Parse

func (t *JWTTokenChecker) Parse(tokenStr string) (jwt.Claims, error)

func (*JWTTokenChecker) Token

func (t *JWTTokenChecker) Token(claims jwt.Claims) (*Token, error)

type MockTokenChecker

type MockTokenChecker struct{}

func (*MockTokenChecker) Parse

func (t *MockTokenChecker) Parse(tokenStr string) (jwt.Claims, error)

func (*MockTokenChecker) Token

func (t *MockTokenChecker) Token(claims jwt.Claims) (*Token, error)

type Token

type Token struct {
	ClientID string `json:"client_id"`
	UserID   string `json:"user_id"`
	Scope    string `json:"scope"`
}

func ParseToken

func ParseToken(c *gin.Context) (*Token, error)

type TokenChecker

type TokenChecker interface {
	Parse(string) (jwt.Claims, error)
	Token(jwt.Claims) (*Token, error)
}

Jump to

Keyboard shortcuts

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