Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acl ¶
type Acl struct { Topic string Access AccessLevel }
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
func NewAuthentication ¶
func NewAuthentication(acls []Acl) *Authentication
func (*Authentication) CanPub ¶
func (auth *Authentication) CanPub(topic string) bool
func (*Authentication) CanSub ¶
func (auth *Authentication) CanSub(topic string) bool
type AuthenticationProvider ¶
type AuthenticationProvider interface { //验证用户凭证并返回当前用户的授权信息 Authenticate(username, password string) *Authentication }
type StaticUserListAuthProvider ¶
type StaticUserListAuthProvider struct { Users []User // contains filtered or unexported fields }
该权限认证器只会判断用户是否在白名单内, 并给所有的用户统一赋予所有topic的pubsub权限
func NewStaticUserListAuthProvider ¶
func NewStaticUserListAuthProvider(users []User) *StaticUserListAuthProvider
func (*StaticUserListAuthProvider) Authenticate ¶
func (authProvider *StaticUserListAuthProvider) Authenticate(username, password string) *Authentication
Click to show internal directories.
Click to hide internal directories.