diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2020-01-30 11:25:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 11:25:59 +0000 |
commit | 5a246611e3cbf27cf1dd7e4453adc8040cddd6a2 (patch) | |
tree | 549d4432af55704c2c59d687fb4c0eef0ca4c207 /tests/storage/test_keys.py | |
parent | Remove unused DeviceRow class (#6800) (diff) | |
download | synapse-5a246611e3cbf27cf1dd7e4453adc8040cddd6a2.tar.xz |
Type defintions for use in refactoring for redaction changes (#6803)
* Bump signedjson to 1.1 ... so that we can use the type definitions * Fix breakage caused by upgrade to signedjson 1.1 Thanks, @illicitonion...
Diffstat (limited to 'tests/storage/test_keys.py')
-rw-r--r-- | tests/storage/test_keys.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/storage/test_keys.py b/tests/storage/test_keys.py index e07ff01201..95f309fbbc 100644 --- a/tests/storage/test_keys.py +++ b/tests/storage/test_keys.py @@ -14,6 +14,7 @@ # limitations under the License. import signedjson.key +import unpaddedbase64 from twisted.internet.defer import Deferred @@ -21,11 +22,17 @@ from synapse.storage.keys import FetchKeyResult import tests.unittest -KEY_1 = signedjson.key.decode_verify_key_base64( - "ed25519", "key1", "fP5l4JzpZPq/zdbBg5xx6lQGAAOM9/3w94cqiJ5jPrw" + +def decode_verify_key_base64(key_id: str, key_base64: str): + key_bytes = unpaddedbase64.decode_base64(key_base64) + return signedjson.key.decode_verify_key_bytes(key_id, key_bytes) + + +KEY_1 = decode_verify_key_base64( + "ed25519:key1", "fP5l4JzpZPq/zdbBg5xx6lQGAAOM9/3w94cqiJ5jPrw" ) -KEY_2 = signedjson.key.decode_verify_key_base64( - "ed25519", "key2", "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw" +KEY_2 = decode_verify_key_base64( + "ed25519:key2", "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw" ) |