1
0
Files
breadcrumb-the-shire/core/Service/Settings/SettingKeys.php
fs 149d4515de refactor(settings): remove global appearance settings — tenant is sole source
Removes the global app_theme, app_theme_user and app_primary_color settings
from the admin/settings area and the underlying service/cache/API/i18n/docs
layers. The tenant columns (tenants.primary_color, default_theme,
allow_user_theme) become the single source of truth for appearance.
Branding helpers are tenant-only and fall back to a hardcoded 'light' theme
with no brand color when no tenant context is available (login, error,
pre-session pages). The APP_THEME env var is removed.

Scope:
- UI: Appearance tab gone from /admin/settings; tenant edit form drops the
  global-fallback color preview.
- Service: SettingsAppGateway no longer exposes setting-backed accessors
  for theme/user-theme/primary-color. Theme catalog utilities (listThemes,
  isAllowedTheme, normalizeTheme, resolveDefaultTheme) stay and are used
  across Tenant / Auth / User flows; resolveDefaultTheme now hardcodes
  'light' with a catalog fallback (no global/env lookup).
- AdminSettingsService: buildPageData, sanitization, audit snapshot, apply
  step and cache payload are all stripped of the three keys. Dead helper
  applyAppPrimaryColor + normalizePrimaryColor removed.
- Cache: SettingCacheService HOT_PATH_KEYS drops the three keys.
- API: /settings (GET/PUT) and /settings/public (GET) no longer expose
  appearance fields; OpenAPI schemas pruned accordingly.
- Audit redaction list shortened.
- DB: db/init/init.sql seed rows removed. No migration for existing
  installs — legacy rows stay inert.
- i18n + docs: setting.app_theme, setting.app_theme_user,
  setting.app_primary_color removed from de+en locales; reference and
  explanation docs updated.
- Tests: covering tests for the removed methods pruned; ThemeResolutionTest
  rewritten for tenant-only semantics. One unrelated PHP-CS-Fixer issue in
  UserRegistrar.php cleaned up to keep QG-006 green.

Workflow: .agents/runs/SETTINGS-APPEARANCE-TENANT-ONLY/ (gitignored).
Gates: QG-001..003, QG-006, QG-008 all pass (1985 tests, 28764 assertions).
Reviews: code, security, acceptance all pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 22:40:15 +02:00

42 lines
2.1 KiB
PHP

<?php
namespace MintyPHP\Service\Settings;
final class SettingKeys
{
public const DEFAULT_TENANT_KEY = 'default_tenant_id';
public const DEFAULT_ROLE_KEY = 'default_role_id';
public const DEFAULT_DEPARTMENT_KEY = 'default_department_id';
public const APP_TITLE_KEY = 'app_title';
public const APP_LOCALE_KEY = 'app_locale';
public const APP_REGISTRATION_KEY = 'app_registration';
public const API_TOKEN_DEFAULT_TTL_DAYS_KEY = 'api_token_default_ttl_days';
public const API_TOKEN_MAX_TTL_DAYS_KEY = 'api_token_max_ttl_days';
public const API_CORS_ALLOWED_ORIGINS_KEY = 'api_cors_allowed_origins';
public const MICROSOFT_SHARED_CLIENT_ID_KEY = 'microsoft_shared_client_id';
public const MICROSOFT_SHARED_CLIENT_SECRET_ENC_KEY = 'microsoft_shared_client_secret_enc';
public const MICROSOFT_AUTHORITY_KEY = 'microsoft_authority';
public const SMTP_HOST_KEY = 'smtp_host';
public const SMTP_PORT_KEY = 'smtp_port';
public const SMTP_USER_KEY = 'smtp_user';
public const SMTP_PASSWORD_KEY = 'smtp_password';
public const SMTP_SECURE_KEY = 'smtp_secure';
public const SMTP_FROM_KEY = 'smtp_from';
public const SMTP_FROM_NAME_KEY = 'smtp_from_name';
public const USER_INACTIVITY_DEACTIVATE_DAYS_KEY = 'user_inactivity_deactivate_days';
public const USER_INACTIVITY_DELETE_DAYS_KEY = 'user_inactivity_delete_days';
public const SYSTEM_AUDIT_ENABLED_KEY = 'system_audit_enabled';
public const SYSTEM_AUDIT_RETENTION_DAYS_KEY = 'system_audit_retention_days';
public const FRONTEND_TELEMETRY_ENABLED_KEY = 'frontend_telemetry_enabled';
public const FRONTEND_TELEMETRY_SAMPLE_RATE_KEY = 'frontend_telemetry_sample_rate';
public const FRONTEND_TELEMETRY_ALLOWED_EVENTS_KEY = 'frontend_telemetry_allowed_events';
public const SESSION_IDLE_TIMEOUT_MINUTES_KEY = 'session_idle_timeout_minutes';
public const SESSION_ABSOLUTE_TIMEOUT_HOURS_KEY = 'session_absolute_timeout_hours';
public const MICROSOFT_AUTO_REMEMBER_DEFAULT_KEY = 'microsoft_auto_remember_default';
public const REMEMBER_TOKEN_LIFETIME_DAYS_KEY = 'remember_token_lifetime_days';
private function __construct()
{
}
}