Skip to content

Commit 3c3ba2e

Browse files
jzimdarsclaude
andcommitted
Revoke access, as HEY and Basecamp say, and label read tokens "Read only"
Connected apps' Disconnect becomes "Revoke access", in the row, the dialog and its notice, and the consent screen's closing line says the same. The "Also remove these webhooks" checkbox moves into the box that lists them. The personal access token form and reveal say "Read only", as consent and Connected apps do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent af47db9 commit 3c3ba2e

9 files changed

Lines changed: 24 additions & 26 deletions

File tree

‎app/controllers/my/connected_apps_controller.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def destroy
2424

2525
@tokens.each { |grant| grant.revoke reason: "disconnected", actor: "user" }
2626

27-
redirect_to my_connected_apps_path, notice: "#{helpers.oauth_client_self_name(@client)} has been disconnected"
27+
redirect_to my_connected_apps_path, notice: "Access revoked for #{helpers.oauth_client_self_name(@client)}"
2828
end
2929

3030
private

‎app/views/my/access_tokens/_reveal.html.erb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<article id="new_access_token" class="panel panel--wide shadow center txt-align-start" style="view-transition-name: <%= dom_id(access_token) %>" data-turbo-temporary>
33
<div class="flex flex-column gap">
44
<label class="flex flex-column gap-half txt-align-start">
5-
<strong><%= access_token.description %> (<%= access_token.permission == "write" ? "Read and write" : "Read" %>)</strong>
5+
<strong><%= access_token.description %> (<%= access_token.permission == "write" ? "Read and write" : "Read only" %>)</strong>
66
<input type="text" value="<%= access_token.raw_token %>" class="input" readonly>
77
</label>
88
<p class="margin-none txt-small">Be sure to save this access token now because you won’t be able to see it again.</p>

‎app/views/my/access_tokens/new.html.erb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<div class="flex flex-column gap-half">
2121
<strong><%= form.label :permission %></strong>
22-
<%= form.select :permission, options_for_select({ "Read" => "read", "Read and write" => "write"}), {}, class: "input input--select" %>
22+
<%= form.select :permission, options_for_select({ "Read only" => "read", "Read and write" => "write"}), {}, class: "input input--select" %>
2323
</div>
2424

2525
<%= form.button type: :submit, class: "btn btn--link center txt-medium" do %>

‎app/views/my/connected_apps/_connected_app.html.erb‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,27 @@
3737
<div class="connected-app__disconnect" data-controller="dialog" data-dialog-modal-value="true" data-action="keydown.esc->dialog#close:stop">
3838
<button type="button" class="btn txt-negative borderless txt-small" data-action="dialog#open" aria-describedby="<%= dom_id(client, :connected_app_name) %>">
3939
<%= icon_tag "trash" %>
40-
<span>Disconnect</span>
40+
<span>Revoke access</span>
4141
</button>
4242

4343
<dialog class="dialog panel fill-white shadow gap flex-column txt-align-center" style="--panel-size: 44ch" data-dialog-target="dialog" aria-labelledby="<%= dom_id(client, :disconnect_title) %>">
44-
<h3 class="txt-large txt-bold margin-none" id="<%= dom_id(client, :disconnect_title) %>">Disconnect <bdi><%= oauth_client_self_name(client) %></bdi>?</h3>
44+
<h3 class="txt-large txt-bold margin-none" id="<%= dom_id(client, :disconnect_title) %>">Revoke access for <bdi><%= oauth_client_self_name(client) %></bdi>?</h3>
4545
<p class="txt-medium margin-none">It loses its access to Fizzy right away. To use it again, reconnect it.</p>
4646

4747
<%= form_with url: my_connected_app_path(client), method: :delete, class: "flex flex-column" do |form| %>
4848
<% if webhooks.any? %>
49-
<div class="flex flex-column gap margin-block-start">
50-
<div class="connected-app__webhooks txt-align-start" role="note">
51-
<p class="margin-none">It set up <%= webhooks.one? ? "this webhook" : "these webhooks" %>, which will keep running unless you remove <%= webhooks.one? ? "it" : "them" %>:</p>
52-
<ul class="margin-block-start-half margin-none-block-end">
53-
<% webhooks.each do |webhook| %>
54-
<li>
55-
<strong><%= webhook.name %></strong> on <%= webhook.board.name %><%= " in #{webhook.account.name}" unless webhook.account == Current.account %>
56-
<%= hidden_field_tag "webhook_ids[]", webhook.id, id: nil %>
57-
</li>
58-
<% end %>
59-
</ul>
60-
</div>
49+
<div class="connected-app__webhooks flex flex-column gap-half margin-block-start txt-align-start">
50+
<p class="margin-none">It set up <%= webhooks.one? ? "this webhook" : "these webhooks" %>, which will keep running unless you remove <%= webhooks.one? ? "it" : "them" %>:</p>
51+
<ul class="margin-none">
52+
<% webhooks.each do |webhook| %>
53+
<li>
54+
<strong><%= webhook.name %></strong> on <%= webhook.board.name %><%= " in #{webhook.account.name}" unless webhook.account == Current.account %>
55+
<%= hidden_field_tag "webhook_ids[]", webhook.id, id: nil %>
56+
</li>
57+
<% end %>
58+
</ul>
6159

