I am looking for a way to store some additional metadata for the remainder of a request, that should be removed after the request has finished. Sessions or SharedTempStore store persistent data across requests, which is not desirable.
The main problem is that I am working on an inbound PathProcessor, which after some path modifications needs to check if a valid path remains by using
\Drupal::service('path.validator')->isValid($path). This in turn calls all PathProcessors again, leading to infinite processing. I wish to store some sort of metadata in the request, so that the PathProcessor is aware that it is ran for a second time and does nothing.
Obviously, for subsequent requests the metadata should initially be empty again so that the processing is done for each request.