mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 15:31:38 +02:00
feat: website auth, username + key registration, NIP-05 directory
- api/website.rs: sign-in-with-wallet (dapp connect). challenge bound to origin + short TTL; verify is single-use (remove-before-verify, race-safe), expiry- checked, signature via Result<(),AppError> verifiers (no oracle), resolves an EXISTING user by the proven key's pubkey_hash (never mints identity), mints a Platform::Web session. - api/users.rs: username set/get + by-username lookup (JWT-gated, 409 on taken, constant-shape lookup); per-asset key registration bound to the JWT user (no spoofable user_id) + public key-directory reads. - api/nip05.rs: /.well-known/nostr.json directory (username -> nostr_pubkey). - Wired into api/mod.rs; website+users nested at /api/v1, nip05 at root; all paths/schemas registered (openapi.json now 17 endpoints). - main.rs: periodic GC of expired web challenges (bounds the in-memory store). Adversarially reviewed (register_key authz + website identity-binding both hold; no critical/high). 69 tests green. Deferred LOW: per-IP rate-limit on the website routes lands with the router-assembly unit.
This commit is contained in:
@@ -3,4 +3,7 @@
|
||||
pub mod auth;
|
||||
pub mod health;
|
||||
pub mod middleware;
|
||||
pub mod nip05;
|
||||
pub mod openapi;
|
||||
pub mod users;
|
||||
pub mod website;
|
||||
|
||||
Reference in New Issue
Block a user