PHP Class Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService

It is used when forms are generated and submitted: After a form has been generated, the method "generateRequestHash" is called with the names of all form fields. It cleans up the array of form fields and creates another representation of it, which is then serialized and hashed. Both serialized form field list and the added hash form the request hash, which will be sent over the wire (as an argument __hmac). On the validation side, the validation happens in two steps: 1) Check if the request hash is consistent (the hash value fits to the serialized string) 2) Check that _all_ GET/POST parameters submitted occur inside the form field list of the request hash. Note: It is crucially important that a private key is computed into the hash value! This is done inside the HashService.
Mostrar archivo Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$hashService Neos\Flow\Security\Cryptography\HashService

Public Methods

Method Description
generateTrustedPropertiesToken ( array $formFieldNames, string $fieldNamePrefix = '' ) : string Generate a request hash for a list of form fields
initializePropertyMappingConfigurationFromRequest ( ActionRequest $request, Arguments $controllerArguments ) : void Initialize the property mapping configuration in $controllerArguments if the trusted properties are set inside the request.

Protected Methods

Method Description
modifyPropertyMappingConfiguration ( array $propertyConfiguration, PropertyMappingConfiguration $propertyMappingConfiguration ) : void Modify the passed $propertyMappingConfiguration according to the $propertyConfiguration which has been generated by Fluid. In detail, if the $propertyConfiguration contains an __identity field, we allow modification of objects; else we allow creation.
serializeAndHashFormFieldArray ( array $formFieldArray ) : string Serialize and hash the form field array

Method Details

generateTrustedPropertiesToken() public method

Generate a request hash for a list of form fields
public generateTrustedPropertiesToken ( array $formFieldNames, string $fieldNamePrefix = '' ) : string
$formFieldNames array Array of form fields
$fieldNamePrefix string
return string trusted properties token

initializePropertyMappingConfigurationFromRequest() public method

Initialize the property mapping configuration in $controllerArguments if the trusted properties are set inside the request.
public initializePropertyMappingConfigurationFromRequest ( ActionRequest $request, Arguments $controllerArguments ) : void
$request Neos\Flow\Mvc\ActionRequest
$controllerArguments Arguments
return void

modifyPropertyMappingConfiguration() protected method

All other properties are specified as allowed properties.
protected modifyPropertyMappingConfiguration ( array $propertyConfiguration, PropertyMappingConfiguration $propertyMappingConfiguration ) : void
$propertyConfiguration array
$propertyMappingConfiguration Neos\Flow\Property\PropertyMappingConfiguration
return void

serializeAndHashFormFieldArray() protected method

Serialize and hash the form field array
protected serializeAndHashFormFieldArray ( array $formFieldArray ) : string
$formFieldArray array form field array to be serialized and hashed
return string Hash

Property Details

$hashService protected_oe property

protected HashService,Neos\Flow\Security\Cryptography $hashService
return Neos\Flow\Security\Cryptography\HashService