Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { JwtController web.Controller }
JwtController 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)
GetJwtProperty 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)
GetJwtProperty 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)
GetJwtProperty 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) string
ParseToken is an util that parsing JWT token from jwt.MapClaims
type JwtController ¶
type JwtController interface { }
type JwtMiddleware ¶
type JwtMiddleware struct {
mwjwt.Middleware
}
JwtMiddleware derrived from github.com/iris-contrib/middleware/jwt/Middleware
func NewJwtMiddleware ¶
func NewJwtMiddleware(cfg ...mwjwt.Config) *JwtMiddleware
NewJwtMiddleware New constructs a new Secure instance with supplied options.
func (*JwtMiddleware) CheckJWT ¶
func (m *JwtMiddleware) CheckJWT(ctx context.Context) error
CheckJWT the main functionality, checks for token
func (*JwtMiddleware) Serve ¶
func (m *JwtMiddleware) Serve(ctx context.Context)
Serve the middleware's action