mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
move events.go out of internal/authenticateflow (#4852)
Commit b7896b3153
moved events.go from the 'authenticate' package to
'internal/authenticateflow' in order to avoid an import cycle. However
this location is not actually suitable, as the hosted authenticate
service refers to AuthEvent and AuthEventFn.
Move events.go back out from under 'internal', to a new package
'authenticate/events'. This should still avoid an import cycle between
'authenticate' and 'internal/authenticateflow', while also allowing the
hosted authenticate service to use the events types.
This commit is contained in:
parent
c5f7519c06
commit
1dbe4410d7
3 changed files with 11 additions and 9 deletions
39
authenticate/events/events.go
Normal file
39
authenticate/events/events.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
// Package events defines authentication flow event types.
|
||||
package events
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// AuthEventKind is the type of an authentication event
|
||||
type AuthEventKind string
|
||||
|
||||
const (
|
||||
// AuthEventSignInRequest is an authentication event for a sign in request before IdP redirect
|
||||
AuthEventSignInRequest AuthEventKind = "sign_in_request"
|
||||
// AuthEventSignInComplete is an authentication event for a sign in request after IdP redirect
|
||||
AuthEventSignInComplete AuthEventKind = "sign_in_complete"
|
||||
)
|
||||
|
||||
// AuthEvent is a log event for an authentication event
|
||||
type AuthEvent struct {
|
||||
// Event is the type of authentication event
|
||||
Event AuthEventKind
|
||||
// IP is the IP address of the client
|
||||
IP string
|
||||
// Version is the version of the Pomerium client
|
||||
Version string
|
||||
// RequestUUID is the UUID of the request
|
||||
RequestUUID string
|
||||
// PubKey is the public key of the client
|
||||
PubKey string
|
||||
// UID is the IdP user ID of the user
|
||||
UID *string
|
||||
// Email is the email of the user
|
||||
Email *string
|
||||
// Domain is the domain of the request (for sign in complete events)
|
||||
Domain *string
|
||||
}
|
||||
|
||||
// AuthEventFn is a function that handles an authentication event
|
||||
type AuthEventFn func(context.Context, AuthEvent)
|
Loading…
Add table
Add a link
Reference in a new issue