Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit c56397a

Browse files
committed
Add missing system hook event for user_failed_login
1 parent cec93a2 commit c56397a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

event_parsing.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ func ParseSystemhook(payload []byte) (event interface{}, err error) {
155155
case
156156
"user_create",
157157
"user_destroy",
158-
"user_rename":
158+
"user_rename",
159+
"user_failed_login":
159160
event = &UserSystemEvent{}
160161
case
161162
"user_add_to_group",

event_parsing_systemhook_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func TestParseSystemhookUser(t *testing.T) {
140140
{"user_create", loadFixture("testdata/systemhooks/user_create.json")},
141141
{"user_destroy", loadFixture("testdata/systemhooks/user_destroy.json")},
142142
{"user_rename", loadFixture("testdata/systemhooks/user_rename.json")},
143+
{"user_failed_login", loadFixture("testdata/systemhooks/user_failed_login.json")},
143144
}
144145
for _, tc := range tests {
145146
t.Run(tc.event, func(t *testing.T) {

event_systemhook_types.go

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ type UserSystemEvent struct {
9090
Username string `json:"username"`
9191
OldUsername string `json:"old_username,omitempty"`
9292
Email string `json:"email"`
93+
State string `json:"state,omitempty"`
9394
}
9495

9596
// UserGroupSystemEvent represents a user group system event.

0 commit comments

Comments
 (0)