Files
authentik/internal/outpost/radius/eap/protocol/identity/payload.go
Jens Langhammer f5eb827d14 start reworking response modification
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-07-01 22:43:03 +02:00

49 lines
792 B
Go

package identity
import (
"fmt"
"goauthentik.io/internal/outpost/radius/eap/protocol"
)
const TypeIdentity protocol.Type = 1
func Protocol() protocol.Payload {
return &Payload{}
}
type Payload struct {
Identity string
}
func (p *Payload) Type() protocol.Type {
return TypeIdentity
}
func (p *Payload) Decode(raw []byte) error {
p.Identity = string(raw)
return nil
}
func (p *Payload) Encode() ([]byte, error) {
return []byte{}, nil
}
func (p *Payload) Handle(ctx protocol.Context) protocol.Payload {
if ctx.IsProtocolStart(TypeIdentity) {
ctx.EndInnerProtocol(protocol.StatusNextProtocol)
}
return nil
}
func (p *Payload) Offerable() bool {
return false
}
func (p *Payload) String() string {
return fmt.Sprintf(
"<Identity Packet Identity=%s>",
p.Identity,
)
}