From a55cc3653de22d868ade5303918280a38e8e9fe8 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 31 Jan 2018 12:27:55 +0100 Subject: keys: store type and rev in hash rather than serialized Since the old keys used to be strings i started out by json serializing the new keys with type, value, rev. However storing serialized json in couch (json) does not really make sense. So now we do not serialize but instead have one json document. The lookup for a key of type pgp may still return a string but for everything that uses the new api it will return a hash with type and revision. This data structure is way easier to handle also on the nickserver side. --- test/unit/keyring_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit/keyring_test.rb') diff --git a/test/unit/keyring_test.rb b/test/unit/keyring_test.rb index c7df63e..48bab29 100644 --- a/test/unit/keyring_test.rb +++ b/test/unit/keyring_test.rb @@ -82,8 +82,8 @@ class KeyringTest < ActiveSupport::TestCase def teststorage @teststorage ||= Hash.new.tap do |dummy| - def dummy.set_key(type, value) - self[type] = value + def dummy.set_key(type, hash) + self[type] = hash.stringify_keys end def dummy.keys -- cgit v1.2.3