Commit Graph
44 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 3dcd263d43 Store the remoteStorage user agent as text, not varchar(255)
CI / Test (pull_request) Successful in 41s
Real-world user agents (in-app browsers, Android WebView variants) commonly
exceed 255 characters. On PostgreSQL that would raise and 500 the consent
POST and token exchange; SQLite dev/test does not enforce the limit, so it
went unnoticed. Use text columns for user_agent on both tables.

Part of #254
2026-11-03 11:59:52 +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 295261b332 Address review findings in the PKCE flow
CI / Test (pull_request) Failing after 46s
- Make authorization-code redemption atomic: claim the code with a guarded
  delete inside the transaction that creates the authorization, so concurrent
  exchanges can't both issue a token (RFC 6749 4.1.3)
- Compare the token request's client_id host to the code's stored client_id
  (defense-in-depth alongside the exact redirect_uri match)
- Reject unknown response_type values with unsupported_response_type
- Validate the PKCE code_challenge (43-128 unreserved chars, S256) so a client
  can't persist an over-long or malformed challenge
- Return invalid_request for missing token-endpoint parameters, and set
  Cache-Control: no-store on error responses too
- Use the right separator when the redirect_uri already has a query string
- Look codes up through the active scope; drop the unused consume!; serialize
  permissions as JSON
- Purge abandoned authorization codes via a recurring Solid Queue task

Part of #254
2026-11-03 11:40:18 +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 6014134396 Finish MVP for content editing 2025-05-29 14:18:14 +04:00
raucao 5c8ffc2630 Add editable contents table 2025-05-28 18:39:25 +04:00
raucao 252b0f1792 Revert "Add ActionText configs, update spec helpers/configs"
This reverts commit c9d23f829d.
2025-05-28 16:53:31 +04:00
raucao c9d23f829d Add ActionText configs, update spec helpers/configs 2025-05-28 14:52:31 +04:00
raucao e48132cf5f Set member status to sustainer upon payment
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Introduces a state machine for the payment status as well.

refs #213
2025-05-27 16:39:03 +04:00
raucao c291765777 Add mastodon_id to users 2025-05-17 16:44:13 +04:00
raucao 84ed4b2de2 Remove old ln columns from users table
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-05-06 19:47:58 +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 1ddecab2c3 Upgrade Rails to 8.0
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-04-28 17:49:54 +04:00
raucao 90a8a70c15 Add OpenPGP key to LDAP directory and User model
continuous-integration/drone/push Build is passing
2024-09-23 15:20:00 +02:00
raucao 5a5c316c14 Fix time format in migration
continuous-integration/drone/push Build is passing
2024-06-09 13:29:39 +02:00
raucao 5588e3b3e8 Add settled_at to zaps, scope by settlement status
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
2024-06-07 15:11:06 +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 49d24990b4 Add zap model, user relation 2024-05-04 17:05:34 +02:00
raucao 51a3cb60ec Merge pull request 'Add custom LDAP attributes to schema' (#181) from feature/custom_ldap_attributes into master
continuous-integration/drone/push Build is passing
Reviewed-on: #181
Reviewed-by: greg <greg@noreply.kosmos.org>
2024-03-19 14:46:44 +00:00
raucao 5a3adba603 Move nostr pubkeys to LDAP attribute
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
closes #173
2024-03-17 11:04:11 +01:00
raucao 079ee8833c Implement bitcoin donations via BTCPay 2024-03-02 14:31:48 +01:00
raucao c9052b35f6 Database update for Flipper
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-08 12:29:11 +01:00
Râu Cao fcea11f0e5 Associate RS authorizations with web apps 2023-10-24 17:29:24 +02:00
Râu Cao e56c9bd0d5 Add web app model, service to fetch metadata 2023-10-24 17:29:23 +02:00
Râu Cao 86f85a90f4 Add/configure ActiveStorage 2023-09-06 12:14:28 +02:00
Râu Cao 558100c35e Fix migration failing with PostgreSQL 2023-09-03 15:28:32 +02:00
galfert 716d4b944a Merge branch 'master' into feature/rs-oauth
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
# Conflicts:
#	app/models/user.rb
#	config/routes.rb
#	db/schema.rb
2023-06-20 14:07:46 +02:00
Râu Cao bc4d9ff528 Add nostr_pubkey to users 2023-06-16 13:52:42 +02:00
Râu Cao 287adbd365 Add flipper gem and database migration/tables 2023-05-23 14:09:35 +02:00
Râu Cao eeabbdb7df Merge branch 'master' into feature/rs-oauth
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-13 15:02:51 +02:00
Râu Cao 23821f9e65 Add preferences to user model 2023-04-04 12:27:49 +02:00
galfert ee42d68471 Add RemoteStorageAuthorization model
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-03-28 01:21:28 +02:00
Râu Cao 8a7016a30b Add remember-me function for sign-in
When checked, remember user for 2 weeks. Otherwise expire session after
30 minutes.
2023-03-19 18:06:18 +07:00
Râu Cao dfb12b8f62 Fix typo
continuous-integration/drone/push Build is passing
2023-03-02 15:54:03 +08:00
Râu Cao 3c2fe7c15d Remove ln_login from users
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Not needed anymore, removing in favor of unencrypted `ln_account`.
2023-02-23 20:13:08 +08:00
Râu Cao cd7b05e2ff Add rails-settings-cached, use for initial feature flags
continuous-integration/drone/push Build is passing
2023-02-17 17:07:42 +08:00
Râu Cao 51952ecdc2 Add migration for unencrypted ln login field
continuous-integration/drone/push Build is passing
2023-01-11 19:50:01 +08:00
basti f94227f9f3 Create LndHub accounts 2021-11-19 20:10:36 -06:00
basti 5e2d5c3b28 Add paid_at date to donations
continuous-integration/drone/push Build is passing
2020-12-19 13:28:47 +01:00
basti 40f3e8327a Basic donation records
Adds donation model/table and basic manual management in the admin
panel, as well as basic listing of users' own donations.
2020-12-17 21:56:51 +01:00
basti c8ccb418b2 Add indexes for invitations table 2020-12-03 14:49:02 +01:00
basti d7fbda0855 Add basic invitations 2020-12-02 15:22:58 +01:00
basti 674b0a0ff5 Add LDAP logins and password resets, config, etc. 2020-11-10 11:36:06 +01:00