[Python-modules-commits] [python-keyczar] 01/06: Imported Upstream version 0.716+ds
Christian Kastner
ckk at moszumanska.debian.org
Mon May 23 17:05:21 UTC 2016
This is an automated email from the git hooks/post-receive script.
ckk pushed a commit to branch master
in repository python-keyczar.
commit 289fb6435ff16975f222d68b48e275f5e1c851cb
Author: Christian Kastner <ckk at kvr.at>
Date: Sun May 22 23:09:52 2016 +0200
Imported Upstream version 0.716+ds
---
ChangeLog | 8 +++++++
python_keyczar.egg-info/PKG-INFO | 22 +++++++++++++-----
python_keyczar.egg-info/SOURCES.txt | 38 +++++++++++++++++++-------------
python_keyczar.egg-info/entry_points.txt | 3 +++
python_keyczar.egg-info/requires.txt | 3 ++-
setup.py | 2 +-
src/keyczar/keyczar.py | 12 +++++-----
src/keyczar/readers.py | 2 ++
src/keyczar/util.py | 32 +++++----------------------
tests/keyczar_tests/session_test.py | 7 ------
10 files changed, 67 insertions(+), 62 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a1d40a7..cf0ddcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Keyczar Python release 0.716
+==================
+2016-05-04 Shawn Willden <swillden at google.com>
+
+Overview of Changes:
+ * Replace the Memoize decorator with property cache to avoid memory leak.
+ * Add compatiblity with django-environ (Path)
+
Keyczar Python release 0.715
==================
Overview of Changes:
diff --git a/python_keyczar.egg-info/PKG-INFO b/python_keyczar.egg-info/PKG-INFO
index c4abefa..dcf13c2 100644
--- a/python_keyczar.egg-info/PKG-INFO
+++ b/python_keyczar.egg-info/PKG-INFO
@@ -1,10 +1,20 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: python-keyczar
-Version: 0.7b
+Version: 0.71h
Summary: Toolkit for safe and simple cryptography
Home-page: http://www.keyczar.org/
-Author: Arkajit Dey
-Author-email: arkajit.dey at gmail.com
-License: UNKNOWN
+Author: Google, Inc.
+Author-email: keyczar-discuss at googlegroups.com
+License: http://www.apache.org/licenses/LICENSE-2.0
Description: UNKNOWN
-Platform: UNKNOWN
+Platform: any
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Programming Language :: Python
+Classifier: Topic :: Security
+Classifier: Topic :: Security :: Cryptography
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: Unix
diff --git a/python_keyczar.egg-info/SOURCES.txt b/python_keyczar.egg-info/SOURCES.txt
index a64b9ad..79d874b 100644
--- a/python_keyczar.egg-info/SOURCES.txt
+++ b/python_keyczar.egg-info/SOURCES.txt
@@ -1,8 +1,11 @@
.checkstyle
.project
.pydevproject
+ChangeLog
+LICENSE
MANIFEST.in
README
+setup.cfg
setup.py
.settings/org.eclipse.wst.sse.core.prefs
.settings/org.eclipse.wst.validation.prefs
@@ -44,20 +47,22 @@ jtestdata/rsa-sign/meta
jtestdata/rsa-sign.public/1
jtestdata/rsa-sign.public/2
jtestdata/rsa-sign.public/meta
-keyczar/__init__.py
-keyczar/errors.py
-keyczar/keyczar.py
-keyczar/keyczart.py
-keyczar/keydata.py
-keyczar/keyinfo.py
-keyczar/keys.py
-keyczar/readers.py
-keyczar/util.py
python_keyczar.egg-info/PKG-INFO
python_keyczar.egg-info/SOURCES.txt
python_keyczar.egg-info/dependency_links.txt
+python_keyczar.egg-info/entry_points.txt
python_keyczar.egg-info/requires.txt
python_keyczar.egg-info/top_level.txt
+src/keyczar/__init__.py
+src/keyczar/errors.py
+src/keyczar/keyczar.py
+src/keyczar/keyczart.py
+src/keyczar/keydata.py
+src/keyczar/keyinfo.py
+src/keyczar/keys.py
+src/keyczar/readers.py
+src/keyczar/util.py
+src/keyczar/writers.py
testdata/aes/1
testdata/aes/1.out
testdata/aes/2
@@ -94,9 +99,12 @@ testdata/rsa-sign/meta
testdata/rsa-sign.public/1
testdata/rsa-sign.public/2
testdata/rsa-sign.public/meta
-tests/keyczar/__init__.py
-tests/keyczar/alltests.py
-tests/keyczar/crypter_test.py
-tests/keyczar/keyczart_test.py
-tests/keyczar/openssl
-tests/keyczar/signer_test.py
\ No newline at end of file
+tests/keyczar_tests/__init__.py
+tests/keyczar_tests/alltests.py
+tests/keyczar_tests/crypter_test.py
+tests/keyczar_tests/interop_test.py
+tests/keyczar_tests/keyczart_test.py
+tests/keyczar_tests/openssl
+tests/keyczar_tests/session_test.py
+tests/keyczar_tests/signer_test.py
+tests/keyczar_tests/util_test.py
\ No newline at end of file
diff --git a/python_keyczar.egg-info/entry_points.txt b/python_keyczar.egg-info/entry_points.txt
new file mode 100644
index 0000000..3547d39
--- /dev/null
+++ b/python_keyczar.egg-info/entry_points.txt
@@ -0,0 +1,3 @@
+[console_scripts]
+keyczart = keyczar.keyczart:_main_setuptools
+
diff --git a/python_keyczar.egg-info/requires.txt b/python_keyczar.egg-info/requires.txt
index ac63416..414506d 100644
--- a/python_keyczar.egg-info/requires.txt
+++ b/python_keyczar.egg-info/requires.txt
@@ -1 +1,2 @@
-pycrypto >= 1.9
\ No newline at end of file
+pycrypto>2.0
+pyasn1
\ No newline at end of file
diff --git a/setup.py b/setup.py
index e1c4c9e..2e2683a 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ setup(name='python-keyczar',
author='Arkajit Dey',
author_email='arkajit.dey at gmail.com',
url='http://www.keyczar.org/',
- version='0.715',
+ version='0.71h',
packages=['keyczar'],
package_dir={'keyczar': 'src/keyczar'},
install_requires=['pycrypto>2.0', 'pyasn1'],
diff --git a/src/keyczar/keyczar.py b/src/keyczar/keyczar.py
index ee3f169..ad127ab 100644
--- a/src/keyczar/keyczar.py
+++ b/src/keyczar/keyczar.py
@@ -291,7 +291,7 @@ class GenericKeyczar(Keyczar):
if isinstance(writer, basestring):
writer = writers.CreateWriter(writer)
warnings.warn(
- 'Using a string as the writer is deprecated. Use writers.CreateWriter',
+ 'Using a string as the writer is deprecated. Use writers.CreateWriter',
DeprecationWarning)
self.metadata.encrypted = (encrypter is not None)
writer.WriteMetadata(self.metadata)
@@ -352,7 +352,7 @@ class Encrypter(Keyczar):
@type output_stream: 'file-like' object
@param encoder: the encoding stream to use on the ciphertext stream.
- Defaults to base64 encoding with no padding or line breaks.
+ Defaults to base64 encoding with no padding or line breaks.
Use None for raw bytes.
@type encoder: 'file-like' object
@@ -547,7 +547,7 @@ class Crypter(Encrypter):
@type output_stream: 'file-like' object
@param decoder: the decoding stream to use on the incoming stream.
- Defaults to base64 decoding with no padding or line breaks.
+ Defaults to base64 decoding with no padding or line breaks.
Use None for handling raw bytes.
@type decoder: 'file-like' object
@@ -729,12 +729,14 @@ class _Session(object):
return session
@property
- @util.Memoize
def crypter(self):
"""
Returns a Crypter which can be used to encrypt and decrypt data using the session key.
"""
- return Crypter(readers.StaticKeyReader(self.__session_key, keyinfo.DECRYPT_AND_ENCRYPT))
+ if not hasattr(self, '_crypter'):
+ self._crypter = Crypter(readers.StaticKeyReader(
+ self.__session_key, keyinfo.DECRYPT_AND_ENCRYPT))
+ return self._crypter
@property
def nonce(self):
diff --git a/src/keyczar/readers.py b/src/keyczar/readers.py
index a71d01d..aa50811 100644
--- a/src/keyczar/readers.py
+++ b/src/keyczar/readers.py
@@ -113,6 +113,8 @@ class FileReader(Reader):
@classmethod
def CreateReader(cls, location):
result = None
+ location = str(location) # This fixes the case in case the location is
+ # an instance of Path (from django-environ)
if os.path.exists(location):
result = FileReader(location)
return result
diff --git a/src/keyczar/util.py b/src/keyczar/util.py
index d949215..9e6f217 100644
--- a/src/keyczar/util.py
+++ b/src/keyczar/util.py
@@ -579,7 +579,7 @@ class IncrementalBase64WSStreamWriter(codecs.StreamWriter, object):
"""
def __init__(self, stream, errors='strict'):
- """
+ """
Creates an IncrementalBase64WSStreamWriter instance.
@param stream: a file-like object open for writing (binary) data.
@@ -706,7 +706,7 @@ class IncrementalBase64WSStreamReader(codecs.StreamReader, object):
"""
def __init__(self, stream, errors='strict'):
- """
+ """
Creates an IncrementalBase64WSStreamReader instance.
@param stream: a file-like object open for reading (binary) data.
@@ -730,7 +730,7 @@ class IncrementalBase64WSStreamReader(codecs.StreamReader, object):
self.decoder = BufferedIncrementalBase64WSDecoder(errors=errors)
def read(self, size=-1, chars=-1, firstline=False):
- """
+ """
Decodes data from the input stream and returns the resulting object.
@param chars: the number of characters to read from the stream. read() will
@@ -756,7 +756,7 @@ class IncrementalBase64WSStreamReader(codecs.StreamReader, object):
end of the input data has been reached.
@rtype: string
"""
-
+
# NOTE: this is a copy of the code from Python v2.7 codecs.py tweaked to
# handle non-blocking streams i.e. those that return None to indicate no
# data is available but is not at EOF - see read() in the Python I/O module
@@ -845,27 +845,6 @@ class IncrementalBase64WSStreamReader(codecs.StreamReader, object):
"""
return self.decoder.decode(input)
-
-def Memoize(func):
- """
- General-purpose memoization decorator. Handles functions with any number of arguments,
- including keyword arguments.
- """
- memory = {}
-
- @functools.wraps(func)
- def memo(*args,**kwargs):
- pickled_args = cPickle.dumps((args, sorted(kwargs.iteritems())))
-
- if pickled_args not in memory:
- memory[pickled_args] = func(*args,**kwargs)
-
- return memory[pickled_args]
-
- if memo.__doc__:
- memo.__doc__ = "\n".join([memo.__doc__,"This function is memoized."])
- return memo
-
def ImportAll(pluginpath):
"""
Simple plugin importer - imports from the specified subdirectory under the
@@ -883,7 +862,7 @@ def ImportAll(pluginpath):
def ImportBackends():
"""
- Simple backend plugin importer - imports from the 'backends' subdirectory
+ Simple backend plugin importer - imports from the 'backends' subdirectory
under the util.py directory and any directories in the environment variable
'KEYCZAR_BACKEND_PATHS', which can contain >=1 paths joined using the o/s
"""
@@ -893,4 +872,3 @@ def ImportBackends():
if xtra_paths:
for path in xtra_paths.split(os.pathsep):
ImportAll(path)
-
diff --git a/tests/keyczar_tests/session_test.py b/tests/keyczar_tests/session_test.py
index 54d3135..92a61f5 100644
--- a/tests/keyczar_tests/session_test.py
+++ b/tests/keyczar_tests/session_test.py
@@ -57,13 +57,6 @@ class SessionEncrypterTest(unittest.TestCase):
plaintext = session_decrypter.Decrypt(ciphertext)
self.assertEqual(self.input, plaintext)
- # Test raw encryption/decryption
- raw_ciphertext = session_encrypter.Encrypt(self.input, encoder=None)
- # The headers should be equal; ciphertext will be different due to IVs
- self.assertEqual(util.Base64WSDecode(ciphertext)[0:5], raw_ciphertext[0:5])
- plaintext = session_decrypter.Decrypt(raw_ciphertext, decoder=None)
- self.assertEqual(self.input, plaintext)
-
def testSignedSessionEncryptAndDecrypt(self):
encrypter = keyczar.Encrypter.Read(_get_test_dir("rsa"))
signer = keyczar.Signer.Read(_get_test_dir("dsa"))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-keyczar.git
More information about the Python-modules-commits
mailing list