summaryrefslogtreecommitdiff
path: root/internal/mocks
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2025-03-02 15:04:09 +1100
committerGitHub <noreply@github.com>2025-03-02 04:04:09 +0000
commitc3fc3f94f7bb916faa8baebf313e259bcdd76ffb (patch)
tree8c606b26e362086ec0d05a5c930702b41be1b78f /internal/mocks
parent6759988ce044b5be7d74239405603bda993441f4 (diff)
refactor(webauthn): include all failures for passkeys (#8865)
This includes all failures for passkeys as a logged attempt in the auth logs. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/mocks')
-rw-r--r--internal/mocks/authelia_ctx.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/mocks/authelia_ctx.go b/internal/mocks/authelia_ctx.go
index 1b285a827..b69f03ab2 100644
--- a/internal/mocks/authelia_ctx.go
+++ b/internal/mocks/authelia_ctx.go
@@ -268,6 +268,18 @@ func (m *MockAutheliaCtx) SetRequestBody(t *testing.T, body interface{}) {
m.Ctx.Request.SetBody(bodyBytes)
}
+func (m *MockAutheliaCtx) LogEntryN(i int) *logrus.Entry {
+ entries := m.Hook.AllEntries()
+
+ n := len(entries) - (1 + i)
+
+ if n < 0 {
+ return nil
+ }
+
+ return entries[n]
+}
+
// AssertKO assert an error response from the service.
func (m *MockAutheliaCtx) AssertKO(t *testing.T, message string, code int) {
assert.Equal(t, code, m.Ctx.Response.StatusCode())