Files
akkounts/db/schema.rb
T
raucao 8fc7ffdd1d
CI / Test (pull_request) Successful in 41s
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-02 16:40:25 +04:00

186 lines
7.1 KiB
Ruby

# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2026_11_02_120000) do
create_table "active_storage_attachments", force: :cascade do |t|
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_type", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.bigint "byte_size", null: false
t.string "checksum"
t.string "content_type"
t.datetime "created_at", null: false
t.string "filename", null: false
t.string "key", null: false
t.text "metadata"
t.string "service_name", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "app_catalog_web_apps", force: :cascade do |t|
t.datetime "created_at", null: false
t.text "metadata"
t.string "name"
t.datetime "updated_at", null: false
t.string "url"
end
create_table "donations", force: :cascade do |t|
t.integer "amount_sats"
t.string "btcpay_invoice_id"
t.datetime "created_at", null: false
t.string "donation_method"
t.integer "fiat_amount"
t.string "fiat_currency", default: "USD"
t.datetime "paid_at", precision: nil
t.string "payment_method"
t.string "payment_status"
t.string "public_name"
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["payment_status"], name: "index_donations_on_payment_status"
t.index ["user_id"], name: "index_donations_on_user_id"
end
create_table "editable_contents", force: :cascade do |t|
t.text "content"
t.string "context"
t.datetime "created_at", null: false
t.string "key"
t.string "lang", default: "en"
t.boolean "rich_text", default: false
t.datetime "updated_at", null: false
end
create_table "flipper_features", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.index ["key"], name: "index_flipper_features_on_key", unique: true
end
create_table "flipper_gates", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "feature_key", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.text "value"
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
end
create_table "invitations", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "invited_user_id"
t.string "token"
t.datetime "updated_at", null: false
t.datetime "used_at", precision: nil
t.integer "user_id"
t.index ["invited_user_id"], name: "index_invitations_on_invited_user_id"
t.index ["user_id"], name: "index_invitations_on_user_id"
end
create_table "remote_storage_authorizations", force: :cascade do |t|
t.string "app_name"
t.string "client_id"
t.datetime "created_at", null: false
t.datetime "expire_at"
t.text "permissions", default: "--- []\n"
t.string "redirect_uri"
t.string "token"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.integer "web_app_id"
t.index ["permissions"], name: "index_remote_storage_authorizations_on_permissions"
t.index ["user_id"], name: "index_remote_storage_authorizations_on_user_id"
t.index ["web_app_id"], name: "index_remote_storage_authorizations_on_web_app_id"
end
create_table "rs_authorization_codes", force: :cascade do |t|
t.string "client_id", null: false
t.string "code_challenge", null: false
t.string "code_challenge_method", default: "S256", null: false
t.string "code_digest", null: false
t.datetime "created_at", null: false
t.datetime "expires_at", null: false
t.datetime "permission_expire_at"
t.text "permissions", default: "--- []\n"
t.string "redirect_uri", null: false
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["code_digest"], name: "index_rs_authorization_codes_on_code_digest", unique: true
t.index ["user_id"], name: "index_rs_authorization_codes_on_user_id"
end
create_table "settings", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "value"
t.string "var", null: false
t.index ["var"], name: "index_settings_on_var", unique: true
end
create_table "users", force: :cascade do |t|
t.string "cn"
t.datetime "confirmation_sent_at", precision: nil
t.string "confirmation_token"
t.datetime "confirmed_at", precision: nil
t.datetime "created_at", null: false
t.string "email", default: "", null: false
t.text "lndhub_password"
t.string "lndhub_username"
t.bigint "mastodon_id"
t.string "ou"
t.string "pgp_fpr"
t.text "preferences"
t.datetime "remember_created_at"
t.string "remember_token"
t.datetime "reset_password_sent_at", precision: nil
t.string "reset_password_token"
t.string "unconfirmed_email"
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "zaps", force: :cascade do |t|
t.bigint "amount"
t.datetime "created_at", null: false
t.text "payment_request"
t.json "receipt"
t.json "request"
t.datetime "settled_at"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["user_id"], name: "index_zaps_on_user_id"
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "remote_storage_authorizations", "app_catalog_web_apps", column: "web_app_id"
add_foreign_key "remote_storage_authorizations", "users"
add_foreign_key "rs_authorization_codes", "users"
add_foreign_key "zaps", "users"
end