diff --git a/README.md b/README.md index b2d4fa45..22dfb44d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ securely verify users' identities. ## Example ## - from yoti import Client + from yoti_python_sdk import Client @app.route('/callback') def callback(): @@ -14,7 +14,7 @@ securely verify users' identities. return activity_details.user_profile For more details and working [Flask](http://flask.pocoo.org/) and [Django](https://www.djangoproject.com/) -applications see [examples/](https://github.com/lampkicking/yoti-sdk-server-python/tree/development/examples). +applications see [examples/](https://github.com/getyoti/yoti-python-sdk/tree/master/examples). ## The Flow ## @@ -28,7 +28,7 @@ For details see [Yoti Developers Docs](https://www.yoti.com/developers/). ## Installation ## - $ pip install yoti + $ pip install yoti-python-sdk This SDK works with Python 2.6+ and Python 3.3+ . diff --git a/plugins/django_yoti/django_yoti/tests/test_views.py b/plugins/django_yoti/django_yoti/tests/test_views.py index 2f824c01..31df774d 100644 --- a/plugins/django_yoti/django_yoti/tests/test_views.py +++ b/plugins/django_yoti/django_yoti/tests/test_views.py @@ -1,7 +1,7 @@ from django.test import TestCase, Client, RequestFactory from django.http.response import HttpResponse, HttpResponseRedirectBase from django.contrib.sessions.middleware import SessionMiddleware -from yoti.activity_details import ActivityDetails +from yoti_python_sdk.activity_details import ActivityDetails from ..views import profile diff --git a/plugins/django_yoti/django_yoti/views.py b/plugins/django_yoti/django_yoti/views.py index 3a48c302..a8e3df5c 100644 --- a/plugins/django_yoti/django_yoti/views.py +++ b/plugins/django_yoti/django_yoti/views.py @@ -1,4 +1,4 @@ -from yoti import Client +from yoti_python_sdk import Client from django.shortcuts import render, redirect from django.urls import reverse diff --git a/plugins/django_yoti/requirements.txt b/plugins/django_yoti/requirements.txt index 08f11044..1100721c 100644 --- a/plugins/django_yoti/requirements.txt +++ b/plugins/django_yoti/requirements.txt @@ -1,2 +1,2 @@ -yoti>=0.1.0 +yoti-python-sdk>=0.1.0 Django>=1.8 diff --git a/plugins/django_yoti/setup.py b/plugins/django_yoti/setup.py index eb51b971..1113da36 100644 --- a/plugins/django_yoti/setup.py +++ b/plugins/django_yoti/setup.py @@ -15,7 +15,7 @@ url='https://github.com/lampkicking/yoti-sdk-server-python/plugins/django_yoti', author='', author_email='', - install_requires=['django>=1.8', 'yoti>=0.1.0'], + install_requires=['django>=1.8', 'yoti-python-sdk>=0.1.0'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', diff --git a/plugins/flask_yoti/flask_yoti/flask_yoti.py b/plugins/flask_yoti/flask_yoti/flask_yoti.py index fc53110d..97fca999 100644 --- a/plugins/flask_yoti/flask_yoti/flask_yoti.py +++ b/plugins/flask_yoti/flask_yoti/flask_yoti.py @@ -8,7 +8,7 @@ redirect, url_for, ) -from yoti import Client +from yoti_python_sdk import Client from .context_storage import activity_details_storage from .decorators import yoti_authenticated diff --git a/plugins/flask_yoti/flask_yoti/tests/conftest.py b/plugins/flask_yoti/flask_yoti/tests/conftest.py index a183fcf0..83b1ff82 100644 --- a/plugins/flask_yoti/flask_yoti/tests/conftest.py +++ b/plugins/flask_yoti/flask_yoti/tests/conftest.py @@ -5,7 +5,7 @@ from flask_yoti import flask_yoti_blueprint from flask_yoti.context_processors import yoti_context -from yoti.activity_details import ActivityDetails +from yoti_python_sdk.activity_details import ActivityDetails @pytest.fixture(scope='module') diff --git a/plugins/flask_yoti/requirements.txt b/plugins/flask_yoti/requirements.txt index 9fcfe57f..af201d62 100644 --- a/plugins/flask_yoti/requirements.txt +++ b/plugins/flask_yoti/requirements.txt @@ -1,2 +1,2 @@ Flask>=0.10 -yoti>=0.1.0 +yoti-python-sdk>=0.1.0 diff --git a/plugins/flask_yoti/setup.py b/plugins/flask_yoti/setup.py index cbc36b00..335b65d5 100644 --- a/plugins/flask_yoti/setup.py +++ b/plugins/flask_yoti/setup.py @@ -14,7 +14,7 @@ url='https://github.com/lampkicking/yoti-sdk-server-python/plugins/flask_yoti', author='', author_email='', - install_requires=['flask>=0.10', 'yoti>=0.1.0'], + install_requires=['flask>=0.10', 'yoti-python-sdk>=0.1.0'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', diff --git a/pytest.ini b/pytest.ini index f1d6c79c..7cf4cee5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -testpaths = yoti/tests +testpaths = yoti_python_sdk/tests norecursedirs = venv diff --git a/pytest_integration.ini b/pytest_integration.ini index dff9bbc9..6e1eae16 100644 --- a/pytest_integration.ini +++ b/pytest_integration.ini @@ -1,3 +1,3 @@ [pytest] -testpaths = yoti/tests/integration +testpaths = yoti_python_sdk/tests/integration python_functions = live_test_* diff --git a/setup.cfg b/setup.cfg index b88034e4..6fedc193 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ [metadata] description-file = README.md + +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py index ba8bc1ff..5e90adf8 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'application in a secure and trusted way.' setup( - name='yoti', + name='yoti-python-sdk', version=VERSION, packages=find_packages(), license='OTHER', diff --git a/yoti/__init__.py b/yoti_python_sdk/__init__.py similarity index 92% rename from yoti/__init__.py rename to yoti_python_sdk/__init__.py index 1140b65a..8c568637 100644 --- a/yoti/__init__.py +++ b/yoti_python_sdk/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from os import environ -from yoti.client import Client +from yoti_python_sdk.client import Client DEFAULTS = { 'YOTI_API_URL': 'https://api.yoti.com', diff --git a/yoti/activity_details.py b/yoti_python_sdk/activity_details.py similarity index 92% rename from yoti/activity_details.py rename to yoti_python_sdk/activity_details.py index cd4f9932..23160b64 100644 --- a/yoti/activity_details.py +++ b/yoti_python_sdk/activity_details.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from yoti.protobuf.v1.protobuf import Protobuf +from yoti_python_sdk.protobuf.v1.protobuf import Protobuf class ActivityDetails: diff --git a/yoti/client.py b/yoti_python_sdk/client.py similarity index 93% rename from yoti/client.py rename to yoti_python_sdk/client.py index 5f0f1590..84fd69c7 100644 --- a/yoti/client.py +++ b/yoti_python_sdk/client.py @@ -10,10 +10,10 @@ import requests from past.builtins import basestring -import yoti -from yoti.activity_details import ActivityDetails -from yoti.crypto import Crypto -from yoti.protobuf.v1 import protobuf +import yoti_python_sdk +from yoti_python_sdk.activity_details import ActivityDetails +from yoti_python_sdk.crypto import Crypto +from yoti_python_sdk.protobuf.v1 import protobuf NO_KEY_FILE_SPECIFIED_ERROR = 'Please specify the correct private key file ' \ @@ -68,7 +68,7 @@ def get_activity_details(self, encrypted_request_token): def __make_request(self, encrypted_request_token): path = self.__get_request_path(encrypted_request_token) - url = yoti.YOTI_API_ENDPOINT + path + url = yoti_python_sdk.YOTI_API_ENDPOINT + path headers = self.__get_request_headers(path) response = requests.get(url=url, headers=headers) diff --git a/yoti/crypto.py b/yoti_python_sdk/crypto.py similarity index 100% rename from yoti/crypto.py rename to yoti_python_sdk/crypto.py diff --git a/yoti/protobuf/__init__.py b/yoti_python_sdk/protobuf/__init__.py similarity index 100% rename from yoti/protobuf/__init__.py rename to yoti_python_sdk/protobuf/__init__.py diff --git a/yoti/protobuf/v1/__init__.py b/yoti_python_sdk/protobuf/v1/__init__.py similarity index 100% rename from yoti/protobuf/v1/__init__.py rename to yoti_python_sdk/protobuf/v1/__init__.py diff --git a/yoti/protobuf/v1/attribute_public_api/__init__.py b/yoti_python_sdk/protobuf/v1/attribute_public_api/__init__.py similarity index 100% rename from yoti/protobuf/v1/attribute_public_api/__init__.py rename to yoti_python_sdk/protobuf/v1/attribute_public_api/__init__.py diff --git a/yoti/protobuf/v1/attribute_public_api/attribute_pb2.py b/yoti_python_sdk/protobuf/v1/attribute_public_api/attribute_pb2.py similarity index 100% rename from yoti/protobuf/v1/attribute_public_api/attribute_pb2.py rename to yoti_python_sdk/protobuf/v1/attribute_public_api/attribute_pb2.py diff --git a/yoti/protobuf/v1/attribute_public_api/list_pb2.py b/yoti_python_sdk/protobuf/v1/attribute_public_api/list_pb2.py similarity index 98% rename from yoti/protobuf/v1/attribute_public_api/list_pb2.py rename to yoti_python_sdk/protobuf/v1/attribute_public_api/list_pb2.py index cdc7fcac..e0ab48de 100644 --- a/yoti/protobuf/v1/attribute_public_api/list_pb2.py +++ b/yoti_python_sdk/protobuf/v1/attribute_public_api/list_pb2.py @@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default() -from yoti.protobuf.v1.attribute_public_api import attribute_pb2 +from yoti_python_sdk.protobuf.v1.attribute_public_api import attribute_pb2 DESCRIPTOR = _descriptor.FileDescriptor( diff --git a/yoti/protobuf/v1/attribute_public_api/signing_pb2.py b/yoti_python_sdk/protobuf/v1/attribute_public_api/signing_pb2.py similarity index 98% rename from yoti/protobuf/v1/attribute_public_api/signing_pb2.py rename to yoti_python_sdk/protobuf/v1/attribute_public_api/signing_pb2.py index 1d117542..2ce5b150 100644 --- a/yoti/protobuf/v1/attribute_public_api/signing_pb2.py +++ b/yoti_python_sdk/protobuf/v1/attribute_public_api/signing_pb2.py @@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default() -from yoti.protobuf.v1.attribute_public_api import attribute_pb2 +from yoti_python_sdk.protobuf.v1.attribute_public_api import attribute_pb2 DESCRIPTOR = _descriptor.FileDescriptor( diff --git a/yoti/protobuf/v1/common_public_api/__init__.py b/yoti_python_sdk/protobuf/v1/common_public_api/__init__.py similarity index 100% rename from yoti/protobuf/v1/common_public_api/__init__.py rename to yoti_python_sdk/protobuf/v1/common_public_api/__init__.py diff --git a/yoti/protobuf/v1/common_public_api/encrypted_data_pb2.py b/yoti_python_sdk/protobuf/v1/common_public_api/encrypted_data_pb2.py similarity index 100% rename from yoti/protobuf/v1/common_public_api/encrypted_data_pb2.py rename to yoti_python_sdk/protobuf/v1/common_public_api/encrypted_data_pb2.py diff --git a/yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/attribute.proto b/yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/attribute.proto similarity index 100% rename from yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/attribute.proto rename to yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/attribute.proto diff --git a/yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/list.proto b/yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/list.proto similarity index 100% rename from yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/list.proto rename to yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/list.proto diff --git a/yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/signing.proto b/yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/signing.proto similarity index 100% rename from yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/signing.proto rename to yoti_python_sdk/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/signing.proto diff --git a/yoti/protobuf/v1/definitions/common-public-api/compubapi_v1/encrypted_data.proto b/yoti_python_sdk/protobuf/v1/definitions/common-public-api/compubapi_v1/encrypted_data.proto similarity index 100% rename from yoti/protobuf/v1/definitions/common-public-api/compubapi_v1/encrypted_data.proto rename to yoti_python_sdk/protobuf/v1/definitions/common-public-api/compubapi_v1/encrypted_data.proto diff --git a/yoti/protobuf/v1/protobuf.py b/yoti_python_sdk/protobuf/v1/protobuf.py similarity index 91% rename from yoti/protobuf/v1/protobuf.py rename to yoti_python_sdk/protobuf/v1/protobuf.py index 8a21ccce..a952f631 100644 --- a/yoti/protobuf/v1/protobuf.py +++ b/yoti_python_sdk/protobuf/v1/protobuf.py @@ -3,8 +3,8 @@ from cryptography.fernet import base64 -import yoti.protobuf.v1.attribute_public_api.list_pb2 as attrpubapi -import yoti.protobuf.v1.common_public_api.encrypted_data_pb2 as compubapi +import yoti_python_sdk.protobuf.v1.attribute_public_api.list_pb2 as attrpubapi +import yoti_python_sdk.protobuf.v1.common_public_api.encrypted_data_pb2 as compubapi class Protobuf(object): diff --git a/yoti/tests/__init__.py b/yoti_python_sdk/tests/__init__.py similarity index 100% rename from yoti/tests/__init__.py rename to yoti_python_sdk/tests/__init__.py diff --git a/yoti/tests/conftest.py b/yoti_python_sdk/tests/conftest.py similarity index 94% rename from yoti/tests/conftest.py rename to yoti_python_sdk/tests/conftest.py index d67c7121..0429c9f0 100644 --- a/yoti/tests/conftest.py +++ b/yoti_python_sdk/tests/conftest.py @@ -3,8 +3,8 @@ import pytest -from yoti import Client -from yoti.crypto import Crypto +from yoti_python_sdk import Client +from yoti_python_sdk.crypto import Crypto FIXTURES_DIR = join(dirname(abspath(__file__)), 'fixtures') PEM_FILE_PATH = join(FIXTURES_DIR, 'sdk-test.pem') diff --git a/yoti/tests/fixtures/auth_digest.txt b/yoti_python_sdk/tests/fixtures/auth_digest.txt similarity index 100% rename from yoti/tests/fixtures/auth_digest.txt rename to yoti_python_sdk/tests/fixtures/auth_digest.txt diff --git a/yoti/tests/fixtures/auth_key.txt b/yoti_python_sdk/tests/fixtures/auth_key.txt similarity index 100% rename from yoti/tests/fixtures/auth_key.txt rename to yoti_python_sdk/tests/fixtures/auth_key.txt diff --git a/yoti/tests/fixtures/encrypted_yoti_token.txt b/yoti_python_sdk/tests/fixtures/encrypted_yoti_token.txt similarity index 100% rename from yoti/tests/fixtures/encrypted_yoti_token.txt rename to yoti_python_sdk/tests/fixtures/encrypted_yoti_token.txt diff --git a/yoti/tests/fixtures/response.txt b/yoti_python_sdk/tests/fixtures/response.txt similarity index 100% rename from yoti/tests/fixtures/response.txt rename to yoti_python_sdk/tests/fixtures/response.txt diff --git a/yoti/tests/fixtures/sdk-test.pem b/yoti_python_sdk/tests/fixtures/sdk-test.pem similarity index 100% rename from yoti/tests/fixtures/sdk-test.pem rename to yoti_python_sdk/tests/fixtures/sdk-test.pem diff --git a/yoti/tests/integration/__init__.py b/yoti_python_sdk/tests/integration/__init__.py similarity index 100% rename from yoti/tests/integration/__init__.py rename to yoti_python_sdk/tests/integration/__init__.py diff --git a/yoti/tests/integration/test_client.py b/yoti_python_sdk/tests/integration/test_client.py similarity index 88% rename from yoti/tests/integration/test_client.py rename to yoti_python_sdk/tests/integration/test_client.py index 9e225fa0..6bec15e4 100644 --- a/yoti/tests/integration/test_client.py +++ b/yoti_python_sdk/tests/integration/test_client.py @@ -1,6 +1,6 @@ from past.builtins import basestring -from yoti.activity_details import ActivityDetails +from yoti_python_sdk.activity_details import ActivityDetails def live_test_requesting_activity_details_with_correct_data( diff --git a/yoti/tests/mocks.py b/yoti_python_sdk/tests/mocks.py similarity index 85% rename from yoti/tests/mocks.py rename to yoti_python_sdk/tests/mocks.py index 2009bf76..3e495b38 100644 --- a/yoti/tests/mocks.py +++ b/yoti_python_sdk/tests/mocks.py @@ -7,7 +7,7 @@ def __init__(self, status_code, text): self.status_code = status_code self.text = text - with open('yoti/tests/fixtures/response.txt', 'r') as f: + with open('yoti_python_sdk/tests/fixtures/response.txt', 'r') as f: response = f.read() return MockResponse(status_code=200, text=response) diff --git a/yoti/tests/test_client.py b/yoti_python_sdk/tests/test_client.py similarity index 91% rename from yoti/tests/test_client.py rename to yoti_python_sdk/tests/test_client.py index 8f6816fb..e97d3f7d 100644 --- a/yoti/tests/test_client.py +++ b/yoti_python_sdk/tests/test_client.py @@ -11,12 +11,12 @@ except ImportError: import mock -from yoti import YOTI_API_ENDPOINT -from yoti import Client -from yoti.client import NO_KEY_FILE_SPECIFIED_ERROR -from yoti.activity_details import ActivityDetails -from yoti.tests.conftest import YOTI_CLIENT_SDK_ID, PEM_FILE_PATH -from yoti.tests.mocks import ( +from yoti_python_sdk import YOTI_API_ENDPOINT +from yoti_python_sdk import Client +from yoti_python_sdk.client import NO_KEY_FILE_SPECIFIED_ERROR +from yoti_python_sdk.activity_details import ActivityDetails +from yoti_python_sdk.tests.conftest import YOTI_CLIENT_SDK_ID, PEM_FILE_PATH +from yoti_python_sdk.tests.mocks import ( mocked_requests_get, mocked_timestamp, mocked_uuid4 diff --git a/yoti/tests/test_crypto.py b/yoti_python_sdk/tests/test_crypto.py similarity index 95% rename from yoti/tests/test_crypto.py rename to yoti_python_sdk/tests/test_crypto.py index 1458a521..41bd47ad 100644 --- a/yoti/tests/test_crypto.py +++ b/yoti_python_sdk/tests/test_crypto.py @@ -3,7 +3,7 @@ import pytest -from yoti.crypto import Crypto +from yoti_python_sdk.crypto import Crypto @pytest.mark.parametrize('invalid_token', [ diff --git a/yoti/tests/test_protobuf.py b/yoti_python_sdk/tests/test_protobuf.py similarity index 94% rename from yoti/tests/test_protobuf.py rename to yoti_python_sdk/tests/test_protobuf.py index ddfce51a..e90c8579 100644 --- a/yoti/tests/test_protobuf.py +++ b/yoti_python_sdk/tests/test_protobuf.py @@ -2,7 +2,7 @@ import pytest from past.builtins import basestring -from yoti.protobuf.v1 import protobuf +from yoti_python_sdk.protobuf.v1 import protobuf @pytest.fixture(scope='module')