mirror of
https://github.com/goauthentik/authentik
synced 2026-04-28 10:28:22 +02:00
* core: bump library/golang in /lifecycle/container Bumps library/golang from 1.25.5-trixie to 1.26.0-trixie. --- updated-dependencies: - dependency-name: library/golang dependency-version: 1.26.0-trixie dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * bump & fix Signed-off-by: Jens Langhammer <jens@goauthentik.io> * bump docs too Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
38 lines
860 B
Go
38 lines
860 B
Go
package ak
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/mitchellh/mapstructure"
|
|
)
|
|
|
|
type EventKind int
|
|
|
|
const (
|
|
// Code used to acknowledge a previous message
|
|
EventKindAck EventKind = 0
|
|
// Code used to send a healthcheck keepalive
|
|
EventKindHello EventKind = 1
|
|
// Code received to trigger a config update
|
|
EventKindTriggerUpdate EventKind = 2
|
|
// Code received to trigger some provider specific function
|
|
EventKindProviderSpecific EventKind = 3
|
|
// Code received to identify the end of a session
|
|
EventKindSessionEnd EventKind = 4
|
|
)
|
|
|
|
type EventHandler func(ctx context.Context, msg Event) error
|
|
|
|
type Event struct {
|
|
Instruction EventKind `json:"instruction"`
|
|
Args any `json:"args"`
|
|
}
|
|
|
|
func (wm Event) ArgsAs(out any) error {
|
|
return mapstructure.Decode(wm.Args, out)
|
|
}
|
|
|
|
type EventArgsSessionEnd struct {
|
|
SessionID string `mapstructure:"session_id"`
|
|
}
|