Documentation ¶
Overview ¶
Package jwt provides the hiboot starter for injectable jwt dependency
Index ¶
- Constants
- type Controller
- func (c *Controller) JwtProperties() (propMap map[string]interface{}, ok bool)
- func (c *Controller) JwtPropertiesString() (propMap map[string]string, ok bool)
- func (c *Controller) JwtProperty(propName string) (propVal string)
- func (c *Controller) ParseToken(claims jwt.MapClaims, prop string) (retVal string)
- type Map
- type Middleware
- type Properties
- type Token
Constants ¶
const (
// Profile is the profile of jwt, it should be as same as the package name
Profile = "jwt"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { at.JwtRestController web.Controller }
Controller is the base web controller that enabled JWT
func (*Controller) JwtProperties ¶ added in v0.5.4
func (c *Controller) JwtProperties() (propMap map[string]interface{}, ok bool)
JwtProperties is an util that parsing JWT token and return all properties from jwt.MapClaims
func (*Controller) JwtPropertiesString ¶ added in v0.5.4
func (c *Controller) JwtPropertiesString() (propMap map[string]string, ok bool)
JwtPropertiesString is an util that parsing JWT token and return all properties in string from jwt.MapClaims
func (*Controller) JwtProperty ¶ added in v0.5.4
func (c *Controller) JwtProperty(propName string) (propVal string)
JwtProperty is an util that parsing JWT token and return single property from jwt.MapClaims
func (*Controller) ParseToken ¶
func (c *Controller) ParseToken(claims jwt.MapClaims, prop string) (retVal string)
ParseToken is an util that parsing JWT token from jwt.MapClaims
type Middleware ¶ added in v0.9.3
type Middleware struct {
mwjwt.Middleware
}
Middleware derived from github.com/iris-contrib/middleware/jwt/Middleware
func NewJwtMiddleware ¶
func NewJwtMiddleware(cfg ...mwjwt.Config) *Middleware
NewJwtMiddleware New constructs a new Secure instance with supplied options.
func (*Middleware) CheckJWT ¶ added in v0.9.3
func (m *Middleware) CheckJWT(ctx context.Context) error
CheckJWT the main functionality, checks for token
func (*Middleware) Serve ¶ added in v0.9.3
func (m *Middleware) Serve(ctx context.Context)
Serve the middleware's action