plugins/

directory
v0.0.0-...-30f4346 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2015 License: Apache-2.0

Directories

Path Synopsis
Package apiauth provides handlers to enable apiauth support.
Package apiauth provides handlers to enable apiauth support.
Package auth provides handlers to enable basic auth support.
Package auth provides handlers to enable basic auth support.
Package cors provides handlers to enable CORS support.
Package cors provides handlers to enable CORS support.
Package jwt provides JWT (Json Web Token) authentication Usage In file main.go import ( "github.com/astaxie/beego" "github.com/astaxie/beego/plugins/jwt" ) func main() { // JWT for Url matching /v1/* // PrivateKeyPath: The path for the private RSA key used by JWT // PublicKeyPath: The path for the public RSA key used by JWT // The list of Urls should be excluded from the JWT Auth beego.InsertFilter("/v1/*", beego.BeforeRouter, jwt.AuthRequest(&jwt.Options{ PrivateKeyPath: "conf/beeblog.rsa", PublicKeyPath: "conf/beeblog.rsa.pub", WhiteList: []string{"/v1/jwt/issue-token", "/docs"}, })) beego.Run() } In file routers/router.go import ( "github.com/astaxie/beego" "github.com/astaxie/beego/plugins/jwt" ) func init() { ns := beego.NSNamespace("/jwt", beego.NSInclude( &jwt.JwtController{}, ), ) beego.AddNamespace(ns) }
Package jwt provides JWT (Json Web Token) authentication Usage In file main.go import ( "github.com/astaxie/beego" "github.com/astaxie/beego/plugins/jwt" ) func main() { // JWT for Url matching /v1/* // PrivateKeyPath: The path for the private RSA key used by JWT // PublicKeyPath: The path for the public RSA key used by JWT // The list of Urls should be excluded from the JWT Auth beego.InsertFilter("/v1/*", beego.BeforeRouter, jwt.AuthRequest(&jwt.Options{ PrivateKeyPath: "conf/beeblog.rsa", PublicKeyPath: "conf/beeblog.rsa.pub", WhiteList: []string{"/v1/jwt/issue-token", "/docs"}, })) beego.Run() } In file routers/router.go import ( "github.com/astaxie/beego" "github.com/astaxie/beego/plugins/jwt" ) func init() { ns := beego.NSNamespace("/jwt", beego.NSInclude( &jwt.JwtController{}, ), ) beego.AddNamespace(ns) }

Jump to

Keyboard shortcuts

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