Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigInterface ¶
type ConfigInterface interface {
// contains filtered or unexported methods
}
type CookieConfig ¶
func DefaultCookieConfig ¶
func DefaultCookieConfig() *CookieConfig
type FileConfig ¶
type FileConfig struct {
TokenConfig *TokenConfig
}
func ReadConfig ¶ added in v0.0.6
func ReadConfig(confName string) (*FileConfig, error)
ReadConfig create from file.
type SignConfig ¶ added in v0.0.6
type SignConfig struct { SecretKey string // nonce exist time TimeStampDisparity int64 IsCheckNonce bool }
SignConfig sign config
func NewSignConfig ¶ added in v0.0.6
func NewSignConfig(options *SignOptions) (*SignConfig, error)
func (*SignConfig) GetSaveNonceExpire ¶ added in v0.0.6
func (s *SignConfig) GetSaveNonceExpire() int64
type SignOptions ¶ added in v0.0.6
SignOptions SignConfig options
type SsoConfig ¶ added in v0.0.6
type SsoConfig struct { // Mode sso mode Mode string // TicketTimeout ticket timeout TicketTimeout int64 // AllowUrl All allowed authorization callback addresses, separated by ',' AllowUrl string IsSlo bool IsHttp bool // SSO-Client current client name Client string // SSO-Server auth url AuthUrl string // SSO-Server check ticket url CheckTicketUrl string GetDataUrl string UserInfoUrl string SloUrl string SsoLogoutCall string ServerUrl string /** sso callback func */ // NotLoginView NotLoginView func() interface{} // DoLoginHandle login func DoLoginHandle func(name string, pwd string, ctx ctx.Context) (interface{}, error) // TicketResultHandle called each time the result of the validation ticket is obtained from the SSO-Server TicketResultHandle func(loginId string, back string) (interface{}, error) // SendHttp sent http SendHttp func(url string) (string, error) }
func DefaultSsoConfig ¶ added in v0.0.6
func NewSsoConfig ¶ added in v0.0.6
func NewSsoConfig(options *SsoOptions) (*SsoConfig, error)
func (*SsoConfig) SpliceAuthUrl ¶ added in v0.0.6
SpliceAuthUrl return Server-side single sign-on authorization address
func (*SsoConfig) SpliceCheckTicketUrl ¶ added in v0.0.6
SpliceCheckTicketUrl return ticket verification address on the server side
func (*SsoConfig) SpliceGetDataUrl ¶ added in v0.0.6
func (*SsoConfig) SpliceSloUrl ¶ added in v0.0.6
func (*SsoConfig) SpliceUserInfoUrl ¶ added in v0.0.6
type SsoOptions ¶ added in v0.0.6
type SsoOptions struct { CookieDomain string // Mode sso mode Mode string // TicketTimeout ticket timeout TicketTimeout int64 // AllowUrl All allowed authorization callback addresses, separated by ',' AllowUrl string IsSlo bool IsHttp bool // SSO-Client current client name Client string // SSO-Server auth url AuthUrl string // SSO-Server check ticket url CheckTicketUrl string GetDataUrl string UserInfoUrl string SloUrl string SsoLogoutCall string ServerUrl string /** sso callback func */ // NotLoginView NotLoginView func() interface{} // DoLoginHandle login func DoLoginHandle func(name string, pwd string, ctx ctx.Context) (interface{}, error) // TicketResultHandle called each time the result of the validation ticket is obtained from the SSO-Server TicketResultHandle func(loginId string, back string) (interface{}, error) // SendHttp sent http SendHttp func(url string) (string, error) }
SsoOptions new SsoConfig options.
type TokenConfig ¶
type TokenConfig struct { // TokenStyle // uuid | uuid-simple | random-string32 | random-string64 | random-string128 TokenStyle string // TokenName prefix TokenPrefix string TokenName string Timeout int64 // If you enable DoubleToken, returns double token - token and refreshToken, when token is timeout, you can use refreshToken to refreshToken to auto login. DoubleToken bool RefreshTokenName string RefreshTokenTimeout int64 // If last operate time < ActivityTimeout, token expired ActivityTimeout int64 // Data clean period DataRefreshPeriod int64 // Auto refresh token AutoRenew bool // Allow multi login IsConcurrent bool IsShare bool // If (IsConcurrent == true && IsShare == false), support MaxLoginCount // If IsConcurrent == -1, do not need to check loginCount MaxLoginCount int16 // Maximum number of logins per device DeviceMaxLoginCount int16 // Read token method // Set to true to read token from these method before login. IsReadBody bool IsReadHeader bool // If IsReadCookie is set to true, a cookie will be set after successful login IsReadCookie bool // Write token to response header. // Set to true to write after login. IsWriteHeader bool TokenSessionCheckLogin bool JwtSecretKey string CurDomain string SameTokenTimeout int64 CheckSameToken bool CookieConfig *CookieConfig }
func DefaultTokenConfig ¶
func DefaultTokenConfig() *TokenConfig
func (*TokenConfig) InitConfig ¶ added in v0.1.7
func (t *TokenConfig) InitConfig()
Click to show internal directories.
Click to hide internal directories.