[WiP] Inconsistent context.state exception handling #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An Exception handling on missing SATOSA_BASE in context.state[STATE_KEY]["requester"].
Probably also related to #228
If a http request come from an arbitrary link, like
the satosa frontend cannot run
SatosaBase._auth_req_callback_func
, so it never inizializesstate[STATE_KEY] = {"requester": internal_request.requester}
.This PR would introduce a self explanatory error message to user, this permit them to understand the nature of the problem without calling help-desk support.
I admit that this sounds, as it is now, too much hardcoded, I'd like to start a discussion with you to handle in a definitive way this kind of feature.
A good point of discussion could be the possibility to disallow backend's authnRequest if context.state would be inconsistent, I think that this would be a better strategy (also with a human readable message to users that warns on this)
All Submissions