Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 7211:506c86823abb
Add config argument to more password.Password invocations.
The work done to allow password_pbkdf2_default_rounds to be overridden
for testing requires that calls to password.Password include a config
argument.
This was needed because using the real value more than quadrupled
testing runtime.
However there are still a few places where config was not being set
when Password was called. I think this fixes all of the ones that are
called from a function that have access to a db.config object.
The remaining ones all call Password(encrypted=x). This results in
Password.unpack() being called. If x is not a propertly formatted
password string ("{scheme}...", it calls encodePassword. It then
should end up raising the ConfigNotSet exception. This is
probably what we want as it means the shape of "x" is not correct.
I don't understand why Password.unpack() attempts to encrypt the value
of encrypted if it doesn't match the right form. According to codecov,
this encryption branch is being used, so somewhere x is of the wrong
form. Hmmm....
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 04 Mar 2023 00:17:26 -0500 |
| parents | f524ddc27af8 |
| children | 82bbb95e5690 6f841a55eabf |
comparison
equal
deleted
inserted
replaced
| 7210:7147a4c833e9 | 7211:506c86823abb |
|---|---|
| 3253 elif isinstance(prop, hyperdb.Date): | 3253 elif isinstance(prop, hyperdb.Date): |
| 3254 value = date.Date(value) | 3254 value = date.Date(value) |
| 3255 elif isinstance(prop, hyperdb.Interval): | 3255 elif isinstance(prop, hyperdb.Interval): |
| 3256 value = date.Interval(value) | 3256 value = date.Interval(value) |
| 3257 elif isinstance(prop, hyperdb.Password): | 3257 elif isinstance(prop, hyperdb.Password): |
| 3258 value = password.Password(encrypted=value) | 3258 value = password.Password(encrypted=value, |
| 3259 config=self.db.config) | |
| 3259 elif isinstance(prop, String): | 3260 elif isinstance(prop, String): |
| 3260 value = us2s(value) | 3261 value = us2s(value) |
| 3261 if not isinstance(value, str): | 3262 if not isinstance(value, str): |
| 3262 raise TypeError('new property "%(propname)s" not a ' | 3263 raise TypeError('new property "%(propname)s" not a ' |
| 3263 'string: %(value)r' % locals()) | 3264 'string: %(value)r' % locals()) |
