Open albu-diku opened 3 months ago
I suppose this one still needs further care regarding the failed py2 CI job. Please just request a review or ping me when I should have a look at merging @albu-diku .
I suppose this one still needs further care regarding the failed py2 CI job. Please just request a review or ping me when I should have a look at merging @albu-diku .
Yah, that's right - this was marked as a draft PR while that stuff is sorted out, mentioning as it's a convention I will be following going forward to hopefully keep review candidates somewhat obvious 'at a glance".
Alright, yes I did read your notes about sharing early and generally think that it's a good idea, but perhaps I missed the draft tag here. All good.
@jonasbardino if you do look at this before I push again, ignore what's in envhelp/python3 - those bits are unrelated and probably want their own lttle PR as and when :)
The validation of openid auth parameters is achieved by the use of a generic validation routine which is passed differing 'definition' dictionaries based on which open id auth mode is in use.
Previously these dictionaries were buried cases within what amounted to a switch over the auth mode. In addition we note the auth mode is an enumerated set of values and a large number of codepaths take action based on which of the set is activated.
Make the auth mode an enumerated constant. In order to support add an
AsciiEnum
type which is based on the official documentation suggested implementation for an enumeration whose values behave as strings within comparisons. We use the officially backportedenum34
package to add enum to Python 2 and base the new type onUse the existing constants as the values of the new auth constants such that they can be used interchangeably in cases where the originals were used to support gradual replacement. Use the cases of this enumeration as keys into a dictionary which maps them to the relevant validation definition dictionary.