folder structure to prepare eap in eap
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
37
internal/outpost/radius/eap/protocol/legacy_nak/payload.go
Normal file
37
internal/outpost/radius/eap/protocol/legacy_nak/payload.go
Normal file
@ -0,0 +1,37 @@
|
||||
package legacy_nak
|
||||
|
||||
import "goauthentik.io/internal/outpost/radius/eap/protocol"
|
||||
|
||||
const TypeLegacyNAK protocol.Type = 3
|
||||
|
||||
func Protocol() protocol.Payload {
|
||||
return &Payload{}
|
||||
}
|
||||
|
||||
type Payload struct {
|
||||
DesiredType protocol.Type
|
||||
}
|
||||
|
||||
func (ln *Payload) Type() protocol.Type {
|
||||
return TypeLegacyNAK
|
||||
}
|
||||
|
||||
func (ln *Payload) Decode(raw []byte) error {
|
||||
ln.DesiredType = protocol.Type(raw[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ln *Payload) Encode() ([]byte, error) {
|
||||
return []byte{byte(ln.DesiredType)}, nil
|
||||
}
|
||||
|
||||
func (ln *Payload) Handle(ctx protocol.Context) protocol.Payload {
|
||||
if ctx.IsProtocolStart() {
|
||||
ctx.EndInnerProtocol(protocol.StatusError, nil)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ln *Payload) Offerable() bool {
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user