62-
<label class="flex gap-half align-center justify-center">
60+
<label class="flex gap-half align-center justify-start margin-block-start-half">
6361
<%= check_box_tag :remove_webhooks, "1", false, class: "checkbox", id: dom_id(client, :remove_webhooks) %>
6462
Also remove <%= webhooks.one? ? "this webhook" : "these webhooks" %>
6563
</label>
@@ -68,7 +66,7 @@
6866

6967
<div class="flex gap-half justify-center margin-block-start">
7068
<button type="button" class="btn" data-action="dialog#close">Cancel</button>
71-
<%= form.button "Disconnect", class: "btn txt-negative" %>
69+
<%= form.button "Revoke access", class: "btn txt-negative" %>
7270
</div>
7371
<% end %>
7472
</dialog>

‎app/views/my/connected_apps/index.html.erb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<% else %>
2929
<div class="connected-apps__empty flex flex-column gap-half">
3030
<p class="margin-none"><strong>Nothing connected yet.</strong></p>
31-
<p class="txt-small txt-subtle margin-none">AI assistants and other apps you connect to Fizzy show up here, so you can see what each one can do and disconnect it whenever you like.</p>
31+
<p class="txt-small txt-subtle margin-none">AI assistants and other apps you connect to Fizzy show up here, so you can see what each one can do and revoke its access whenever you like.</p>
3232
</div>
3333
<% end %>
3434
</section>

‎app/views/oauth/authorizations/new.html.erb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<%= render "oauth/authorizations/access", form: f, client: @client, scope: @scope, one_account: @accounts.present? %>
3838

3939
<p class="oauth-consent__destination txt-small txt-subtle margin-none">
40-
If you change your mind, you can disconnect this at any time in <%= link_to "Connected apps", my_connected_apps_path, class: "txt-link" %>.
40+
If you change your mind, you can revoke its access at any time in <%= link_to "Connected apps", my_connected_apps_path, class: "txt-link" %>.
4141
</p>
4242

4343
<div class="oauth-consent__actions flex gap">

‎test/controllers/my/connected_apps_controller_test.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class My::ConnectedAppsControllerTest < ActionDispatch::IntegrationTest
114114
end
115115

116116
assert_redirected_to my_connected_apps_path
117-
assert_match "disconnected", flash[:notice]
117+
assert_match "Access revoked", flash[:notice]
118118
end
119119

120120
test "the notice names the app as the list does, and a name of nothing but direction controls as an unnamed app" do
@@ -123,14 +123,14 @@ class My::ConnectedAppsControllerTest < ActionDispatch::IntegrationTest
123123

124124
delete my_connected_app_path(client)
125125

126-
assert_equal "Unnamed app has been disconnected", flash[:notice]
126+
assert_equal "Access revoked for Unnamed app", flash[:notice]
127127

128128
named = Oauth::Client.create!(name: "\u202EBoard Sync", redirect_uris: %w[ http://127.0.0.1/cb ], dynamically_registered: true)
129129
@identity.access_tokens.create!(oauth_client: named, permission: :read)
130130

131131
delete my_connected_app_path(named)
132132

133-
assert_equal "Board Sync has been disconnected", flash[:notice]
133+
assert_equal "Access revoked for Board Sync", flash[:notice]
134134
end
135135

136136
test "the profile entry reads Connected apps" do

‎test/integration/oauth_consent_screen_test.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class OauthConsentScreenTest < ActionDispatch::IntegrationTest
1717
assert_select ".oauth-client__name", text: "connector.example.com"
1818
assert_select ".oauth-client__self-name", text: /\ASays it’s “Totally Fizzy”\z/
1919
assert_select ".oauth-client__warning", text: /\AWe haven’t checked this app\. Anyone can run an app at any address, so only authorize it if you trust connector\.example\.com\.\z/
20-
assert_select ".oauth-consent__destination", text: /\AIf you change your mind, you can disconnect this at any time in Connected apps\.\z/
20+
assert_select ".oauth-consent__destination", text: /\AIf you change your mind, you can revoke its access at any time in Connected apps\.\z/
2121
end
2222

2323
test "a self-registered app on this device is named as one" do

‎test/integration/oauth_delegate_resources_test.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class OauthDelegateResourcesTest < ActionDispatch::IntegrationTest
293293

294294
assert_response :success
295295
assert_select "dialog li", text: /#{Regexp.escape(webhook.name)}/
296-
assert_select "dialog[aria-labelledby=?] ##{ActionView::RecordIdentifier.dom_id(@client, :disconnect_title)}", ActionView::RecordIdentifier.dom_id(@client, :disconnect_title), text: "Disconnect #{@client.name}?"
296+
assert_select "dialog[aria-labelledby=?] ##{ActionView::RecordIdentifier.dom_id(@client, :disconnect_title)}", ActionView::RecordIdentifier.dom_id(@client, :disconnect_title), text: "Revoke access for #{@client.name}?"
297297
assert_select "input[type=checkbox][name=remove_webhooks]:not([checked])"
298298
end
299299

0 commit comments

Comments
 (0)