Only in dist/signedjson-1.1.1/changelog.d: 11.misc Only in dist/signedjson-1.1.1/changelog.d: 18.misc Only in dist/signedjson-1.1.1/changelog.d: 9.bugfix Only in /tmp/signedjson-1.1.1/: .gitignore Only in /tmp/signedjson-1.1.1/: MANIFEST.in diff -ru /tmp/signedjson-1.1.1/PKG-INFO dist/signedjson-1.1.1/PKG-INFO --- /tmp/signedjson-1.1.1/PKG-INFO 2020-03-27 19:48:21.000000000 +0000 +++ dist/signedjson-1.1.1/PKG-INFO 2022-01-21 18:39:36.961504200 +0000 @@ -1,82 +1,98 @@ -Metadata-Version: 1.0 +Metadata-Version: 2.1 Name: signedjson Version: 1.1.1 Summary: Sign JSON with Ed25519 signatures -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: Signed JSON - =========== - - .. image:: https://img.shields.io/pypi/v/signedjson.svg - :target: https://pypi.python.org/pypi/signedjson/ - :alt: Latest Version - - .. image:: https://img.shields.io/travis/matrix-org/python-signedjson.svg - :target: https://travis-ci.org/matrix-org/python-signedjson - - - Signs JSON objects with ED25519 signatures. - - - Features - -------- - - * More than one entity can sign the same object. - * Each entity can sign the object with more than one key making it easier to - rotate keys - * ED25519 can be replaced with a different algorithm. - * Unprotected data can be added to the object under the ``"unsigned"`` key. - - - Installing - ---------- - - .. code:: bash - - pip install signedjson - - Using - ----- - - .. code:: python - - from signedjson.key import generate_signing_key, get_verify_key - from signedjson.sign import ( - sign_json, verify_signed_json, SignatureVerifyException - ) - - signing_key = generate_signing_key('zxcvb') - signed_json = sign_json({'my_key': 'my_data'}, 'Alice', signing_key) - - verify_key = get_verify_key(signing_key) - - try: - verify_signed_json(signed_json, 'Alice', verify_key) - print 'Signature is valid' - except SignatureVerifyException: - print 'Signature is invalid' - - Format - ------ - - .. code:: json - - { - "": "", - "signatures": { - "": { - "ed25519:": "" - } - }, - "unsigned": { - "": "", - } - } - - - - +Home-page: https://github.com/matrix-org/python-signedjson +License: Apache-2.0 Keywords: json -Platform: UNKNOWN +Author: Matrix.org Team and Contributors +Author-email: packages@matrix.org +Requires-Python: >=3.7,<4.0 +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Requires-Dist: canonicaljson (>=1.0.0) +Requires-Dist: importlib_metadata; python_version < "3.8" +Requires-Dist: pynacl (>=0.3.0) +Requires-Dist: typing (>=3.5); python_version < "3.8" +Requires-Dist: typing_extensions (>=3.5); python_version < "3.8" +Requires-Dist: unpaddedbase64 (>=1.0.1) +Project-URL: Repository, https://github.com/matrix-org/python-signedjson +Description-Content-Type: text/x-rst + +Signed JSON +=========== + +.. image:: https://img.shields.io/pypi/v/signedjson.svg + :target: https://pypi.python.org/pypi/signedjson/ + :alt: Latest Version + +.. image:: https://img.shields.io/travis/matrix-org/python-signedjson.svg + :target: https://travis-ci.org/matrix-org/python-signedjson + + +Signs JSON objects with ED25519 signatures. + + +Features +-------- + +* More than one entity can sign the same object. +* Each entity can sign the object with more than one key making it easier to + rotate keys +* ED25519 can be replaced with a different algorithm. +* Unprotected data can be added to the object under the ``"unsigned"`` key. + + +Installing +---------- + +.. code:: bash + + pip install signedjson + +Using +----- + +.. code:: python + + from signedjson.key import generate_signing_key, get_verify_key + from signedjson.sign import ( + sign_json, verify_signed_json, SignatureVerifyException + ) + + signing_key = generate_signing_key('zxcvb') + signed_json = sign_json({'my_key': 'my_data'}, 'Alice', signing_key) + + verify_key = get_verify_key(signing_key) + + try: + verify_signed_json(signed_json, 'Alice', verify_key) + print 'Signature is valid' + except SignatureVerifyException: + print 'Signature is invalid' + +Format +------ + +.. code:: json + + { + "": "", + "signatures": { + "": { + "ed25519:": "" + } + }, + "unsigned": { + "": "", + } + } + + + + diff -ru /tmp/signedjson-1.1.1/pyproject.toml dist/signedjson-1.1.1/pyproject.toml --- /tmp/signedjson-1.1.1/pyproject.toml 2020-03-27 19:42:41.000000000 +0000 +++ dist/signedjson-1.1.1/pyproject.toml 2022-01-21 18:24:07.797499000 +0000 @@ -33,3 +33,39 @@ directory = "misc" name = "Internal Changes" showcontent = true + +[tool.poetry] +name = "signedjson" +version = "1.1.1" +description = "Sign JSON with Ed25519 signatures" +authors = ["Matrix.org Team and Contributors "] +license = "Apache-2.0" +readme = "README.rst" +repository = "https://github.com/matrix-org/python-signedjson" +keywords = ["json"] +include = [ + { path = "changelog.d", format = "sdist" }, + { path = "CHANGELOG.md", format = "sdist" }, + { path = "tests", format = "sdist" }, + { path = "tox.ini", format = "sdist" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", +] + +[tool.poetry.dependencies] +python = "^3.7" +canonicaljson = ">=1.0.0" +unpaddedbase64 = ">=1.0.1" +pynacl = ">=0.3.0" +typing_extensions = { version = ">=3.5", python = "<3.8" } +typing = { version = ">=3.5", python = "<3.8" } +importlib_metadata = { version = "*", python = "<3.8" } + +[tool.poetry.dev-dependencies] +typing_extensions = ">= 3.5" +twine = "==3.7.1" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" Only in /tmp/signedjson-1.1.1/: setup.cfg diff -ru /tmp/signedjson-1.1.1/setup.py dist/signedjson-1.1.1/setup.py --- /tmp/signedjson-1.1.1/setup.py 2020-03-27 19:41:34.000000000 +0000 +++ dist/signedjson-1.1.1/setup.py 2022-01-21 18:39:36.961230500 +0000 @@ -1,48 +1,36 @@ -#!/usr/bin/env python +# -*- coding: utf-8 -*- +from setuptools import setup -# Copyright 2015 OpenMarket Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +packages = \ +['signedjson'] -from setuptools import setup -from codecs import open -import os +package_data = \ +{'': ['*']} + +install_requires = \ +['canonicaljson>=1.0.0', 'pynacl>=0.3.0', 'unpaddedbase64>=1.0.1'] -here = os.path.abspath(os.path.dirname(__file__)) +extras_require = \ +{':python_version < "3.8"': ['typing_extensions>=3.5', + 'typing>=3.5', + 'importlib_metadata']} + +setup_kwargs = { + 'name': 'signedjson', + 'version': '1.1.1', + 'description': 'Sign JSON with Ed25519 signatures', + 'long_description': 'Signed JSON\n===========\n\n.. image:: https://img.shields.io/pypi/v/signedjson.svg\n :target: https://pypi.python.org/pypi/signedjson/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/travis/matrix-org/python-signedjson.svg\n :target: https://travis-ci.org/matrix-org/python-signedjson\n\n\nSigns JSON objects with ED25519 signatures.\n\n\nFeatures\n--------\n\n* More than one entity can sign the same object.\n* Each entity can sign the object with more than one key making it easier to\n rotate keys\n* ED25519 can be replaced with a different algorithm.\n* Unprotected data can be added to the object under the ``"unsigned"`` key.\n\n\nInstalling\n----------\n\n.. code:: bash\n\n pip install signedjson\n\nUsing\n-----\n\n.. code:: python\n\n from signedjson.key import generate_signing_key, get_verify_key\n from signedjson.sign import (\n sign_json, verify_signed_json, SignatureVerifyException\n )\n\n signing_key = generate_signing_key(\'zxcvb\')\n signed_json = sign_json({\'my_key\': \'my_data\'}, \'Alice\', signing_key)\n\n verify_key = get_verify_key(signing_key)\n\n try:\n verify_signed_json(signed_json, \'Alice\', verify_key)\n print \'Signature is valid\'\n except SignatureVerifyException:\n print \'Signature is invalid\'\n\nFormat\n------\n\n.. code:: json\n\n {\n "": "",\n "signatures": {\n "": {\n "ed25519:": ""\n }\n },\n "unsigned": {\n "": "",\n }\n }\n\n\n\n', + 'author': 'Matrix.org Team and Contributors', + 'author_email': 'packages@matrix.org', + 'maintainer': None, + 'maintainer_email': None, + 'url': 'https://github.com/matrix-org/python-signedjson', + 'packages': packages, + 'package_data': package_data, + 'install_requires': install_requires, + 'extras_require': extras_require, + 'python_requires': '>=3.7,<4.0', +} -def read_file(path_segments): - """Read a UTF-8 file from the package. Takes a list of strings to join to - make the path""" - file_path = os.path.join(here, *path_segments) - with open(file_path, encoding="utf-8") as f: - return f.read() - - -setup( - name="signedjson", - packages=["signedjson"], - description="Sign JSON with Ed25519 signatures", - use_scm_version=True, - setup_requires=["setuptools_scm"], - install_requires=[ - "canonicaljson>=1.0.0", - "unpaddedbase64>=1.0.1", - "pynacl>=0.3.0", - "typing_extensions>=3.5", - 'typing>=3.5;python_version<"3.5"', - "importlib_metadata", - ], - long_description=read_file(("README.rst",)), - keywords="json", -) +setup(**setup_kwargs) diff -ru /tmp/signedjson-1.1.1/signedjson/__init__.py dist/signedjson-1.1.1/signedjson/__init__.py --- /tmp/signedjson-1.1.1/signedjson/__init__.py 2020-03-27 19:41:34.000000000 +0000 +++ dist/signedjson-1.1.1/signedjson/__init__.py 2022-01-21 17:35:40.073041200 +0000 @@ -12,7 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from importlib_metadata import version, PackageNotFoundError +try: + from importlib.metadata import version, PackageNotFoundError +except ImportError: # pragma: nocover + from importlib_metadata import version, PackageNotFoundError try: __version__ = version(__name__) diff -ru /tmp/signedjson-1.1.1/signedjson/types.py dist/signedjson-1.1.1/signedjson/types.py --- /tmp/signedjson-1.1.1/signedjson/types.py 2020-01-29 17:17:34.000000000 +0000 +++ dist/signedjson-1.1.1/signedjson/types.py 2022-01-21 17:35:40.074041100 +0000 @@ -13,8 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys +from typing import TYPE_CHECKING + import nacl.signing -from typing_extensions import Protocol + +if TYPE_CHECKING or sys.version_info < (3, 8, 0): + from typing_extensions import Protocol +else: + from typing import Protocol class BaseKey(Protocol): Only in /tmp/signedjson-1.1.1/: signedjson.egg-info diff -ru /tmp/signedjson-1.1.1/tests/test_key.py dist/signedjson-1.1.1/tests/test_key.py --- /tmp/signedjson-1.1.1/tests/test_key.py 2020-03-27 16:13:12.000000000 +0000 +++ dist/signedjson-1.1.1/tests/test_key.py 2022-01-21 17:35:40.074041100 +0000 @@ -19,8 +19,8 @@ def test_generate_key(self): my_version = "my_version" my_key = generate_signing_key(my_version) - self.assertEquals(my_key.alg, "ed25519") - self.assertEquals(my_key.version, my_version) + self.assertEqual(my_key.alg, 'ed25519') + self.assertEqual(my_key.version, my_version) class DecodeTestCase(unittest.TestCase): @@ -35,8 +35,8 @@ decoded_key = decode_signing_key_base64( "ed25519", self.version, self.key_base64 ) - self.assertEquals(decoded_key.alg, "ed25519") - self.assertEquals(decoded_key.version, self.version) + self.assertEqual(decoded_key.alg, 'ed25519') + self.assertEqual(decoded_key.version, self.version) def test_decode_invalid_base64(self): with self.assertRaises(Exception): @@ -54,8 +54,8 @@ decoded_key = decode_verify_key_base64( "ed25519", self.version, self.verify_key_base64 ) - self.assertEquals(decoded_key.alg, "ed25519") - self.assertEquals(decoded_key.version, self.version) + self.assertEqual(decoded_key.alg, 'ed25519') + self.assertEqual(decoded_key.version, self.version) def test_decode_verify_key_invalid_base64(self): with self.assertRaises(Exception): @@ -72,12 +72,12 @@ def test_read_keys(self): stream = ["ed25519 %s %s" % (self.version, self.key_base64)] keys = read_signing_keys(stream) - self.assertEquals(len(keys), 1) + self.assertEqual(len(keys), 1) def test_read_old_keys(self): stream = ["ed25519 %s 0 %s" % (self.version, self.verify_key_base64)] keys = read_old_signing_keys(stream) - self.assertEquals(len(keys), 1) + self.assertEqual(len(keys), 1) def test_decode_verify_invalid_algorithm(self): with self.assertRaises(Exception): diff -ru /tmp/signedjson-1.1.1/tests/test_known_key.py dist/signedjson-1.1.1/tests/test_known_key.py --- /tmp/signedjson-1.1.1/tests/test_known_key.py 2020-01-03 10:01:04.000000000 +0000 +++ dist/signedjson-1.1.1/tests/test_known_key.py 2022-01-21 17:35:40.074041100 +0000 @@ -41,7 +41,7 @@ self.signing_key.version = KEY_VER def test_sign_minimal(self): - self.assertEquals( + self.assertEqual( sign_json({}, "domain", self.signing_key), { 'signatures': { @@ -54,7 +54,7 @@ ) def test_sign_with_data(self): - self.assertEquals( + self.assertEqual( sign_json({'one': 1, 'two': "Two"}, "domain", self.signing_key), { 'one': 1, Only in /tmp/signedjson-1.1.1/: .travis.yml