Skip to content

SecurityConfigHandler

Parses a security.{php,xml,yml,yaml} file — <password_hashers>, <providers>, <firewalls> (each <firewall> carrying pattern, stateless, sessionless, entry-point, provider, and an ordered list of <authenticator ref="..."> elements) — into a canonical array of password-hasher/provider/firewall definitions.

This handler only produces that array — turning it into live Firewall/ AuthenticatorInterface objects is FirewallFactory’s job, kept separate so apps that assemble firewalls purely in PHP never need this class at all.

Not wired into Quiote\Config\defaults\config_handlers.xml (that file is core-only): a consuming app registers a <handler pattern="..." class="Quiote\Security\Auth\Config\SecurityConfigHandler"> entry in its own config_handlers.xml, exactly as any other non-core-default config kind does (see Quiote\Config\RbacDefinitionConfigHandler for the identical, core-default case of this same mechanism).

class SecurityConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler

ExtendsXmlConfigHandler
ImplementsIArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
Since1.0.0
SourceConfig/SecurityConfigHandler.php
ConstantValueDescription
XML_NAMESPACE'http://quiote.dev/quiote/config/parts/security/1.1'
MethodDescription
execute(XmlConfigDomDocument $document): mixed
executeArray(array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>} $config, ?string $sourceRef = null): mixed
schema(): RuleReturns the structural rule the handler’s canonical array must satisfy.
toCanonicalArray(XmlConfigDomDocument $document): array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}
toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}, positions: array<string, array{file: string, line: int}>}

public function execute(XmlConfigDomDocument $document): mixed

The parsed security.xml document.

ParameterTypeDescription
$documentXmlConfigDomDocumentThe parsed security.xml document.

Returns mixed — The canonical array (see toCanonicalArray()) as the declaration to be cached.

ThrowsWhen
UnreadableExceptionIf a requested configuration file does not exist or is not readable.
ParseExceptionIf a requested configuration file is improperly formatted.

public function executeArray(array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>} $config, ?string $sourceRef = null): mixed

Origin reference for the compiled cache file’s header comment.

ParameterTypeDescription
$configarray{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}The canonical config array, matching the shape returned by toCanonicalArray().
$sourceRef?``stringOrigin reference for the compiled cache file’s header comment.

Returns mixed — The declaration to be cached, exactly as execute() returns.

public function schema(): Rule

Returns the structural rule the handler’s canonical array must satisfy.

The rule describes the shape produced by the handler’s toCanonicalArray(), whatever source format that array came from, so a PHP-array or YAML config is checked against exactly the same structure as the XML one.

Returns Rule — The structural schema for the canonical array returned by toCanonicalArray().

public function toCanonicalArray(XmlConfigDomDocument $document): array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}

The parsed security.xml document.

ParameterTypeDescription
$documentXmlConfigDomDocumentThe parsed security.xml document.

Returns array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}

public function toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}, positions: array<string, array{file: string, line: int}>}

Correlates surviving elements back to their source file/line.

ParameterTypeDescription
$documentXmlConfigDomDocumentThe parsed security.xml document.
$positionsElementPositionIndexCorrelates surviving elements back to their source file/line.

Returns array{data: array{password_hasher_algorithm: ?string, providers: array<string, array{type: string, connection: ?string, table: ?string, identifier_column: ?string, password_column: ?string}>, firewalls: array<string, array{pattern: string, stateless: bool, sessionless: bool, entry_point: ?string, provider: ?string, authenticators: array<int, string>}>}, positions: array<string, array{file: string, line: int}>}

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
appendParameter()ParameterHolderAppend a parameter.
appendParameterByRef()ParameterHolderAppend a parameter by reference.
clearParameters()ParameterHolderClear all parameters associated with this request.
getFlatParameterNames()ParameterHolderRetrieve an array of flattened parameter names.
getParameter()ParameterHolderRetrieve a parameter.
getParameterNames()ParameterHolderRetrieve an array of parameter names.
getParameters()ParameterHolderRetrieve an array of parameters.
hasParameter()ParameterHolderIndicates whether or not a parameter exists.
initialize()XmlConfigHandlerInitialize this ConfigHandler.
literalize()BaseConfigHandlerLiteralize a string value.
removeParameter()ParameterHolderRemove a parameter.
replaceConstants()BaseConfigHandlerReplace configuration directive identifiers in a string.
replacePath()BaseConfigHandlerReplace a relative filesystem path with an absolute one.
reset()ParameterHolderRemoves every parameter held, leaving the holder empty for reuse.
setParameter()ParameterHolderSet a parameter.
setParameterByRef()ParameterHolderSet a parameter by reference.
setParameters()ParameterHolderSet an array of parameters.
setParametersByRef()ParameterHolderSet an array of parameters by reference.