Add CSP handler setting
Fixes #397
This PR adds the SAML_CSP_HANDLER setting so that users can specify how CSP should be updated, if at all.
The default behaviour of using django-csp remains the same.
@peppelinux How do you feel about the overall approach taken?
Good feature,
however this must be refactored: https://github.com/IdentityPython/djangosaml2/pull/401/files#diff-fcaad0de48c174c47b13c1ff9c42a101f319429573505b1120123d31bfe791c8R220
we have to reduce the nested if statements, I'll try to give some hints If time will permit, otherwise please do your refactoring proposals
Not too sure what you meant by "nested if statements" as there was only a single level. I do agree that there was too much logic bundled together and have split it up a bit.
I hope it is somewhat inline with what you were thinking.
sorry for the late @GertBurger
we can open an issue saying that a a further analysis for a code refactor can be made as well.
at the current state the unit tests fails with py3.8 while djangosaml2 needs the support until the official eol of it and the decision of the idpy dev team.
could you propose any workaround in this PR?
ah yes, cache was only introduced in Python 3.9 but it is a very thin wrapper around lru_cache. I've switched to the latter.