clients: Move /clients to sync.elwig.at

This commit is contained in:
2025-05-03 16:22:30 +02:00
parent 223c959cd9
commit 25805f0475
6 changed files with 16 additions and 305 deletions

View File

@ -19,15 +19,3 @@ function authenticate(): void {
http_401_unauthorized();
}
}
function authenticate_client(string $client): void {
global $CLIENT_CREDENTIALS;
$credentials = $CLIENT_CREDENTIALS[$client];
if (!array_key_exists('PHP_AUTH_USER', $_SERVER) ||
!array_key_exists('PHP_AUTH_PW', $_SERVER) ||
!array_key_exists($_SERVER['PHP_AUTH_USER'], $credentials) ||
$_SERVER['PHP_AUTH_PW'] !== $credentials[$_SERVER['PHP_AUTH_USER']])
{
http_401_unauthorized();
}
}