generator

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JwtTokenGenerator

func JwtTokenGenerator(
	clientStore store.ClientStore,
	tokenStore store.TokenStore,
	rolesFunc JwtRolesGenerator,
	authoritiesFunc JwtAuthoritiesGenerator,
	payloadFunc JwtCustomPayloadGenerator) gin.HandlerFunc

JwtTokenGenerator 生成JWT token

Types

type JwtAuthoritiesGenerator

type JwtAuthoritiesGenerator func(clientId, userName string) ([]string, error)

Jwt中的权限信息

func DefaultJwtAuthoritiesGenerator added in v1.0.8

func DefaultJwtAuthoritiesGenerator() JwtAuthoritiesGenerator

DefaultJwtAuthoritiesGenerator 默认权限数据生成器

type JwtCustomPayloadGenerator

type JwtCustomPayloadGenerator func(clientId, userName string) (map[string]interface{}, error)

JwtCustomPayloadGenerator Jwt Token Payload 自定义内容生成器

func DefaultJwtCustomPayloadGenerator added in v1.0.8

func DefaultJwtCustomPayloadGenerator() JwtCustomPayloadGenerator

DefaultJwtCustomPayloadGenerator 默认自定义Payload生成器

type JwtRolesGenerator

type JwtRolesGenerator func(clientId, userName string) ([]string, error)

Jwt中的角色信息

func DefaultJwtRolesGenerator added in v1.0.8

func DefaultJwtRolesGenerator() JwtRolesGenerator

DefaultJwtRolesGenerator 默认角色数据生成器

type TokenHandlerForm

type TokenHandlerForm struct {
	GrantType    common.GrantType `form:"grant_type" json:"grant_type"`
	ClientId     string           `form:"client_id" json:"client_id"`
	ClientSecret string           `form:"client_secret" json:"client_secret"`
	UserName     string           `form:"userName" json:"userName"`
	Password     string           `form:"password" json:"password"`
	RefreshToken string           `form:"refresh_token" json:"refresh_token"`
}

TokenHandlerForm token请求数据体

Jump to

Keyboard shortcuts

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