internal

package
v1.0.55 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService1

type AuthService1 struct {
	Authenticators auth.AuthenticatorManager //starter:inject("#")
	Authorizers    auth.AuthorizerManager    //starter:inject("#")

	LogBadAuthError bool //starter:inject("${security.log-bad-auth-error}")
	// contains filtered or unexported fields
}

AuthService1 ... 是面向 a&a 的 auth 服务

func (*AuthService1) Authenticate

func (inst *AuthService1) Authenticate(a auth.Authentication) ([]auth.Identity, error)

Authenticate 验证

func (*AuthService1) Authorize

func (inst *AuthService1) Authorize(a auth.Authorization) error

Authorize 授权

func (*AuthService1) Execute added in v1.0.22

func (inst *AuthService1) Execute(reqlist ...auth.Request) error

Execute 登录

type AuthService2

type AuthService2 struct {
	Servic1 auth.Service //starter:inject("#")
	// contains filtered or unexported fields
}

AuthService2 是面向 rabc 的 auth 服务

func (*AuthService2) Handle added in v1.0.14

func (inst *AuthService2) Handle(c context.Context, action string, alist []*rbac.AuthDTO) ([]*rbac.AuthDTO, error)

Handle 处理验证、授权请求

type AuthenticatorManagerImpl added in v1.0.22

type AuthenticatorManagerImpl struct {
	RegistryList []auth.Registry //starter:inject(".")
	// contains filtered or unexported fields
}

AuthenticatorManagerImpl ...

func (*AuthenticatorManagerImpl) FindFor added in v1.0.22

FindFor ...

func (*AuthenticatorManagerImpl) ListFor added in v1.0.23

ListFor ...

type AuthorizerManagerImpl added in v1.0.22

type AuthorizerManagerImpl struct {
	RegistryList []auth.Registry //starter:inject(".")
	// contains filtered or unexported fields
}

AuthorizerManagerImpl ...

func (*AuthorizerManagerImpl) FindFor added in v1.0.22

FindFor ...

func (*AuthorizerManagerImpl) ListFor added in v1.0.23

ListFor ...

type DefaultRandomService added in v1.0.9

type DefaultRandomService struct {
	Providers []random.ProviderRegistry //starter:inject(".")
	// contains filtered or unexported fields
}

DefaultRandomService ... 随机数服务

func (*DefaultRandomService) NextBytes added in v1.0.9

func (inst *DefaultRandomService) NextBytes(length int) []byte

NextBytes ...

func (*DefaultRandomService) NextInt added in v1.0.9

func (inst *DefaultRandomService) NextInt() int

NextInt ...

func (*DefaultRandomService) NextInt64 added in v1.0.9

func (inst *DefaultRandomService) NextInt64() int64

NextInt64 ...

func (*DefaultRandomService) NextString added in v1.0.9

func (inst *DefaultRandomService) NextString(length int) string

NextString ...

func (*DefaultRandomService) Reader added in v1.0.9

func (inst *DefaultRandomService) Reader() io.Reader

Reader ...

func (*DefaultRandomService) Source added in v1.0.9

func (inst *DefaultRandomService) Source() random.Source

Source ...

type DefaultRandomSource added in v1.0.9

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

DefaultRandomSource ... 默认随机源

func (*DefaultRandomSource) Read added in v1.0.9

func (inst *DefaultRandomSource) Read(p []byte) (n int, err error)

func (*DefaultRandomSource) Reader added in v1.0.9

func (inst *DefaultRandomSource) Reader() io.Reader

Reader ...

func (*DefaultRandomSource) Registration added in v1.0.9

func (inst *DefaultRandomSource) Registration() *random.ProviderRegistration

Registration ...

func (*DefaultRandomSource) Source added in v1.0.9

func (inst *DefaultRandomSource) Source() random.Source

Source ...

type DefaultSubjectLoader added in v1.0.49

type DefaultSubjectLoader struct {
	Sessions rbac.SessionService //starter:inject("#")
	Tokens   rbac.TokenService   //starter:inject("#")
	// contains filtered or unexported fields
}

DefaultSubjectLoader ...

func (*DefaultSubjectLoader) Load added in v1.0.49

Load ...

type JWTCODEC added in v1.0.28

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

JWTCODEC ... 实现 JWT 的编解码

func (*JWTCODEC) Decode added in v1.0.28

func (inst *JWTCODEC) Decode(t1 jwt.Text) (*jwt.Token, error)

Decode ...

func (*JWTCODEC) Encode added in v1.0.28

func (inst *JWTCODEC) Encode(t1 *jwt.Token) (jwt.Text, error)

Encode ...

