extracted interfaces for services, to aid in creating tests

This commit is contained in:
2026-06-05 15:15:21 -04:00
parent 0813323ac2
commit 7cf7e04d17
10 changed files with 81 additions and 20 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Service;
interface DomainInterface {
/** IE: "auth.example.com" or null if not using a separate subdomain
* @return ?string Returns auth subdomain if configured, otherwise null */
public function getAuthSubdomain(): ?string;
/** check if given url is an acceptable url for redirection
* @param string $url Where we are thinking of sending the user
* @return bool Returns true if it is acceptable to send the user there */
public function validReturn(string $url): bool;
/** check if host-base matches auth-base
* @param string $host
* @return bool returns true if and only if host matches base domain of auth */
public function matchesAuth(string $host): bool;
/** IE: "example.com" if central auth is something like "auth.example.com"
* @return string|null returns base domain if we are doing central auth */
public function authBase(): ?string;
}