geopython / pywps

PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
https://pywps.org
MIT License
178 stars 117 forks source link

Configuration flooded with current environment #606

Closed aulemahal closed 3 years ago

aulemahal commented 3 years ago

Hi! While trying to get a special "metadata" config section, I wanted to make it so that anything field present in that section gets added to the metadata of my process' outputs (this is in finch). However, when getting that section through the configuration object, one can't simply list the options, because the whole os environment is included.

Ex: the following : list(configuration.CONFIG['metadata:main'].keys()) returns the metadata keys but also every variable in my environment.

The culprit is: https://github.com/geopython/pywps/blob/559f13b960b2ba17599818e05c047ce3f1b2e54d/pywps/configuration.py#L68

My question, is this necessary? I am no expert in application configuration, but it seems to me a bit over-the-top? Could pyWPS already know which options can be passed through the environment, and only parse those?

cehbrecht commented 3 years ago

This was introduced with PR #365.

@SvenDowideit @jachym what do you think?

SvenDowideit commented 3 years ago

we use it to allow our devs to make template configs with not-previously known env vars, which then get expanded from different container env configurations.

ie - pyWPS has no idea what they are.

but idk - over the next years we're looking to move to replacing our config files with URL endpoints, so deployments can customise the config file that a service like pyWPS uses can be dynamically changed based on incoming request headers.

aulemahal commented 3 years ago

Understood! My workaround in finch is reasonably working, so I'll close this.