identity

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentifiableController

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

func NewIdentifiableController

func NewIdentifiableController(c node.Controller, i Identifier) *IdentifiableController

func (*IdentifiableController) Authenticate

func (c *IdentifiableController) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)

func (*IdentifiableController) Disconnect

func (c *IdentifiableController) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error

func (*IdentifiableController) Perform

func (c *IdentifiableController) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (*common.CommandResult, error)

func (*IdentifiableController) Shutdown

func (c *IdentifiableController) Shutdown() error

func (*IdentifiableController) Start

func (c *IdentifiableController) Start() error

func (*IdentifiableController) Subscribe

func (c *IdentifiableController) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)

func (*IdentifiableController) Unsubscribe

func (c *IdentifiableController) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)

type Identifier

type Identifier interface {
	Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
}

type IdentifierPipeline added in v1.5.0

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

func NewIdentifierPipeline added in v1.5.0

func NewIdentifierPipeline(identifiers ...Identifier) *IdentifierPipeline

func (*IdentifierPipeline) Identify added in v1.5.0

type JWTConfig

type JWTConfig struct {
	Secret string `toml:"secret"`
	Param  string `toml:"param"`
	Algo   jwt.SigningMethod
	Force  bool `toml:"force"`
}

func NewJWTConfig

func NewJWTConfig(secret string) JWTConfig

func (JWTConfig) Enabled

func (c JWTConfig) Enabled() bool

func (JWTConfig) ToToml added in v1.5.4

func (c JWTConfig) ToToml() string

type JWTIdentifier

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

func NewJWTIdentifier

func NewJWTIdentifier(config *JWTConfig, l *slog.Logger) *JWTIdentifier

func (*JWTIdentifier) Identify

func (i *JWTIdentifier) Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)

type PublicIdentifier added in v1.5.0

type PublicIdentifier struct {
}

PublicIdentifier identifies all clients and use their sid as the only identifier

func NewPublicIdentifier added in v1.5.0

func NewPublicIdentifier() *PublicIdentifier

func (*PublicIdentifier) Identify added in v1.5.0

func (pi *PublicIdentifier) Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)

Jump to

Keyboard shortcuts

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