Skip to content

feat: add admin backend foundation (login, session, health)#641

Open
Ferryx349 wants to merge 5 commits into
cameri:mainfrom
Ferryx349:ADMIN-CONSOLE-1
Open

feat: add admin backend foundation (login, session, health)#641
Ferryx349 wants to merge 5 commits into
cameri:mainfrom
Ferryx349:ADMIN-CONSOLE-1

Conversation

@Ferryx349

@Ferryx349 Ferryx349 commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Description

This is the groundwork for admin console backend with a disabled-by-default admin API. Currently with password login(will replace it with NIP-98 later). API also includes session management, and a protected health endpoint.

Related Issue

#631

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
@changeset-bot

changeset-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 92516e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Ferryx349 Ferryx349 marked this pull request as draft June 7, 2026 08:18
Comment thread src/routes/admin/index.ts Fixed
Comment thread src/routes/admin/index.ts Fixed
@coveralls

coveralls commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 67.248% (+0.3%) from 66.977% — Ferryx349:ADMIN-CONSOLE-1 into cameri:main

Ferryx349 added 4 commits June 8, 2026 23:00
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
Comment thread src/routes/admin/index.ts
router.use(rateLimiterMiddleware)

router.post('/login', adminLoginRateLimitMiddleware, json(), withController(createPostAdminLoginController))
router.get('/session', adminRateLimitMiddleware, requireAdminAuth, withController(createGetAdminSessionController))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added rate limiting using the existing Redis-backed pattern (limits.admin & per-route middleware). CodeQL still warns because it doesn’t recognize our custom limiter, I believe it’s a false positive. @cameri wdyt?

Comment thread src/routes/admin/index.ts

router.post('/login', adminLoginRateLimitMiddleware, json(), withController(createPostAdminLoginController))
router.get('/session', adminRateLimitMiddleware, requireAdminAuth, withController(createGetAdminSessionController))
router.get('/health', adminRateLimitMiddleware, requireAdminAuth, withController(createGetAdminHealthController))
@Ferryx349 Ferryx349 marked this pull request as ready for review June 12, 2026 08:21
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.

3 participants