From eb428a89e136b4cb561027bd65eb4910cc72d6f8 Mon Sep 17 00:00:00 2001 From: Joe Huss Date: Fri, 12 Jun 2026 15:26:22 -0400 Subject: [PATCH] feat(schema): add auth.signup_mode server setting Adds the auth.signup_mode property (open|approval|disabled, default approval) to the server-settings schema so phlix-server can gate self-service signups behind admin approval. Updates the schema key lock-in test (18 -> 19 keys). Co-Authored-By: Claude Opus 4.8 (1M context) --- schemas/server-settings.schema.json | 7 +++++++ tests/Schema/ServerSettingsSchemaTest.php | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/schemas/server-settings.schema.json b/schemas/server-settings.schema.json index 89af18b..dea9eea 100644 --- a/schemas/server-settings.schema.json +++ b/schemas/server-settings.schema.json @@ -27,6 +27,13 @@ "description": "TMDb API key used to fetch movie and TV metadata.", "group": "metadata" }, + "auth.signup_mode": { + "type": "string", + "description": "Controls self-service signup: 'open' creates active accounts immediately, 'approval' creates pending accounts that an administrator must approve before they can log in, 'disabled' rejects all new signups. The first registered user is always created active and admin regardless of this setting.", + "group": "auth", + "enum": ["open", "approval", "disabled"], + "default": "approval" + }, "marker_detection.similarity_threshold": { "type": "number", "description": "Audio/video fingerprint similarity threshold (0.0-1.0) above which a segment is treated as a repeated intro/credits marker.", diff --git a/tests/Schema/ServerSettingsSchemaTest.php b/tests/Schema/ServerSettingsSchemaTest.php index e3bd668..44b70bc 100644 --- a/tests/Schema/ServerSettingsSchemaTest.php +++ b/tests/Schema/ServerSettingsSchemaTest.php @@ -61,6 +61,7 @@ public static function propertyProvider(): array 'hwaccel.prefer_hardware' => ['hwaccel.prefer_hardware', 'boolean'], 'hwaccel.probe_timeout' => ['hwaccel.probe_timeout', 'integer'], 'tmdb.api_key' => ['tmdb.api_key', 'string'], + 'auth.signup_mode' => ['auth.signup_mode', 'string'], 'marker_detection.similarity_threshold' => ['marker_detection.similarity_threshold', 'number'], 'marker_detection.intro_max_duration' => ['marker_detection.intro_max_duration', 'integer'], 'subtitles.enabled' => ['subtitles.enabled', 'boolean'], @@ -119,7 +120,7 @@ public function test_schema_has_exactly_the_expected_property_keys(): void sort($expected); $this->assertSame($expected, $actual, 'server-settings schema must declare exactly the expected settings keys.'); - $this->assertCount(18, $actual); + $this->assertCount(19, $actual); } /**