service

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProviderManager

type AuthProviderManager struct {
	// contains filtered or unexported fields
}

func NewAuthProviderManager

func NewAuthProviderManager() *AuthProviderManager

func (*AuthProviderManager) AddProvider

func (thiz *AuthProviderManager) AddProvider(provider IAuthenticationProvider)

func (AuthProviderManager) Authenticate

func (thiz AuthProviderManager) Authenticate(ctx *gin.Context,
	authentication *SecurityModel.Authentication) (*SecurityModel.Authentication, error)

type Encryptor

type Encryptor interface {
	Encrypt(text string) string
	Decrypt(cipher string) string
}

type IAuthenticationManager

type IAuthenticationManager interface {
	Authenticate(ctx *gin.Context, authentication *SecurityModel.Authentication) (*SecurityModel.Authentication, error)
}

type IAuthenticationProvider

type IAuthenticationProvider interface {
	GetAuthMethod() string
	// 认证登录信息信息,传待认证的信息。认证成功后,authentication.Authenticated会设置成true,并authentication.Principal填入User信息
	Authenticate(ctx *gin.Context, authentication *SecurityModel.Authentication) (*SecurityModel.Authentication, error)
}

type PasswordEncoder

type PasswordEncoder interface {
	Encode(rawPassword string) string
	Matches(rawPassword, encodedPassword string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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