Skip to content

Commit 47f71cb

Browse files
committed
Merge branch 'main' into mobile-app/scoped-stylesheets
* main: (26 commits) Update fizzy-saas Update to fizzy-saas to remove jobs from beta Claude can fetch the .mcp.json file that shipyard places in your home Update fizzy-saas This was moved to the engine Introduce an "owner" role, and prevent it from being administered Make sure the sqlite db is prepared in SAAS mode Update fizzy-saas gem Move env-specific config bits to the saas gem Migrate sqlite schema Use main branch of fizzy-saas Change copy Make sign up Magic Links work across devices Remove unused view Update signup with the design from signin Revert "Update to latest version with the env config bits moved" Update to latest version with the env config bits moved Organize everything under Signups Create signups controller update pipelines ...
2 parents 3734762 + 6fb7de8 commit 47f71cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+394
-187
lines changed

.github/workflows/ci-oss.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: CI (OSS)
22

33
on:
44
pull_request:
5-
if: github.event.pull_request.head.repo.full_name != github.repository
5+
types: [opened, synchronize]
66

77
jobs:
88
test:
9+
if: github.event.pull_request.head.repo.full_name != github.repository
910
uses: ./.github/workflows/test.yml
1011
with:
1112
saas: false

.mcp.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Fizzy uses **URL path-based multi-tenancy**:
6868

6969
**Passwordless magic link authentication**:
7070
- Global `Identity` (email-based) can have `Users` in multiple Accounts
71-
- Users belong to an Account and have roles: admin, member, system
71+
- Users belong to an Account and have roles: owner, admin, member, system
7272
- Sessions managed via signed cookies
7373
- Board-level access control via `Access` records
7474

@@ -84,7 +84,7 @@ Fizzy uses **URL path-based multi-tenancy**:
8484

8585
**User** → Account membership
8686
- Belongs to Account and Identity
87-
- Has role (admin/member/system)
87+
- Has role (owner/admin/member/system)
8888
- Board access via explicit `Access` records
8989

9090
**Board** → Primary organizational unit

Gemfile.saas.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/basecamp/fizzy-saas
3-
revision: 7f392bbbf9f5170d334b6ee2f6d240569bd157ed
3+
revision: 130c8b23f9861a89feb59ca68f192bd05d51310c
44
specs:
55
fizzy-saas (0.1.0)
66
prometheus-client-mmap
@@ -16,7 +16,7 @@ GIT
1616
yabeda-http_requests
1717
yabeda-prometheus-mmap
1818
yabeda-puma-plugin
19-
yabeda-rails
19+
yabeda-rails (>= 0.10)
2020

2121
GIT
2222
remote: https://github.com/basecamp/queenbee-plugin
@@ -52,7 +52,7 @@ GIT
5252

