Skip to content

fix(admin): log and alert on repeated failed admin authentication - #393

Closed
AkinolaDev wants to merge 2 commits into
Rotula-Labs:mainfrom
AkinolaDev:fix/issue-158-fix-admin-log-and-alert-on-repeated-failed
Closed

AkinolaDev wants to merge 2 commits into
Rotula-Labs:mainfrom
AkinolaDev:fix/issue-158-fix-admin-log-and-alert-on-repeated-failed

Conversation

@AkinolaDev

Copy link
Copy Markdown

Overview

This PR adds logging and critical alerting for failed admin authentication attempts. Every failed admin auth now produces a log entry through observabilityService with the source address and request id, and repeated failures from a single source raise a critical alert. The response body and status remain unchanged so callers learn nothing.

Related Issue

Changes

🔍 Failed Auth Observability

  • [MODIFY] src/routes/admin.routes.ts

    • The failure branch now records each failed admin authentication via observabilityService with the source address and request id.
    • Repeated failures from one source cross a threshold and raise a critical alert.
    • Response body and 401 status are left unchanged.
  • [MODIFY] src/services/observability.service.ts

    • Adds support for logging failed admin authentication attempts and raising a critical alert when failures from a single source exceed the threshold.

Verification Results

npm test
✅ Passes locally
Acceptance Criteria Status
Every failed admin authentication produces a log entry ✅ Failure branch logs source address and request id via observabilityService
Repeated failures from one source raise a critical alert ✅ Threshold-based critical alert on repeated failures per source
The response body and status are unchanged ✅ Still returns 401 with the same body
npm test passes locally ✅ Verified locally

Closes #158

Toyosi5566 and others added 2 commits October 16, 2026 15:32
.env is read by dotenv.config() at boot and holds ENCRYPTION_KEY, JWT_SECRET,
SEP10_SERVER_SECRET, HMAC_KEY and DEPLOYER_SECRET_KEY. None of the .env
variants were ignored, so a contributor's real credentials file could be
staged by a routine `git add .` with nothing to warn anyone. Ignore the
.env variants and keep the committed example file trackable.

No .env file is tracked at HEAD and no .env object appears anywhere in the
repository history, so this is preventive rather than a remediation.
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@AkinolaDev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Abdul-dev-creator
Abdul-dev-creator force-pushed the main branch 2 times, most recently from af3277b to a2a4455 Compare October 18, 2026 18:47
@AkinolaDev AkinolaDev closed this by deleting the head repository Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(admin): log and alert on repeated failed admin authentication

2 participants