Permalink
Browse files

add example datafile in agilekeychain format, tidy up integration tests

  • Loading branch information...
1 parent ef4e600 commit 6ac9bbb52b119008ebad1493c74bce0cb2a89851 @Roguelazer committed Feb 22, 2013
Showing with 3,902 additions and 4 deletions.
  1. +3,870 −0 data/sample.agilekeychain/1Password.html
  2. BIN data/sample.agilekeychain/a/default/thumb/l/A7E82B9E4EAB4F8BB14DC3C6C25EF6C8
  3. +1 −0 data/sample.agilekeychain/a/default/thumb/l/A7E82B9E4EAB4F8BB14DC3C6C25EF6C8.def
  4. BIN data/sample.agilekeychain/a/default/thumb/m/A7E82B9E4EAB4F8BB14DC3C6C25EF6C8
  5. +1 −0 data/sample.agilekeychain/a/default/thumb/m/A7E82B9E4EAB4F8BB14DC3C6C25EF6C8.def
  6. +1 −0 data/sample.agilekeychain/config/buildnum
  7. +1 −0 data/sample.agilekeychain/config/use-thumbnails
  8. BIN data/sample.agilekeychain/data/default/.1password.keys
  9. +1 −0 data/sample.agilekeychain/data/default/.password.hint
  10. BIN data/sample.agilekeychain/data/default/1password.keys
  11. +1 −0 data/sample.agilekeychain/data/default/23591BA807444B1EB5F356A807ED62F0.1password
  12. +1 −0 data/sample.agilekeychain/data/default/A7E82B9E4EAB4F8BB14DC3C6C25EF6C8.1password
  13. +1 −0 data/sample.agilekeychain/data/default/contents.js
  14. +1 −0 data/sample.agilekeychain/data/default/encryptionKeys.js
  15. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_0.js
  16. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_1.js
  17. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_2.js
  18. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_3.js
  19. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_4.js
  20. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_5.js
  21. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_7.js
  22. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_D.js
  23. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_E.js
  24. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/band_F.js
  25. 0 data/{sample_cloudkeychain → sample.cloudkeychain}/default/profile.js
  26. +5 −3 onepassword/keychain.py
  27. +17 −0 tests/integration/agilekeychain.py
  28. +1 −1 tests/integration/cloudkeychain.py

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1 @@
+{"encryptionKey":"FDFF57742F4248719A337AD2AD93DA76","encrypted":true,"contentsHash":"d7560e1d"}
@@ -0,0 +1 @@
+{"encryptionRequired":false,"encrypted":false,"contentsHash":"2039460f"}
@@ -0,0 +1 @@
+39001
@@ -0,0 +1 @@
+y
Binary file not shown.
@@ -0,0 +1 @@
+george
Binary file not shown.
@@ -0,0 +1 @@
+{"uuid":"23591BA807444B1EB5F356A807ED62F0","updatedAt":1361554847,"locationKey":"","openContents":{"securityLevel":"SL5","contentsHash":"10a7703b"},"keyID":"FDFF57742F4248719A337AD2AD93DA76","title":"I am a note!","location":"","encrypted":"U2FsdGVkX19tN63hCc5UeaATCvjt2/1e5cMsFArwvFzrPmPGGqxIuzxtmHym5gWBnuGE9ztw6Qvl6bmZ9PsqHA==\u0000","createdAt":1361554834,"typeName":"securenotes.SecureNote"}
@@ -0,0 +1 @@
+{"uuid":"A7E82B9E4EAB4F8BB14DC3C6C25EF6C8","updatedAt":1361554830,"locationKey":"google.com","openContents":{"usernameHash":"f1a17031762820b40e5fc9ad54e9735a6c4b6dd3a7cbe0dd46033406ed354f17","securityLevel":"SL5","contentsHash":"530e2de0"},"keyID":"FDFF57742F4248719A337AD2AD93DA76","title":"Google","location":"http://www.google.com","encrypted":"U2FsdGVkX18k/jtACb/7twKFg+Dfa+JNT8fpFif0u20ecEcMZDjUXlYyP2VEjk65xTNgkSHQELJ9e8ZsF/wu1V/K933WPAtfYMEVXstM+e980cdMiH94K3qrX0foTo+TDCVcSyvBhawGuU08sJ+qeBHYNmIw+7A3SiWEyUDK9J750XWNInSoTldiqiE5RN1wuodzODt0nZyqNnJ+ixzR4A==\u0000","createdAt":1361554822,"typeName":"webforms.WebForm"}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -8,7 +8,8 @@
from . import padding
from .item import Item
-EXPECTED_VERSION = 30645
+EXPECTED_VERSION_MIN = 30000
+EXPECTED_VERSION_MAX = 40000
class AbstractKeychain(object):
@@ -48,8 +49,9 @@ def check_version(self):
version_file = os.path.join(self.base_path, 'config', 'buildnum')
with open(version_file, 'r') as f:
version_num = int(f.read().strip())
- if version_num != EXPECTED_VERSION:
- raise ValueError("I only understand 1Password build %s" % EXPECTED_VERSION)
+ if version_num < EXPECTED_VERSION_MIN or version_num > EXPECTED_VERSION_MAX:
+ print version_num
+ raise ValueError("I only understand 1Password builds in [%s,%s]" % (EXPECTED_VERSION_MIN, EXPECTED_VERSION_MAX))
def unlock(self, password):
keys = self._load_keys(password)
@@ -0,0 +1,17 @@
+import os.path
+
+import testify as T
+
+import onepassword.keychain
+
+class AgileKeychainIntegrationTestCase(T.TestCase):
+ test_file_root = os.path.realpath(os.path.join(__file__, '..', '..', '..', 'data', 'sample.agilekeychain'))
+
+ def test_open(self):
+ c = onepassword.keychain.AKeychain(self.test_file_root)
+ c.unlock("george")
+
+
+if __name__ == '__main__':
+ T.run()
+
@@ -5,7 +5,7 @@
import onepassword.keychain
class CloudKeychainIntegrationTestCase(T.TestCase):
- test_file_root = os.path.realpath(os.path.join(__file__, '..', '..', '..', 'data', 'sample_cloudkeychain'))
+ test_file_root = os.path.realpath(os.path.join(__file__, '..', '..', '..', 'data', 'sample.cloudkeychain'))
def test_open(self):
c = onepassword.keychain.CKeychain(self.test_file_root)

0 comments on commit 6ac9bbb

Please sign in to comment.