func (*JWTCODEC) Life added in v1.0.28

func (inst *JWTCODEC) Life() *application.Life

Life ...

func (*JWTCODEC) ListRegistrations added in v1.0.28

func (inst *JWTCODEC) ListRegistrations() []*jwt.Registration

ListRegistrations ...

type JWTService

type JWTService struct {
	RegistryList []jwt.Registry //starter:inject(".")

	TokenMaxageDefault int //starter:inject("${security.jwt.default-age-sec}")
	TokenMaxageMin     int //starter:inject("${security.jwt.min-age-sec}")
	TokenMaxageMax     int //starter:inject("${security.jwt.max-age-sec}")

	SessionMaxageDefault int //starter:inject("${security.session.default-age-sec}")
	SessionMaxageMin     int //starter:inject("${security.session.min-age-sec}")
	SessionMaxageMax     int //starter:inject("${security.session.max-age-sec}")
	// contains filtered or unexported fields
}

JWTService 实现 jwt.Service

func (*JWTService) Decode

func (inst *JWTService) Decode(t jwt.Text) (*jwt.Token, error)

Decode ...

func (*JWTService) Encode

func (inst *JWTService) Encode(o *jwt.Token) (jwt.Text, error)

Encode ...

func (*JWTService) GetDTO

func (inst *JWTService) GetDTO(c context.Context) (*jwt.Token, error)

GetDTO ...

func (*JWTService) GetText

func (inst *JWTService) GetText(c context.Context) (jwt.Text, error)

GetText ...

func (*JWTService) SetDTO

func (inst *JWTService) SetDTO(c context.Context, o *jwt.Token) error

SetDTO ...

func (*JWTService) SetText

func (inst *JWTService) SetText(c context.Context, t jwt.Text) error

SetText ...

type RbacSessionServiceImpl added in v1.0.49

type RbacSessionServiceImpl struct {
	KVS     keyvalues.Service  //starter:inject("#")
	UUIDGen random.UUIDService //starter:inject("#")

	MaxAge int64 //starter:inject("${security.session.default-age-sec}")
	// contains filtered or unexported fields
}

RbacSessionServiceImpl ...

func (*RbacSessionServiceImpl) Find added in v1.0.49

Find ...

func (*RbacSessionServiceImpl) Insert added in v1.0.49

Insert ...

func (*RbacSessionServiceImpl) Update added in v1.0.49

Update ...

type RbacSubjectServiceImpl added in v1.0.49

type RbacSubjectServiceImpl struct {
	Tokens   rbac.TokenService   //starter:inject("#")
	Sessions rbac.SessionService //starter:inject("#")
	// contains filtered or unexported fields
}

RbacSubjectServiceImpl ...

func (*RbacSubjectServiceImpl) GetCurrent added in v1.0.49

func (inst *RbacSubjectServiceImpl) GetCurrent(c context.Context) (*rbac.SubjectDTO, error)

GetCurrent ...

type RbacTokenServiceImpl added in v1.0.49

type RbacTokenServiceImpl struct {
	JWTService jwt.Service //starter:inject("#")
	// contains filtered or unexported fields
}

RbacTokenServiceImpl ... 通过 jwt 实现 rbac.TokenService 的功能

func (*RbacTokenServiceImpl) GetCurrent added in v1.0.49

func (inst *RbacTokenServiceImpl) GetCurrent(c context.Context) (*rbac.TokenDTO, error)

GetCurrent ...

func (*RbacTokenServiceImpl) PutCurrent added in v1.0.49

func (inst *RbacTokenServiceImpl) PutCurrent(c context.Context, token *rbac.TokenDTO) (*rbac.TokenDTO, error)

PutCurrent ...

type SessionServiceImpl added in v1.0.14

type SessionServiceImpl struct {
	RegistryList []security.SessionRegistry //starter:inject(".")
	// contains filtered or unexported fields
}

SessionServiceImpl ...

func (*SessionServiceImpl) GetCurrent added in v1.0.14

func (inst *SessionServiceImpl) GetCurrent(c context.Context) (security.Session, error)

GetCurrent ...

type UUIDServiceImpl added in v1.0.21

type UUIDServiceImpl struct {
	Host string //starter:inject("${security.uuid.service.hostname}")
	// contains filtered or unexported fields
}

UUIDServiceImpl 实现 UUID 创建服务

func (*UUIDServiceImpl) Build added in v1.0.21

func (inst *UUIDServiceImpl) Build() random.UUIDBuilder

Build ...

func (*UUIDServiceImpl) Life added in v1.0.21

func (inst *UUIDServiceImpl) Life() *application.Life

Life ...

Jump to

Keyboard shortcuts

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