Kinto / kinto-signer

Digital signatures to guarantee integrity and authenticity of collections of records.
12 stars 7 forks source link

Simplify passing of settings to listeners #220

Open leplatrem opened 6 years ago

leplatrem commented 6 years ago

Some settings are obtained using a currified event listener function (resources, to_review_enabled etc.). The signer is obtained via the request.registry.signers[key] attribute.

There might be some ways to simplify and «unify» this.

leplatrem commented 6 years ago

Related as pointed out by Ethan:

I feel on some level that the problem here is that our settings are a giant dict of str -> setting and not something more hierarchical, but changing that in the config file would probably be a much bigger undertaking. I almost wonder if this could be cleaned up by running a preprocessing step on all settings to turn them into something more hierarchical.

Another part of the problem is that you don't know what the possible collection names are until a request comes in. Maybe a possibility is to fetch signers on-demand rather than instantiating them on startup, but I guess that would turn startup configuration problems into request-time configuration issues. Yuck.