Add a server-side API for avatar and header images: uploads are cropped with Vips (400x400 and 1500x500, GIFs passed through, EXIF stripped, transparency flattened to white) and stored as one pending attachment per field. Saving the profile flushes them to the configured Blossom server, authorized by a user-signed kind-24242 token whose x tags cover the stored hashes.
The publish endpoint collapsed every validation failure into a generic "Invalid event", making a real-world rejection impossible to diagnose. Return and log the specific reason instead: public key mismatch, non-integer created_at/kind, disallowed kind, invalid id/signature, stale created_at, content/tags too large, or a malformed request.
FetchEvent wrapped its wait in Timeout.timeout and FetchLatestEvent
wrapped the relay loop in another one. The nesting leaked
Timeout::ExitException, which is neither a Timeout::Error nor a
StandardError, so it escaped the rescue and surfaced as a 500 on the
metadata endpoint.
- FetchEvent waits on the condition variable with a 5s timeout instead
of Timeout.timeout, and wakes immediately when the relay errors
- FetchLatestEvent uses a monotonic deadline instead of Timeout.timeout,
and skips a relay that raises, so one bad relay cannot abort discovery
- PublishEvent uses thread.join(TIMEOUT) instead of Timeout.timeout
The nostr gem's Event#verify_signature only validates the signature over
the event's claimed id and never recomputes the id from the serialized
body. A genuine (id, sig, pubkey) triple lifted from any public event
could therefore be replayed with injected tags, kind or content and still
pass verification. For Nostr login this allows signing in as the key
owner.
Add NostrManager::VerifySignedEvent, which recomputes the id with
Digest::SHA256.hexdigest(JSON.dump(event.serialize)) and rejects any
mismatch, and use it in the pubkey verification and Nostr login flows.
VerifyAuth now also asserts kind 22242.
Implements the optional OAuth 2.0 Authorization Code grant with PKCE
(RFC 7636) for remoteStorage, as described in the remoteStorage spec
(section 10.1).
- Advertise the authorization and token endpoints plus the supported
code_challenge method (S256) in WebFinger, and bump the advertised
spec version to draft-dejong-remotestorage-27
- Add RsAuthorizationCode: a short-lived (5 min), single-use authorization
code stored only as a SHA256 digest
- Add RsOauthManager services for issuing and exchanging codes, including
S256 verification
- Add a cross-origin POST /rs/oauth/token endpoint that exchanges a code
(and code_verifier) for an access token, with CORS and no CSRF token
- Consent dialog now carries response_type / code_challenge through the
form and redirects with the code in the query string for the code flow
- Remove the existing-token reuse shortcut so every authorization results
in a distinct authorization (and token)
Part of #254
Part of the process of removing support for serving multiple domains
from a single akkounts instance.
Also puts the Lightning Address discovery routes under the .well-known
path. Combined, these changes simplify reverse-proxying to the
.well-known endpoints.