Commit Graph
27 Commits
Author SHA1 Message Date
raucao 4bca003983 Hash remoteStorage access tokens at rest
CI / Test (pull_request) Successful in 45s
Release Drafter / Update release notes draft (pull_request) Successful in 4s
Store only SHA256(token) in a new token_digest column and use the digest for the Redis authorization keys instead of the plaintext token. The plaintext is now held in memory only for issuance.

This is the expand step: the plaintext token column stays in place so the old code can keep running during the deploy. A follow-up migration will drop it once rs:rekey_tokens has re-keyed Redis and confirmed no plaintext keys remain.

Refs #259
2026-11-04 09:33:57 +04:00
raucao 7c4bad860a Store per-device user agent for remoteStorage authorizations
- Add user_agent to remote_storage_authorizations and rs_authorization_codes
- Capture the browser's user agent at consent, carry it on the authorization
  code, and store it on the authorization when the code is exchanged
- Store it directly for the implicit flow too

With the reuse shortcut gone, each authorization is already a distinct
per-device token; this adds the metadata needed to label and display them.

Part of #254
2026-11-03 11:59:51 +04:00
raucao cd2b4c9ba5 Address second-round review findings in the PKCE core
CI / Test (pull_request) Successful in 42s
- Enqueue the expiry job and the "app connected" notification on
  after_commit instead of after_create, so they only fire once the (now
  transactional) code exchange commits
- Enforce the PKCE code_challenge format (43-128 unreserved chars, S256)
  with model validations, not only at the controller
- Drop the now-unused RsAuthorizationCode#expired?
- Cover the client_id-vs-stored-client_id check

Part of #254
2026-11-03 11:59:12 +04:00
raucao 8dd0bf10ce Add PKCE support to remoteStorage OAuth
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
2026-11-03 09:17:43 +04:00
raucao 1957df3bbd Fix avatars failing to be set on XMPP accounts
CI / Test (pull_request) Successful in 32s
Release Drafter / Update release notes draft (pull_request) Successful in 3s
There's a stray `end` that prematurely closes the class
2026-08-10 21:35:28 -06:00
raucao d737d9f6b8 Refactor ejabberd API integration
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 2s
2025-05-26 14:10:27 +04:00
raucao eae370b737 Migrate from lockbox to ActiveRecord encryption (1/2)
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-05-06 18:09:27 +04:00
raucao 3042a02a17 Allow users to update their OpenPGP pubkey
continuous-integration/drone/push Build is passing
2024-09-23 18:13:39 +02:00
raucao ba683a7b95 Move some Rails app services to UserManager namespace
continuous-integration/drone/push Build is passing
2024-09-23 16:03:02 +02:00
raucao b91d90d75c Fix some specs, improve config
Allow empty string to unset nostr relay URL config
2024-08-14 13:37:15 +02:00
raucao cbfa148051 Publish zap receipts to own relay in addition to requested ones
continuous-integration/drone/push Build is passing
2024-06-19 20:26:24 +02:00
raucao 48041630ca Limit number of relays to publish zap receipts to
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-05-10 13:57:25 +02:00
raucao c6c5d80fb4 WIP Persist zaps, create and send zap receipts
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-09 14:31:37 +02:00
raucao c3b82fc2a9 WIP Verify and respond to zap requests
continuous-integration/drone/push Build is passing
2024-04-16 19:13:10 +02:00
raucaoandgreg 80e69df75c Add global setting for default services, enable for preconfirmed accounts
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 4s
Co-authored-by: Greg Karékinian <greg@karekinian.com>
2024-03-28 17:21:20 +04:00
raucao 67689dcce3 Add service for creating invites
continuous-integration/drone/push Build is passing
2024-02-09 17:59:07 +01:00
raucao 179a82d2dd Use keyword arguments for ApplicationService calls
Not all services are using keywords, which breaks those calls in Ruby 3
2024-02-02 15:50:25 +02:00
Râu Cao 5b46f3adf5 Move exchanging of XMPP contacts to account confirmation
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Since the ejabberd service is now being enabled after the confirmation,
we also need to move the exchanging of roster contacts to that point.
2023-03-20 17:59:43 +07:00
Râu Cao e62bf67262 Use v2 API for creating new lndhub accounts
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-12-23 12:39:57 +07:00
basti bc20e89617 Fix exception during signup
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-01-10 09:28:12 -06:00
basti 58cc6811f9 Move XMPP contacts exchange to background job
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-02-03 13:16:47 +01:00
basti 8ad85636d9 Create LDAP users asynchronously
continuous-integration/drone/push Build is passing
2021-02-02 21:16:24 +01:00
basti 26e9073674 Fix XMPP API POST request
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Faraday does not turn hashes into JSON by itself apparently.
2020-12-13 14:07:25 +01:00
basti ee72a32c7e Exchange XMPP contacts when invitee signs up
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2020-12-08 19:16:08 +01:00
basti 6dac732a7f Move invitation invalidation to service 2020-12-08 17:52:53 +01:00
basti e8c1a6066a Move user db creation to service 2020-12-08 17:39:54 +01:00
basti 18df8fe449 Add account creation service 2020-11-29 17:31:08 +01:00