5353
GIT
5454
remote: https://github.com/rails/rails.git
55-
revision: 4f7ab01bb5d6be78c7447dbb230c55027d08ae34
55+
revision: 690ec8898318b8f50714e86676353ebe1551261e
5656
branch: main
5757
specs:
5858
actioncable (8.2.0.alpha)
@@ -423,7 +423,7 @@ GEM
423423
rake-compiler-dock (1.9.1)
424424
rb_sys (0.9.117)
425425
rake-compiler-dock (= 1.9.1)
426-
rdoc (6.15.1)
426+
rdoc (6.16.1)
427427
erb
428428
psych (>= 4.0.0)
429429
tsort
@@ -479,10 +479,10 @@ GEM
479479
rexml (~> 3.2, >= 3.2.5)
480480
rubyzip (>= 1.2.2, < 4.0)
481481
websocket (~> 1.0)
482-
sentry-rails (6.1.1)
482+
sentry-rails (6.2.0)
483483
railties (>= 5.2.0)
484-
sentry-ruby (~> 6.1.1)
485-
sentry-ruby (6.1.1)
484+
sentry-ruby (~> 6.2.0)
485+
sentry-ruby (6.2.0)
486486
bigdecimal
487487
concurrent-ruby (~> 1.0, >= 1.0.2)
488488
sniffer (0.5.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Under the hood, this will create or remove `tmp/email-dev.txt`.
5555

5656
## Deployment
5757

58-
We recommend [Kamal](https://kamal-deploy.org/) for deploying Fizzy. This project comes with a vanilla Rails template, you can find our production setup in [`fizzy-saas`](https://github.com/basecamp/fizzy-saas).
58+
We recommend [Kamal](https://kamal-deploy.org/) for deploying Fizzy. This project comes with a vanilla Rails template. You can find our production setup in [`fizzy-saas`](https://github.com/basecamp/fizzy-saas).
5959

6060
### Web Push Notifications
6161

app/assets/images/system_user.png

-444 KB
Loading

app/controllers/sessions/magic_links_controller.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def show
99
end
1010

1111
def create
12-
if identity = MagicLink.consume(code)
13-
start_new_session_for identity
14-
redirect_to after_authentication_url
12+
if magic_link = MagicLink.consume(code)
13+
start_new_session_for magic_link.identity
14+
redirect_to after_sign_in_url(magic_link)
1515
else
1616
redirect_to session_magic_link_path, alert: "Try another code."
1717
end
@@ -21,4 +21,12 @@ def create
2121
def code
2222
params.expect(:code)
2323
end
24+
25+
def after_sign_in_url(magic_link)
26+
if magic_link.for_sign_up?
27+
new_signup_completion_path
28+
else
29+
after_authentication_url
30+
end
31+
end
2432
end
Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
class SessionsController < ApplicationController
2-
# FIXME: Remove this before launch!
3-
unless Rails.env.local?
4-
http_basic_authenticate_with \
5-
name: Rails.application.credentials.account_signup_http_basic_auth.name,
6-
password: Rails.application.credentials.account_signup_http_basic_auth.password,
7-
realm: "Fizzy Signup",
8-
only: :create, unless: -> { Identity.exists?(email_address: email_address) }
9-
end
10-
112
disallow_account_scope
123
require_unauthenticated_access except: :destroy
134
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_path, alert: "Try again later." }
@@ -19,10 +10,11 @@ def new
1910

2011
def create
2112
if identity = Identity.find_by_email_address(email_address)
22-
handle_existing_user(identity)
23-
elsif
24-
handle_new_signup
13+
magic_link = identity.send_magic_link
14+
flash[:magic_link_code] = magic_link&.code if Rails.env.development?
2515
end
16+
17+
redirect_to session_magic_link_path
2618
end
2719

2820
def destroy
@@ -34,16 +26,4 @@ def destroy
3426
def email_address
3527
params.expect(:email_address)
3628
end
37-
38-
def handle_existing_user(identity)
39-
magic_link = identity.send_magic_link
40-
flash[:magic_link_code] = magic_link&.code if Rails.env.development?
41-
redirect_to session_magic_link_path
42-
end
43-
44-
def handle_new_signup
45-
Signup.new(email_address: email_address).create_identity
46-
session[:return_to_after_authenticating] = new_signup_completion_path
47-
redirect_to session_magic_link_path
48-
end
4929
end

app/controllers/signup/completions_controller.rb renamed to app/controllers/signups/completions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Signup::CompletionsController < ApplicationController
1+
class Signups::CompletionsController < ApplicationController
22
layout "public"
33

44
disallow_account_scope
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class SignupsController < ApplicationController
2+
# FIXME: Remove this before launch!
3+
unless Rails.env.local?
4+
http_basic_authenticate_with \
5+
name: Rails.application.credentials.account_signup_http_basic_auth.name,
6+
password: Rails.application.credentials.account_signup_http_basic_auth.password,
7+
realm: "Fizzy Signup"
8+
end
9+
10+
disallow_account_scope
11+
allow_unauthenticated_access
12+
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_signup_path, alert: "Try again later." }
13+
before_action :redirect_authenticated_user
14+
15+
layout "public"
16+
17+
def new
18+
@signup = Signup.new
19+
end
20+
21+
def create
22+
Signup.new(signup_params).create_identity
23+
redirect_to session_magic_link_path
24+
end
25+
26+
private
27+
def redirect_authenticated_user
28+
redirect_to new_signup_completion_path if authenticated?
29+
end
30+
31+
def signup_params
32+
params.expect signup: :email_address
33+
end
34+
end

0 commit comments

Comments
 (0)