auth

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserNameMaxLength is the max length of username.
	UserNameMaxLength = 32
	// HostNameMaxLength is the max length of host name.
	HostNameMaxLength = 255
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RoleIdentity

type RoleIdentity struct {
	Username string
	Hostname string
}

RoleIdentity represents a role name.

func (*RoleIdentity) Restore

func (role *RoleIdentity) Restore(ctx *format.RestoreCtx) error

Restore implements Node interface.

func (*RoleIdentity) String

func (role *RoleIdentity) String() string

String converts UserIdentity to the format user@host.

type UserIdentity

type UserIdentity struct {
	Username     string
	Hostname     string
	CurrentUser  bool
	AuthUsername string // Username matched in privileges system
	AuthHostname string // Match in privs system (i.e. could be a wildcard)
	AuthPlugin   string // The plugin specified in handshake, only used during authentication.
}

UserIdentity represents username and hostname.

func (*UserIdentity) LoginString

func (user *UserIdentity) LoginString() string

LoginString returns matched identity in user@host format It matches the login user.

func (*UserIdentity) Restore

func (user *UserIdentity) Restore(ctx *format.RestoreCtx) error

Restore implements Node interface.

func (*UserIdentity) String

func (user *UserIdentity) String() string

String converts UserIdentity to the format user@host. It defaults to providing the AuthIdentity (the matching entry in priv tables) To use the actual identity use LoginString()

Jump to

Keyboard shortcuts

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