Closed francescoingv closed 7 months ago
We discussed this topic at the Évora pygeoapi code sprint and decided that this could be implemented outside of pygeoapi core without much effort.
A possible way would be to have a middleware that puts the context information into the pygeoapi environment and then have custom processes get this from their env.
So I guess this issue can be closed.
@ricardogsilva I'm going to close this, can you please open a dedicated ticket in fastgeoapi
It would be useful for a process manager to be given some context information regarding the current request, in addition to what is already specified in the OAProc standard, for example if the client sends some custom HTTP header.
Additionally, pygeoapi core may wish to also send some context information to be used during job execution, like some metadata or other config values.
With this in mind we could add an additional parameter to the process_manager's
execute_process()
method that would provide this context. Something like this:As for the content of this new
context
dictionary, we can decide what would be valuable to include, but at least the request's HTTP headers already seem like a good option. Some other relevant things might be related to log information, and any other general configuration values.This pattern of enhancing an execution with contextual information would be similar to what github actions does, for example (where it provides also a way to get context information about the current environment.
Describe alternatives you've considered The current implementation does not really allow a running job to be given more context than process-related inputs, so there does not seem to be much alternative other than changing the signature of the
execute_process()
method.