Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
Packet() *radius.Request
RootPayload() Payload
State() string
ProtocolSettings() interface{}
GetProtocolState(p Type) interface{}
SetProtocolState(p Type, s interface{})
IsProtocolStart(p Type) bool
// SessionValue / SetSessionValue access the session-scoped store shared by
// every protocol handled under the same RADIUS State (see State.SessionData).
SessionValue(key string) any
SetSessionValue(key string, value any)
ResponseModifier
AddResponseModifier(func(r, q *radius.Packet) error)
HandleInnerEAP(Payload, StateManager) (Payload, error)
Inner(Payload, Type) Context
EndInnerProtocol(Status)
Log() Logger
}
type ProtocolConstructor ¶
type ProtocolConstructor func() Payload
type ResponseModifier ¶
type Settings ¶
type Settings struct {
Protocols []ProtocolConstructor
ProtocolPriority []Type
ProtocolSettings map[Type]interface{}
Logger Logger
}
type State ¶
type State struct {
Protocols []ProtocolConstructor
ProtocolIndex int
ProtocolPriority []Type
TypeState map[Type]any
// SessionData is a free-form, session-scoped store shared across every
// protocol (outer and inner) handled under the same RADIUS State. Consumers
// use Context.SessionValue/SetSessionValue to stash request-spanning data
// (resolved identity, certificates, OTP progress, response attributes)
// without maintaining a parallel, separately-locked map. Access it only
// through SessionValue/SetSessionValue, which guard it with sessionMu so it
// is safe to use from callbacks that run on the background TLS handshake
// goroutine (e.g. VerifyConnection, HandshakeSuccessful).
SessionData map[string]any
// contains filtered or unexported fields
}
func BlankState ¶
func (*State) GetNextProtocol ¶
func (*State) SessionValue ¶ added in v0.2.0
SessionValue returns the session-scoped value for key, or nil if absent.
func (*State) SetSessionValue ¶ added in v0.2.0
SetSessionValue stores a session-scoped value, lazily allocating the backing map. It is safe for concurrent use.
type StateManager ¶
Click to show internal directories.
Click to hide internal directories.