masks 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/LICENSE +21 -0
- data/README.md +235 -29
- data/app/controllers/masks/rails/avatars_controller.rb +51 -0
- data/app/controllers/masks/rails/base_controller.rb +13 -0
- data/app/controllers/masks/rails/handshakes_controller.rb +86 -0
- data/app/controllers/masks/rails/sessions_controller.rb +118 -0
- data/app/views/layouts/masks/rails/plain.html.erb +47 -0
- data/app/views/masks/rails/handshakes/refused.html.erb +12 -0
- data/app/views/masks/rails/handshakes/show.html.erb +40 -0
- data/config/routes.rb +11 -82
- data/lib/generators/masks/install/install_generator.rb +35 -22
- data/lib/generators/masks/install/templates/masks.rb.tt +38 -0
- data/lib/masks/client/claims.rb +144 -0
- data/lib/masks/client/errors.rb +60 -0
- data/lib/masks/client/handshake.rb +104 -0
- data/lib/masks/client/http.rb +96 -0
- data/lib/masks/client/introspection.rb +29 -0
- data/lib/masks/client/issuer.rb +92 -0
- data/lib/masks/client/pkce.rb +27 -0
- data/lib/masks/client/rack.rb +62 -0
- data/lib/masks/client/registration.rb +115 -0
- data/lib/masks/client/registry.rb +25 -0
- data/lib/masks/client/resource.rb +92 -0
- data/lib/masks/client/session.rb +146 -0
- data/lib/masks/client/stores.rb +40 -0
- data/lib/masks/client/tokens.rb +70 -0
- data/lib/masks/client/tracker.rb +122 -0
- data/lib/masks/client/verifier.rb +42 -0
- data/lib/masks/client.rb +51 -0
- data/lib/masks/rails/authentication.rb +260 -0
- data/lib/masks/rails/configurable.rb +11 -0
- data/lib/masks/rails/configuration.rb +184 -0
- data/lib/masks/rails/credentials.rb +60 -0
- data/lib/masks/rails/engine.rb +20 -0
- data/lib/masks/rails/protected_resource.rb +51 -0
- data/lib/masks/rails.rb +10 -0
- data/lib/masks/version.rb +1 -3
- data/lib/masks.rb +3 -183
- metadata +48 -416
- data/MIT-LICENSE +0 -20
- data/Rakefile +0 -11
- data/app/assets/builds/masks/application.css +0 -1
- data/app/assets/builds/masks/application.js +0 -8549
- data/app/assets/builds/masks/application.js.map +0 -7
- data/app/assets/images/masks.png +0 -0
- data/app/assets/javascripts/application.js +0 -2
- data/app/assets/javascripts/controllers/application.js +0 -9
- data/app/assets/javascripts/controllers/emails_controller.js +0 -28
- data/app/assets/javascripts/controllers/index.js +0 -21
- data/app/assets/javascripts/controllers/keys_controller.js +0 -20
- data/app/assets/javascripts/controllers/recover_controller.js +0 -21
- data/app/assets/javascripts/controllers/recover_password_controller.js +0 -21
- data/app/assets/javascripts/controllers/session_controller.js +0 -94
- data/app/assets/javascripts/controllers/table_controller.js +0 -15
- data/app/assets/manifest.js +0 -2
- data/app/assets/masks_manifest.js +0 -2
- data/app/assets/stylesheets/application.css +0 -34
- data/app/controllers/concerns/masks/controller.rb +0 -114
- data/app/controllers/masks/actors_controller.rb +0 -15
- data/app/controllers/masks/application_controller.rb +0 -35
- data/app/controllers/masks/backup_codes_controller.rb +0 -34
- data/app/controllers/masks/debug_controller.rb +0 -9
- data/app/controllers/masks/devices_controller.rb +0 -20
- data/app/controllers/masks/emails_controller.rb +0 -60
- data/app/controllers/masks/error_controller.rb +0 -14
- data/app/controllers/masks/keys_controller.rb +0 -45
- data/app/controllers/masks/manage/actors_controller.rb +0 -83
- data/app/controllers/masks/manage/base_controller.rb +0 -20
- data/app/controllers/masks/manage/clients_controller.rb +0 -84
- data/app/controllers/masks/manage/dashboard_controller.rb +0 -15
- data/app/controllers/masks/manage/devices_controller.rb +0 -19
- data/app/controllers/masks/one_time_code_controller.rb +0 -49
- data/app/controllers/masks/openid/authorizations_controller.rb +0 -45
- data/app/controllers/masks/openid/discoveries_controller.rb +0 -55
- data/app/controllers/masks/openid/tokens_controller.rb +0 -45
- data/app/controllers/masks/openid/userinfo_controller.rb +0 -28
- data/app/controllers/masks/passwords_controller.rb +0 -33
- data/app/controllers/masks/recoveries_controller.rb +0 -43
- data/app/controllers/masks/sessions_controller.rb +0 -53
- data/app/helpers/masks/application_helper.rb +0 -49
- data/app/jobs/masks/application_job.rb +0 -7
- data/app/jobs/masks/expire_actors_job.rb +0 -15
- data/app/jobs/masks/expire_recoveries_job.rb +0 -15
- data/app/mailers/masks/actor_mailer.rb +0 -22
- data/app/mailers/masks/application_mailer.rb +0 -15
- data/app/models/concerns/masks/access.rb +0 -162
- data/app/models/concerns/masks/actor.rb +0 -132
- data/app/models/concerns/masks/adapter.rb +0 -68
- data/app/models/concerns/masks/role.rb +0 -9
- data/app/models/concerns/masks/scoped.rb +0 -54
- data/app/models/masks/access/actor_password.rb +0 -21
- data/app/models/masks/access/actor_scopes.rb +0 -18
- data/app/models/masks/access/actor_signup.rb +0 -21
- data/app/models/masks/actors/anonymous.rb +0 -40
- data/app/models/masks/actors/system.rb +0 -24
- data/app/models/masks/adapters/active_record.rb +0 -85
- data/app/models/masks/application_model.rb +0 -15
- data/app/models/masks/application_record.rb +0 -8
- data/app/models/masks/check.rb +0 -192
- data/app/models/masks/credential.rb +0 -166
- data/app/models/masks/credentials/access_token.rb +0 -60
- data/app/models/masks/credentials/backup_code.rb +0 -30
- data/app/models/masks/credentials/device.rb +0 -59
- data/app/models/masks/credentials/email.rb +0 -48
- data/app/models/masks/credentials/factor2.rb +0 -71
- data/app/models/masks/credentials/key.rb +0 -38
- data/app/models/masks/credentials/last_login.rb +0 -12
- data/app/models/masks/credentials/masquerade.rb +0 -32
- data/app/models/masks/credentials/nickname.rb +0 -63
- data/app/models/masks/credentials/one_time_code.rb +0 -34
- data/app/models/masks/credentials/password.rb +0 -28
- data/app/models/masks/credentials/recovery.rb +0 -71
- data/app/models/masks/credentials/return_to.rb +0 -27
- data/app/models/masks/credentials/session.rb +0 -67
- data/app/models/masks/device.rb +0 -30
- data/app/models/masks/error.rb +0 -51
- data/app/models/masks/event.rb +0 -14
- data/app/models/masks/mask.rb +0 -266
- data/app/models/masks/openid/authorization.rb +0 -116
- data/app/models/masks/openid/token.rb +0 -56
- data/app/models/masks/rails/actor.rb +0 -212
- data/app/models/masks/rails/actor_role.rb +0 -12
- data/app/models/masks/rails/device.rb +0 -47
- data/app/models/masks/rails/email.rb +0 -96
- data/app/models/masks/rails/key.rb +0 -61
- data/app/models/masks/rails/openid/access_token.rb +0 -55
- data/app/models/masks/rails/openid/authorization.rb +0 -45
- data/app/models/masks/rails/openid/client.rb +0 -186
- data/app/models/masks/rails/openid/id_token.rb +0 -43
- data/app/models/masks/rails/recovery.rb +0 -116
- data/app/models/masks/rails/role.rb +0 -20
- data/app/models/masks/rails/scope.rb +0 -15
- data/app/models/masks/session.rb +0 -447
- data/app/models/masks/sessions/access.rb +0 -27
- data/app/models/masks/sessions/inline.rb +0 -16
- data/app/models/masks/sessions/request.rb +0 -42
- data/app/resources/masks/actor_resource.rb +0 -9
- data/app/resources/masks/session_resource.rb +0 -15
- data/app/views/layouts/masks/application.html.erb +0 -17
- data/app/views/layouts/masks/mailer.html.erb +0 -17
- data/app/views/layouts/masks/mailer.text.erb +0 -1
- data/app/views/layouts/masks/manage.html.erb +0 -42
- data/app/views/masks/actor_mailer/recover_credentials.html.erb +0 -32
- data/app/views/masks/actor_mailer/recover_credentials.text.erb +0 -1
- data/app/views/masks/actor_mailer/verify_email.html.erb +0 -33
- data/app/views/masks/actor_mailer/verify_email.text.erb +0 -8
- data/app/views/masks/actors/current.html.erb +0 -145
- data/app/views/masks/application/_header.html.erb +0 -30
- data/app/views/masks/backup_codes/new.html.erb +0 -117
- data/app/views/masks/emails/new.html.erb +0 -109
- data/app/views/masks/emails/verify.html.erb +0 -51
- data/app/views/masks/keys/new.html.erb +0 -127
- data/app/views/masks/manage/actors/index.html.erb +0 -104
- data/app/views/masks/manage/actors/show.html.erb +0 -172
- data/app/views/masks/manage/clients/index.html.erb +0 -102
- data/app/views/masks/manage/clients/show.html.erb +0 -156
- data/app/views/masks/manage/dashboard/index.html.erb +0 -10
- data/app/views/masks/manage/devices/index.html.erb +0 -47
- data/app/views/masks/one_time_code/new.html.erb +0 -167
- data/app/views/masks/openid/authorizations/error.html.erb +0 -23
- data/app/views/masks/openid/authorizations/new.html.erb +0 -46
- data/app/views/masks/passwords/edit.html.erb +0 -71
- data/app/views/masks/recoveries/new.html.erb +0 -69
- data/app/views/masks/recoveries/password.html.erb +0 -63
- data/app/views/masks/sessions/new.html.erb +0 -152
- data/config/brakeman.ignore +0 -28
- data/config/initializers/inflections.rb +0 -5
- data/config/locales/en.yml +0 -307
- data/db/migrate/20231205173845_create_actors.rb +0 -94
- data/db/migrate/20240329182422_support_openid.rb +0 -64
- data/lib/generators/masks/install/USAGE +0 -8
- data/lib/generators/masks/install/templates/initializer.rb +0 -5
- data/lib/generators/masks/install/templates/masks.json +0 -9
- data/lib/masks/configuration.rb +0 -249
- data/lib/masks/engine.rb +0 -25
- data/lib/masks/middleware.rb +0 -70
- data/lib/tasks/masks_tasks.rake +0 -72
- data/masks.json +0 -315
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<div data-controller="dialog" data-action="click->dialog#backdropClose">
|
|
2
|
-
<div class="mb-6 flex items-center gap-2">
|
|
3
|
-
<%= lucide_icon('user', class: 'w-5 h-5') %>
|
|
4
|
-
|
|
5
|
-
<h1 class="font-bold flex-grow">
|
|
6
|
-
actors
|
|
7
|
-
</h1>
|
|
8
|
-
<button class="btn btn-sm btn-ghost btn-primary" data-action="dialog#open">
|
|
9
|
-
<span class="">
|
|
10
|
-
<%= lucide_icon('plus-square', class: 'w-5 h-5') %>
|
|
11
|
-
</span>
|
|
12
|
-
|
|
13
|
-
new
|
|
14
|
-
</button>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<% if flash[:errors]&.any? %>
|
|
18
|
-
<div role="alert" class="alert alert-error mb-4 mt-0">
|
|
19
|
-
<%= lucide_icon('x-circle') %>
|
|
20
|
-
<div>
|
|
21
|
-
<h3 class="font-bold">failed to add actor...</h3>
|
|
22
|
-
<ul class="list-disc pl-4">
|
|
23
|
-
<% flash[:errors].each do |error| %>
|
|
24
|
-
<li><%= error %></li>
|
|
25
|
-
<% end %>
|
|
26
|
-
</ul>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<% end %>
|
|
30
|
-
|
|
31
|
-
<dialog class="modal" data-dialog-target="dialog">
|
|
32
|
-
<div class="modal-box">
|
|
33
|
-
<form method="dialog">
|
|
34
|
-
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"><%= lucide_icon('x') %></button>
|
|
35
|
-
</form>
|
|
36
|
-
|
|
37
|
-
<h3 class="mb-4 ml-1 font-bold flex items-center gap-2">
|
|
38
|
-
<%= lucide_icon('user-plus', size: 16) %>
|
|
39
|
-
new actor
|
|
40
|
-
</h3>
|
|
41
|
-
|
|
42
|
-
<%= form_with url: manage_actors_path, method: :post do |form| %>
|
|
43
|
-
<label class="form-control input input-bordered flex flex-row gap-4 items-center flex-grow mb-2">
|
|
44
|
-
nickname
|
|
45
|
-
|
|
46
|
-
<input placeholder="enter a name for the client..." type="text" name="nickname" class="grow" />
|
|
47
|
-
</label>
|
|
48
|
-
|
|
49
|
-
<label class="form-control input input-bordered w-full flex flex-row items-center gap-4 mb-4" data-controller="password-visibility">
|
|
50
|
-
password
|
|
51
|
-
|
|
52
|
-
<input
|
|
53
|
-
type="password"
|
|
54
|
-
data-password-visibility-target="input"
|
|
55
|
-
spellcheck="false"
|
|
56
|
-
placeholder="enter a password..."
|
|
57
|
-
name="password"
|
|
58
|
-
class="flex-grow">
|
|
59
|
-
|
|
60
|
-
<button data-action="password-visibility#toggle" type="button" class="btn btn-sm btn-ghost -mr-2">
|
|
61
|
-
<span data-password-visibility-target="icon"><%= lucide_icon('eye') %></span>
|
|
62
|
-
<span data-password-visibility-target="icon" class="hidden"><%= lucide_icon('eye-off') %></span>
|
|
63
|
-
</button>
|
|
64
|
-
</label>
|
|
65
|
-
|
|
66
|
-
<div class="modal-actions">
|
|
67
|
-
<input type="submit" class="btn btn-sm btn-success" value="save" />
|
|
68
|
-
</div>
|
|
69
|
-
<% end %>
|
|
70
|
-
</div>
|
|
71
|
-
</dialog>
|
|
72
|
-
|
|
73
|
-
<div class="overflow-x-auto">
|
|
74
|
-
<table class="table bg-base-100">
|
|
75
|
-
<!-- head -->
|
|
76
|
-
<thead>
|
|
77
|
-
<tr>
|
|
78
|
-
<th>name</th>
|
|
79
|
-
<th class="text-right">last login</th>
|
|
80
|
-
</tr>
|
|
81
|
-
</thead>
|
|
82
|
-
<tbody>
|
|
83
|
-
<% @actors.each do |actor| %>
|
|
84
|
-
<tr data-action="click->table#click" data-controller="table" class="cursor-pointer">
|
|
85
|
-
<td>
|
|
86
|
-
<a data-table-target="url" href="<%= manage_actor_path(actor) %>" class="font-bold"><%= actor.nickname %></a>
|
|
87
|
-
</td>
|
|
88
|
-
<td class="text-xs whitespace-nowrap text-right">
|
|
89
|
-
<% if actor.last_login_at %>
|
|
90
|
-
<%= time_ago_in_words(actor.last_login_at) %> ago
|
|
91
|
-
<% else %>
|
|
92
|
-
never logged in
|
|
93
|
-
<% end %>
|
|
94
|
-
</td>
|
|
95
|
-
</tr>
|
|
96
|
-
<% end %>
|
|
97
|
-
</tbody>
|
|
98
|
-
</table>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<% if @pagy.pages > 1 %>
|
|
102
|
-
<%== pagy_nav(@pagy) %>
|
|
103
|
-
<% end%>
|
|
104
|
-
</div>
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
<div class="flex flex-col gap-1 mb-4">
|
|
2
|
-
<div class="flex items-center gap-2">
|
|
3
|
-
<%= lucide_icon('user', class: 'w-5 h-5') %>
|
|
4
|
-
|
|
5
|
-
<div class="text-xl font-bold">
|
|
6
|
-
<%= @actor.nickname %>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<% if flash[:info] %>
|
|
12
|
-
<div role="alert" class="alert alert-info mb-4 mt-0 flex items-center">
|
|
13
|
-
<%= lucide_icon('info') %>
|
|
14
|
-
<div>
|
|
15
|
-
<h3 class="font-bold"><%= flash[:info] %></h3>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<% end %>
|
|
19
|
-
|
|
20
|
-
<% if flash[:error] %>
|
|
21
|
-
<div role="alert" class="alert alert-error mb-4 mt-0 flex items-center">
|
|
22
|
-
<%= lucide_icon('alert-triangle') %>
|
|
23
|
-
<div>
|
|
24
|
-
<h3 class="font-bold"><%= flash[:error] %></h3>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<% end %>
|
|
28
|
-
|
|
29
|
-
<div class="bg-base-300 flex flex-col gap-4 p-4 rounded-xl mb-4">
|
|
30
|
-
<div class="flex items-center gap-4">
|
|
31
|
-
<%= lucide_icon('log-in', class: 'w-4 h-4') %>
|
|
32
|
-
<% if @actor.last_login_at %>
|
|
33
|
-
<div class="text-sm flex-grow">
|
|
34
|
-
<b class="text-neutral-content">last login</b> <%= time_ago_in_words(@actor.last_login_at) %> ago
|
|
35
|
-
</div>
|
|
36
|
-
<%= form_with url: manage_actor_path(@actor), method: :patch do |form| %>
|
|
37
|
-
<input type="submit" class="btn hover:btn-error btn-xs" name="logout" value="logout">
|
|
38
|
-
<% end %>
|
|
39
|
-
<% else %>
|
|
40
|
-
<div class="text-sm">
|
|
41
|
-
never logged in
|
|
42
|
-
</div>
|
|
43
|
-
<% end %>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div class="flex items-center gap-4" data-controller="dialog" data-action="click->dialog#backdropClose">
|
|
47
|
-
<%= lucide_icon('unlock', class: 'w-4 h-4') %>
|
|
48
|
-
<div class="text-sm flex-grow">
|
|
49
|
-
<% if @actor.changed_password_at %>
|
|
50
|
-
<b class="text-neutral-content">password</b> changed <%= time_ago_in_words(@actor.changed_password_at) %> ago
|
|
51
|
-
<% else %>
|
|
52
|
-
<b class="text-neutral-content">password</b> never changed
|
|
53
|
-
<% end %>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<button data-action="dialog#open" type="button" class="btn hover:btn-error btn-xs">
|
|
57
|
-
change
|
|
58
|
-
</button>
|
|
59
|
-
|
|
60
|
-
<dialog class="modal" data-dialog-target="dialog">
|
|
61
|
-
<div class="modal-box">
|
|
62
|
-
<form method="dialog">
|
|
63
|
-
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"><%= lucide_icon('x') %></button>
|
|
64
|
-
</form>
|
|
65
|
-
|
|
66
|
-
<h3 class="mb-4 font-bold flex items-center gap-2">
|
|
67
|
-
<%= lucide_icon('lock-keyhole', size: 16) %>
|
|
68
|
-
change password
|
|
69
|
-
</h3>
|
|
70
|
-
|
|
71
|
-
<%= form_with url: manage_actor_path(@actor), method: :patch do |form| %>
|
|
72
|
-
<label class="form-control input input-bordered w-full flex flex-row items-center gap-2 mb-4" data-controller="password-visibility">
|
|
73
|
-
<input
|
|
74
|
-
type="password"
|
|
75
|
-
data-password-visibility-target="input"
|
|
76
|
-
spellcheck="false"
|
|
77
|
-
placeholder="enter a new password..."
|
|
78
|
-
name="change_password"
|
|
79
|
-
class="flex-grow">
|
|
80
|
-
|
|
81
|
-
<button data-action="password-visibility#toggle" type="button" class="btn btn-sm btn-ghost -mr-2">
|
|
82
|
-
<span data-password-visibility-target="icon"><%= lucide_icon('eye') %></span>
|
|
83
|
-
<span data-password-visibility-target="icon" class="hidden"><%= lucide_icon('eye-off') %></span>
|
|
84
|
-
</button>
|
|
85
|
-
</label>
|
|
86
|
-
|
|
87
|
-
<div class="modal-actions">
|
|
88
|
-
<input type="submit" class="btn btn-sm btn-success" value="change" />
|
|
89
|
-
</div>
|
|
90
|
-
<% end %>
|
|
91
|
-
</div>
|
|
92
|
-
</dialog>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="flex items-center gap-4">
|
|
96
|
-
<%= lucide_icon('key-square', class: 'w-4 h-4') %>
|
|
97
|
-
<div class="text-sm flex-grow">
|
|
98
|
-
<b class="text-neutral-content">secondary</b> credentials <span class="italic <%= @actor.factor2? ? 'text-success' : "text-error" %>"><%= @actor.factor2? ? 'enabled' : 'disabled' %></span>
|
|
99
|
-
|
|
100
|
-
</div>
|
|
101
|
-
<% if @actor.factor2? %>
|
|
102
|
-
<%= form_with url: manage_actor_path(@actor), method: :patch do |form| %>
|
|
103
|
-
<input type="submit" class="btn hover:btn-error btn-xs" name="remove_factor2" value="remove">
|
|
104
|
-
<% end %>
|
|
105
|
-
<% end %>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div class="mb-4">
|
|
110
|
-
<div class="overflow-x-auto max-h-96 rounded-xl">
|
|
111
|
-
<table class="table table-pin-rows bg-base-300">
|
|
112
|
-
<thead>
|
|
113
|
-
<tr class="">
|
|
114
|
-
<th class="py-2 w-full">emails</th>
|
|
115
|
-
<th class="py-2"><%= @actor.emails.any? ? 'verified?' : '' %></th>
|
|
116
|
-
</tr>
|
|
117
|
-
</thead>
|
|
118
|
-
<tbody>
|
|
119
|
-
<% if @actor.emails.any? %>
|
|
120
|
-
<% @actor.emails.each do |email| %>
|
|
121
|
-
<tr>
|
|
122
|
-
<td class="w-full whitespace-nowrap"><%= email.email %></td>
|
|
123
|
-
<td class=""><%= lucide_icon(email.verified? ? 'check' : 'x', class: 'w-4 h-4') %></td>
|
|
124
|
-
</tr>
|
|
125
|
-
<% end %>
|
|
126
|
-
<% else %>
|
|
127
|
-
<tr>
|
|
128
|
-
<td class="italic" colspan="2">no emails added...</td>
|
|
129
|
-
</tr>
|
|
130
|
-
<% end %>
|
|
131
|
-
</tbody>
|
|
132
|
-
</table>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<div class="overflow-x-auto max-h-96 rounded-xl">
|
|
137
|
-
<table class="table table-pin-rows bg-base-300">
|
|
138
|
-
<thead>
|
|
139
|
-
<tr class="">
|
|
140
|
-
<th class="py-2 w-full">scopes</th>
|
|
141
|
-
<th class="py-2"></th>
|
|
142
|
-
</tr>
|
|
143
|
-
</thead>
|
|
144
|
-
<tbody>
|
|
145
|
-
<tr>
|
|
146
|
-
<td colspan="2">
|
|
147
|
-
<%= form_with url: manage_actor_path(@actor), method: :patch do |form| %>
|
|
148
|
-
<div class="flex items-center gap-2">
|
|
149
|
-
<%= lucide_icon('plus-square', class: 'text-base-300-content') %>
|
|
150
|
-
<input type="text" name="add_scope" class="flex-grow input input-sm" placeholder="add a scope...">
|
|
151
|
-
<input type="submit" class="btn btn-sm" value="add">
|
|
152
|
-
</div>
|
|
153
|
-
<% end %>
|
|
154
|
-
</td>
|
|
155
|
-
</tr>
|
|
156
|
-
<% @actor.scopes.each do |scope| %>
|
|
157
|
-
<tr>
|
|
158
|
-
<td class="font-mono w-full"><%= scope %></td>
|
|
159
|
-
<td class="">
|
|
160
|
-
<%= form_with url: manage_actor_path(@actor), method: :patch do |form| %>
|
|
161
|
-
<input type="hidden" name="remove_scope" value="<%= scope %>">
|
|
162
|
-
|
|
163
|
-
<button type="submit" class="btn btn-ghost btn-error hover:btn-outline btn-xs">
|
|
164
|
-
<%= lucide_icon('x', class: 'w-4 h-4') %>
|
|
165
|
-
</button>
|
|
166
|
-
<% end %>
|
|
167
|
-
</td>
|
|
168
|
-
</tr>
|
|
169
|
-
<% end %>
|
|
170
|
-
</tbody>
|
|
171
|
-
</table>
|
|
172
|
-
</div>
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<div data-controller="dialog" data-action="click->dialog#backdropClose">
|
|
2
|
-
<div class="mb-4 flex items-center gap-2">
|
|
3
|
-
<%= lucide_icon('handshake', class: 'w-5 h-5') %>
|
|
4
|
-
|
|
5
|
-
<h1 class="font-bold flex-grow">
|
|
6
|
-
clients
|
|
7
|
-
</h1>
|
|
8
|
-
|
|
9
|
-
<button class="btn btn-sm btn-ghost btn-primary" data-action="dialog#open">
|
|
10
|
-
<span class="">
|
|
11
|
-
<%= lucide_icon('plus-square', class: 'w-5 h-5') %>
|
|
12
|
-
</span>
|
|
13
|
-
|
|
14
|
-
new
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<dialog class="modal" data-dialog-target="dialog">
|
|
19
|
-
<div class="modal-box">
|
|
20
|
-
<form method="dialog">
|
|
21
|
-
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"><%= lucide_icon('x') %></button>
|
|
22
|
-
</form>
|
|
23
|
-
|
|
24
|
-
<h3 class="mb-4 ml-1 font-bold flex items-center gap-2">
|
|
25
|
-
<%= lucide_icon('plus-square', size: 16) %>
|
|
26
|
-
new client
|
|
27
|
-
</h3>
|
|
28
|
-
<%= form_with url: manage_clients_path, method: :post do |form| %>
|
|
29
|
-
<label class="form-control input input-bordered flex flex-row gap-4 items-center flex-grow mb-4">
|
|
30
|
-
name
|
|
31
|
-
|
|
32
|
-
<input placeholder="enter a name for the client..." type="text" name="name" class="grow" />
|
|
33
|
-
</label>
|
|
34
|
-
|
|
35
|
-
<div class="modal-actions">
|
|
36
|
-
<input type="submit" class="btn btn-sm btn-success" value="add" />
|
|
37
|
-
</div>
|
|
38
|
-
<% end %>
|
|
39
|
-
</div>
|
|
40
|
-
</dialog>
|
|
41
|
-
|
|
42
|
-
<% if flash[:errors]&.any? %>
|
|
43
|
-
<div role="alert" class="alert alert-error mb-4 mt-0">
|
|
44
|
-
<%= lucide_icon('x-circle') %>
|
|
45
|
-
<div>
|
|
46
|
-
<h3 class="font-bold">failed to add client...</h3>
|
|
47
|
-
<ul class="list-disc pl-4">
|
|
48
|
-
<% flash[:errors].each do |error| %>
|
|
49
|
-
<li><%= error %></li>
|
|
50
|
-
<% end %>
|
|
51
|
-
</ul>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<% end %>
|
|
55
|
-
|
|
56
|
-
<% if flash[:destroyed] %>
|
|
57
|
-
<div role="alert" class="alert alert-error mb-4 mt-0 flex items-center">
|
|
58
|
-
<%= lucide_icon('trash-2') %>
|
|
59
|
-
<div>
|
|
60
|
-
<h3 class="font-bold">"<%= flash[:destroyed] %>" deleted...</h3>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
<% end %>
|
|
64
|
-
|
|
65
|
-
<div class="overflow-x-auto">
|
|
66
|
-
<table class="table table-fixed md:table-auto bg-base-100">
|
|
67
|
-
<thead>
|
|
68
|
-
<tr>
|
|
69
|
-
<th>name</th>
|
|
70
|
-
<th class="text-right">created</th>
|
|
71
|
-
</tr>
|
|
72
|
-
</thead>
|
|
73
|
-
<tbody>
|
|
74
|
-
<% if @clients.any? %>
|
|
75
|
-
<% @clients.each do |client| %>
|
|
76
|
-
<tr data-action="click->table#click" data-controller="table" class="cursor-pointer">
|
|
77
|
-
<td>
|
|
78
|
-
<a data-table-target="url" href="<%= manage_client_path(client) %>" class="flex flex-col">
|
|
79
|
-
<span class="font-bold truncate"><%= client.name %></span>
|
|
80
|
-
<span class="font-mono text-xs truncate"><%= client.key %></span>
|
|
81
|
-
</a>
|
|
82
|
-
</td>
|
|
83
|
-
<td class="text-right text-xs">
|
|
84
|
-
<%= time_ago_in_words(client.created_at) %> ago
|
|
85
|
-
</td>
|
|
86
|
-
</tr>
|
|
87
|
-
<% end %>
|
|
88
|
-
<% else %>
|
|
89
|
-
<tr>
|
|
90
|
-
<td colspan="2" class="text-center text-sm">
|
|
91
|
-
nothing found...
|
|
92
|
-
</td>
|
|
93
|
-
</tr>
|
|
94
|
-
<% end %>
|
|
95
|
-
</tbody>
|
|
96
|
-
</table>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<% if @pagy.pages > 1 %>
|
|
100
|
-
<%== pagy_nav(@pagy) %>
|
|
101
|
-
<% end%>
|
|
102
|
-
</div>
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
<%= form_with url: manage_client_path(@client), method: :patch, data: { turbo: false } do |form| %>
|
|
2
|
-
<div class="flex items-center gap-2 mb-6">
|
|
3
|
-
<%= lucide_icon('handshake', class: 'w-5 h-5') %>
|
|
4
|
-
|
|
5
|
-
<input name="name" type="text" class="input input-sm text-lg input-ghost font-bold flex-grow" value="<%= @client.name %>">
|
|
6
|
-
<input type="submit" name="submit" value="save" class="btn btn-sm btn-success">
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<% if flash[:errors]&.any? %>
|
|
10
|
-
<div role="alert" class="alert alert-error mb-4 mt-0">
|
|
11
|
-
<%= lucide_icon('x-circle') %>
|
|
12
|
-
<div>
|
|
13
|
-
<h3 class="font-bold">error(s) occurred while saving...</h3>
|
|
14
|
-
<ul class="list-disc pl-4">
|
|
15
|
-
<% flash[:errors].each do |error| %>
|
|
16
|
-
<li><%= error %></li>
|
|
17
|
-
<% end %>
|
|
18
|
-
</ul>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
<% end %>
|
|
22
|
-
|
|
23
|
-
<div class="bg-base-300 flex flex-col gap-2 p-4 rounded-xl mb-4">
|
|
24
|
-
<label class="form-control w-full">
|
|
25
|
-
<div class="label">
|
|
26
|
-
<span class="label-text">client type</span>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<select class="select select-bordered" name="response_type">
|
|
30
|
-
<option value="confidential" <%= @client.client_type == 'confidential' ? 'selected' : '' %>>confidential</option>
|
|
31
|
-
<option value="public" <%= @client.client_type == 'public' ? 'selected' : '' %>>public</option>
|
|
32
|
-
</select>
|
|
33
|
-
</label>
|
|
34
|
-
|
|
35
|
-
<div class="form-control pl-2 mb-1">
|
|
36
|
-
<label class="flex items-center gap-4">
|
|
37
|
-
<input name="consent" type="checkbox" class="toggle toggle-sm" <%= @client.consent ? 'checked' : '' %>>
|
|
38
|
-
|
|
39
|
-
<span class="label-text">require consent when authorizing this client</span>
|
|
40
|
-
</label>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div class="form-control w-full">
|
|
44
|
-
<div class="label">
|
|
45
|
-
<span class="label-text">credentials</span>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<label class="input input-bordered flex items-center gap-4 mb-2 text-sm">
|
|
49
|
-
key
|
|
50
|
-
<input name="key" class="text-base" type="text" class="grow" value="<%= @client.key %>" disabled>
|
|
51
|
-
</label>
|
|
52
|
-
|
|
53
|
-
<label class="input input-bordered flex items-center gap-4 text-sm" data-controller="password-visibility">
|
|
54
|
-
secret
|
|
55
|
-
<input name="secret" class="text-base flex-grow" type="password" value="<%= @client.secret %>" data-password-visibility-target="input" spellcheck="false">
|
|
56
|
-
<button data-action="password-visibility#toggle" type="button">
|
|
57
|
-
<span data-password-visibility-target="icon"><%= lucide_icon('eye') %></span>
|
|
58
|
-
<span data-password-visibility-target="icon" class="hidden"><%= lucide_icon('eye-off') %></span>
|
|
59
|
-
</button>
|
|
60
|
-
</label>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<label class="form-control">
|
|
64
|
-
<div class="label">
|
|
65
|
-
<span class="label-text">redirect uri(s)</span>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<textarea name="redirect_uris" class="textarea textarea-bordered h-24" placeholder="separate by a newline..."><%= @client.redirect_uris&.join("\n") %></textarea>
|
|
69
|
-
</label>
|
|
70
|
-
|
|
71
|
-
<div class="form-control w-full">
|
|
72
|
-
<div class="label">
|
|
73
|
-
<span class="label-text">subject type</span>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<select name="subject_type" class="select select-bordered">
|
|
77
|
-
<option value="nickname" <%= @client.subject_type == 'nickname' ? 'selected' : '' %>>nickname</option>
|
|
78
|
-
<option value="email" <%= @client.subject_type == 'email' ? 'selected' : '' %>>email</option>
|
|
79
|
-
<option value="pairwise" <%= @client.subject_type == 'pairwise' ? 'selected' : '' %>>anonymized</option>
|
|
80
|
-
</select>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class="form-control w-full">
|
|
84
|
-
<div class="label">
|
|
85
|
-
<span class="label-text">lifetimes</span>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<label class="input input-bordered flex items-center gap-4 mb-2 text-sm">
|
|
89
|
-
auth codes
|
|
90
|
-
<input name="code_expires_in" type="text" class="grow" value="<%= @client.code_expires_in %>">
|
|
91
|
-
</label>
|
|
92
|
-
|
|
93
|
-
<label class="input input-bordered flex items-center gap-4 text-sm mb-2">
|
|
94
|
-
access tokens
|
|
95
|
-
<input name="token_expires_in" type="text" class="grow" value="<%= @client.token_expires_in %>">
|
|
96
|
-
</label>
|
|
97
|
-
|
|
98
|
-
<label class="input input-bordered flex items-center gap-4 text-sm">
|
|
99
|
-
refresh tokens
|
|
100
|
-
<input name="refresh_expires_in" type="text" class="grow" value="<%= @client.refresh_expires_in %>">
|
|
101
|
-
</label>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
<% end %>
|
|
105
|
-
|
|
106
|
-
<div class="overflow-x-auto max-h-96 rounded-xl mb-4">
|
|
107
|
-
<table class="table table-pin-rows bg-base-300">
|
|
108
|
-
<thead>
|
|
109
|
-
<tr class="">
|
|
110
|
-
<th class="py-2 w-full">scopes</th>
|
|
111
|
-
<th class="py-2"></th>
|
|
112
|
-
</tr>
|
|
113
|
-
</thead>
|
|
114
|
-
<tbody>
|
|
115
|
-
<tr>
|
|
116
|
-
<td colspan="2">
|
|
117
|
-
<%= form_with url: manage_client_path(@client), method: :patch do |form| %>
|
|
118
|
-
<div class="flex items-center gap-2">
|
|
119
|
-
<%= lucide_icon('plus-square', class: 'text-base-300-content') %>
|
|
120
|
-
<input type="text" name="add_scope" class="flex-grow input input-sm" placeholder="add a scope...">
|
|
121
|
-
<input type="submit" class="btn btn-sm" value="add">
|
|
122
|
-
</div>
|
|
123
|
-
<% end %>
|
|
124
|
-
</td>
|
|
125
|
-
</tr>
|
|
126
|
-
<% @client.scopes.each do |scope| %>
|
|
127
|
-
<tr>
|
|
128
|
-
<td class="font-mono w-full"><%= scope %></td>
|
|
129
|
-
<td class="">
|
|
130
|
-
<%= form_with url: manage_client_path(@client), method: :patch do |form| %>
|
|
131
|
-
<input type="hidden" name="remove_scope" value="<%= scope %>">
|
|
132
|
-
|
|
133
|
-
<button type="submit" class="btn btn-ghost btn-error hover:btn-outline btn-xs" <%= scope == 'openid' ? 'disabled' : '' %>>
|
|
134
|
-
<%= lucide_icon('x', class: 'w-4 h-4') %>
|
|
135
|
-
</button>
|
|
136
|
-
<% end %>
|
|
137
|
-
</td>
|
|
138
|
-
</tr>
|
|
139
|
-
<% end %>
|
|
140
|
-
</tbody>
|
|
141
|
-
</table>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<%= form_with url: manage_client_path(@client), method: :delete do |form| %>
|
|
145
|
-
<div class="border border-error bg-base-300 flex gap-2 p-4 rounded-xl mb-4 items-center">
|
|
146
|
-
<p class="text-error">
|
|
147
|
-
<%= lucide_icon('trash-2') %>
|
|
148
|
-
</p>
|
|
149
|
-
|
|
150
|
-
<p class="flex-grow text-error">
|
|
151
|
-
<span class="font-bold">permanently</span> delete this client...
|
|
152
|
-
</p>
|
|
153
|
-
|
|
154
|
-
<input type="submit" class="btn btn-sm btn-error" value="delete" />
|
|
155
|
-
</div>
|
|
156
|
-
<% end %>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<div class="flex items-center gap-4 text-center">
|
|
2
|
-
<div class="bg-base-300 p-8 rounded-xl flex-grow">
|
|
3
|
-
<p class="text-4xl"><%= @actors %></p>
|
|
4
|
-
<p>actors</a>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="bg-base-300 p-8 rounded-xl flex-grow">
|
|
7
|
-
<p class="text-4xl"><%= @clients %></p>
|
|
8
|
-
<p>clients</a>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<div class="mb-6 flex items-center gap-2">
|
|
2
|
-
<%= lucide_icon('monitor-smartphone', class: 'w-5 h-5') %>
|
|
3
|
-
|
|
4
|
-
<h1 class="font-bold flex-grow">
|
|
5
|
-
devices
|
|
6
|
-
</h1>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<div class="overflow-x-auto">
|
|
10
|
-
<table class="table bg-base-100">
|
|
11
|
-
<!-- head -->
|
|
12
|
-
<thead>
|
|
13
|
-
<tr>
|
|
14
|
-
<th class="w-10"></th>
|
|
15
|
-
<th>browser</th>
|
|
16
|
-
<th>os</th>
|
|
17
|
-
<th>ip address</th>
|
|
18
|
-
<th class="text-right">owner</th>
|
|
19
|
-
</tr>
|
|
20
|
-
</thead>
|
|
21
|
-
<tbody>
|
|
22
|
-
<% @devices.each do |device| %>
|
|
23
|
-
<tr>
|
|
24
|
-
<td class="w-10">
|
|
25
|
-
<%= lucide_icon(device_icon(device), size: 16) %>
|
|
26
|
-
</td>
|
|
27
|
-
<td class="truncate">
|
|
28
|
-
<%= device.name %>
|
|
29
|
-
</td>
|
|
30
|
-
<td class="text-xs whitespace-nowrap">
|
|
31
|
-
<%= device.os_name%>
|
|
32
|
-
</td>
|
|
33
|
-
<td class="text-xs whitespace-nowrap">
|
|
34
|
-
<%= device.ip_address %>
|
|
35
|
-
</td>
|
|
36
|
-
<td class="text-right">
|
|
37
|
-
<a class="underline" href="<%= manage_actor_path(device.actor) %>">
|
|
38
|
-
<%= device.actor&.nickname || 'unknown' %>
|
|
39
|
-
</a>
|
|
40
|
-
</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<% end %>
|
|
43
|
-
</tbody>
|
|
44
|
-
</table>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<%== pagy_nav(@pagy) %>
|