mirror of
https://github.com/we-promise/sure.git
synced 2026-04-09 07:14:47 +00:00
Multi-provider SSO support: - Database-backed SSO provider management with admin UI - Support for OpenID Connect, Google OAuth2, GitHub, and SAML 2.0 - Flipper feature flag (db_sso_providers) for dynamic provider loading - ProviderLoader service for YAML or database configuration Admin functionality: - Admin::SsoProvidersController for CRUD operations - Admin::UsersController for super_admin role management - Pundit policies for authorization - Test connection endpoint for validating provider config User provisioning improvements: - JIT (just-in-time) account creation with configurable default role - Changed default JIT role from admin to member (security) - User attribute sync on each SSO login - Group/role mapping from IdP claims SSO identity management: - Settings::SsoIdentitiesController for users to manage connected accounts - Issuer validation for OIDC identities - Unlink protection when no password set Audit logging: - SsoAuditLog model tracking login, logout, link, unlink, JIT creation - Captures IP address, user agent, and metadata Advanced OIDC features: - Custom scopes per provider - Configurable prompt parameter (login, consent, select_account, none) - RP-initiated logout (federated logout to IdP) - id_token storage for logout SAML 2.0 support: - omniauth-saml gem integration - IdP metadata URL or manual configuration - Certificate and fingerprint validation - NameID format configuration
74 lines
3.1 KiB
Plaintext
74 lines
3.1 KiB
Plaintext
<%= content_for :page_title, t(".title") %>
|
|
|
|
<div class="space-y-4">
|
|
<p class="text-secondary"><%= t(".description") %></p>
|
|
|
|
<%= settings_section title: t(".section_title") do %>
|
|
<div class="divide-y divide-primary">
|
|
<% @users.each do |user| %>
|
|
<div class="flex items-center justify-between py-3 first:pt-0 last:pb-0">
|
|
<div class="flex items-center gap-3">
|
|
<div class="w-8 h-8 rounded-full bg-surface flex items-center justify-center">
|
|
<span class="text-sm font-medium text-primary"><%= user.initials %></span>
|
|
</div>
|
|
<div>
|
|
<p class="font-medium text-primary"><%= user.display_name %></p>
|
|
<p class="text-sm text-secondary"><%= user.email %></p>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<% if user.id == Current.user.id %>
|
|
<span class="text-sm text-secondary"><%= t(".you") %></span>
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary">
|
|
<%= t(".roles.#{user.role}") %>
|
|
</span>
|
|
<% else %>
|
|
<%= form_with model: [:admin, user], method: :patch, class: "flex items-center gap-2" do |form| %>
|
|
<%= form.select :role,
|
|
options_for_select([
|
|
[t(".roles.member"), "member"],
|
|
[t(".roles.admin"), "admin"],
|
|
[t(".roles.super_admin"), "super_admin"]
|
|
], user.role),
|
|
{},
|
|
class: "text-sm rounded-lg border-primary bg-container text-primary px-2 py-1",
|
|
onchange: "this.form.requestSubmit()" %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if @users.empty? %>
|
|
<div class="text-center py-6">
|
|
<%= icon "users", class: "w-12 h-12 mx-auto text-secondary mb-3" %>
|
|
<p class="text-secondary"><%= t(".no_users") %></p>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= settings_section title: t(".role_descriptions_title"), collapsible: true, open: false do %>
|
|
<div class="space-y-3 text-sm">
|
|
<div class="flex items-start gap-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary shrink-0">
|
|
<%= t(".roles.member") %>
|
|
</span>
|
|
<p class="text-secondary"><%= t(".role_descriptions.member") %></p>
|
|
</div>
|
|
<div class="flex items-start gap-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary shrink-0">
|
|
<%= t(".roles.admin") %>
|
|
</span>
|
|
<p class="text-secondary"><%= t(".role_descriptions.admin") %></p>
|
|
</div>
|
|
<div class="flex items-start gap-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800 shrink-0">
|
|
<%= t(".roles.super_admin") %>
|
|
</span>
|
|
<p class="text-secondary"><%= t(".role_descriptions.super_admin") %></p>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|