Add REMOTE_USER env var with four modes: - session (default): sends session id, backward-compatible - static: sends a fixed string (REMOTE_USER_STATIC) - mapped: looks up session id in REMOTE_USER_MAP - none: omits the header entirely New RemoteUserMode enum, ConfigBag parsing/validation, and StringTrait::authSuccessResponse resolves the header value based on the configured mode. AcceptListener now receives ConfigBag as a constructor dependency. Addresses design consideration 1.2 (Remote-User header value is user-controlled) from DESIGN_CONSIDERATIONS.md. 241 tests pass, 0 cs-fixer violations.
24 lines
546 B
PHP
24 lines
546 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enum;
|
|
|
|
/**
|
|
* Controls what value is sent in the Remote-User header on auth success.
|
|
*/
|
|
enum RemoteUserMode: string
|
|
{
|
|
/** Send the session id (current/default behaviour). */
|
|
case Session = 'session';
|
|
|
|
/** Send a fixed static string for all authenticated requests. */
|
|
case Static = 'static';
|
|
|
|
/** Look up the session id in a configured map and send the mapped value. */
|
|
case Mapped = 'mapped';
|
|
|
|
/** Do not send the Remote-User header at all. */
|
|
case None = 'none';
|
|
}
|