middlware

package
v0.0.0-...-bff2e6b Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrsAuth

func CrsAuth() context.Handler

func JwtHandler

func JwtHandler() *jwt.Middleware

*

  • 验证 jwt
  • @method JwtHandler

Types

type Casbin

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

Casbin is the auth services which contains the casbin enforcer.

func New

func New(e *casbin.Enforcer) *Casbin

func (*Casbin) Check

func (c *Casbin) Check(r *http.Request, userId string) bool

Check checks the username, request's method and path and returns true if permission grandted otherwise false.

func (*Casbin) ServeHTTP

func (c *Casbin) ServeHTTP(ctx context.Context)

Jump to

Keyboard shortcuts

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