Skip to content

Commit 1d73744

Browse files
authored
Merge pull request #84 from getyoti/development
Release 2.8.1
2 parents b9c7a8b + dee3c05 commit 1d73744

File tree

85 files changed

+3750
-1829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3750
-1829
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ htmlcov/
4141
.coverage.*
4242
.cache
4343
nosetests.xml
44-
coverage.xml
44+
coverage.*
4545
*,cover
4646
.hypothesis/
4747

@@ -102,3 +102,5 @@ examples/yoti_example_flask/static/YotiSelfie.jpg
102102
#.pem files for examples
103103
examples/yoti_example_django/*.pem
104104
examples/yoti_example_flask/*.pem
105+
106+
.scannerwork

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- repo: https://github.com/ambv/black
2+
rev: stable
3+
hooks:
4+
- id: black
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v1.2.3
7+
hooks:
8+
- id: flake8
9+
args:
10+
- --ignore=E501,W5

examples/aml/app.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
from yoti_python_sdk import Client
88
from yoti_python_sdk import aml
99

10-
dotenv_path = join(dirname(__file__), '.env')
10+
dotenv_path = join(dirname(__file__), ".env")
1111
load_dotenv(dotenv_path)
1212

13-
YOTI_CLIENT_SDK_ID = environ.get('YOTI_CLIENT_SDK_ID')
14-
YOTI_KEY_FILE_PATH = environ.get('YOTI_KEY_FILE_PATH')
13+
YOTI_CLIENT_SDK_ID = environ.get("YOTI_CLIENT_SDK_ID")
14+
YOTI_KEY_FILE_PATH = environ.get("YOTI_KEY_FILE_PATH")
1515

1616

1717
# The following exits cleanly on Ctrl-C,
@@ -25,11 +25,7 @@ def cli_exception(exception_type, value, tb):
2525
family_name = "Heath"
2626

2727
aml_address = aml.AmlAddress(country="GBR")
28-
aml_profile = aml.AmlProfile(
29-
given_names,
30-
family_name,
31-
aml_address
32-
)
28+
aml_profile = aml.AmlProfile(given_names, family_name, aml_address)
3329

3430
if sys.stdin.isatty():
3531
sys.excepthook = cli_exception

examples/aml/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
yoti>=2.7.0
1+
yoti>=2.8.0
22
python-dotenv>=0.7.1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from os import environ
22

3-
YOTI_SCENARIO_ID = environ.get('YOTI_SCENARIO_ID')
4-
YOTI_CLIENT_SDK_ID = environ.get('YOTI_CLIENT_SDK_ID')
5-
YOTI_KEY_FILE_PATH = environ.get('YOTI_KEY_FILE_PATH')
3+
YOTI_SCENARIO_ID = environ.get("YOTI_SCENARIO_ID")
4+
YOTI_CLIENT_SDK_ID = environ.get("YOTI_CLIENT_SDK_ID")
5+
YOTI_KEY_FILE_PATH = environ.get("YOTI_KEY_FILE_PATH")

examples/yoti_example_django/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ django-sslserver>=0.2.0
44
python-dotenv>=0.7.1
55
requests>=2.20.0
66
urllib3>=1.24.2
7-
yoti>=2.7.0
7+
yoti>=2.8.0

examples/yoti_example_django/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ requests==2.21.0
2323
six==1.11.0 # via cryptography, protobuf, pyopenssl
2424
sqlparse==0.3.0 # via django
2525
urllib3==1.24.2
26-
yoti==2.7.0
26+
yoti==2.8.0
27+
28+
# The following packages are considered to be unsafe in a requirements file:
29+
# setuptools==41.1.0 # via django-sslserver, protobuf

examples/yoti_example_django/yoti_example/settings.py

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
2222

2323
# SECURITY WARNING: keep the secret key used in production secret!
24-
SECRET_KEY = 'p3dh1cx&ey8oesy-nj_md-ouo75xi548m22j^zrv((d1@k%%3!'
24+
SECRET_KEY = "p3dh1cx&ey8oesy-nj_md-ouo75xi548m22j^zrv((d1@k%%3!"
2525

2626
# SECURITY WARNING: don't run with debug turned on in production!
2727
DEBUG = True
@@ -31,52 +31,52 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34-
'django.contrib.admin',
35-
'django.contrib.auth',
36-
'django.contrib.contenttypes',
37-
'django.contrib.sessions',
38-
'django.contrib.messages',
39-
'django.contrib.staticfiles',
40-
'sslserver'
34+
"django.contrib.admin",
35+
"django.contrib.auth",
36+
"django.contrib.contenttypes",
37+
"django.contrib.sessions",
38+
"django.contrib.messages",
39+
"django.contrib.staticfiles",
40+
"sslserver",
4141
]
4242

4343
MIDDLEWARE = [
44-
'django.middleware.security.SecurityMiddleware',
45-
'django.contrib.sessions.middleware.SessionMiddleware',
46-
'django.middleware.common.CommonMiddleware',
47-
'django.middleware.csrf.CsrfViewMiddleware',
48-
'django.contrib.auth.middleware.AuthenticationMiddleware',
49-
'django.contrib.messages.middleware.MessageMiddleware',
50-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
44+
"django.middleware.security.SecurityMiddleware",
45+
"django.contrib.sessions.middleware.SessionMiddleware",
46+
"django.middleware.common.CommonMiddleware",
47+
"django.middleware.csrf.CsrfViewMiddleware",
48+
"django.contrib.auth.middleware.AuthenticationMiddleware",
49+
"django.contrib.messages.middleware.MessageMiddleware",
50+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
5151
]
5252

53-
ROOT_URLCONF = 'yoti_example.urls'
53+
ROOT_URLCONF = "yoti_example.urls"
5454

5555
TEMPLATES = [
5656
{
57-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
58-
'DIRS': [join(BASE_DIR, 'yoti_example/templates')],
59-
'APP_DIRS': True,
60-
'OPTIONS': {
61-
'context_processors': [
62-
'django.template.context_processors.debug',
63-
'django.template.context_processors.request',
64-
'django.contrib.auth.context_processors.auth',
65-
'django.contrib.messages.context_processors.messages',
66-
],
57+
"BACKEND": "django.template.backends.django.DjangoTemplates",
58+
"DIRS": [join(BASE_DIR, "yoti_example/templates")],
59+
"APP_DIRS": True,
60+
"OPTIONS": {
61+
"context_processors": [
62+
"django.template.context_processors.debug",
63+
"django.template.context_processors.request",
64+
"django.contrib.auth.context_processors.auth",
65+
"django.contrib.messages.context_processors.messages",
66+
]
6767
},
68-
},
68+
}
6969
]
7070

71-
WSGI_APPLICATION = 'yoti_example.wsgi.application'
71+
WSGI_APPLICATION = "yoti_example.wsgi.application"
7272

7373
# Database
7474
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
7575

7676
DATABASES = {
77-
'default': {
78-
'ENGINE': 'django.db.backends.sqlite3',
79-
'NAME': join(BASE_DIR, 'db.sqlite3'),
77+
"default": {
78+
"ENGINE": "django.db.backends.sqlite3",
79+
"NAME": join(BASE_DIR, "db.sqlite3"),
8080
}
8181
}
8282

@@ -85,25 +85,19 @@
8585

8686
AUTH_PASSWORD_VALIDATORS = [
8787
{
88-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
89-
},
90-
{
91-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
92-
},
93-
{
94-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
95-
},
96-
{
97-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
88+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
9889
},
90+
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
91+
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
92+
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
9993
]
10094

10195
# Internationalization
10296
# https://docs.djangoproject.com/en/1.10/topics/i18n/
10397

104-
LANGUAGE_CODE = 'en-us'
98+
LANGUAGE_CODE = "en-us"
10599

106-
TIME_ZONE = 'UTC'
100+
TIME_ZONE = "UTC"
107101

108102
USE_I18N = True
109103

@@ -114,8 +108,8 @@
114108
# Static files (CSS, JavaScript, Images)
115109
# https://docs.djangoproject.com/en/1.10/howto/static-files/
116110

117-
STATIC_URL = '/static/'
118-
STATICFILES_FOLDER_NAME = 'static'
119-
PROJECT_DIR = 'yoti_example/'
111+
STATIC_URL = "/static/"
112+
STATICFILES_FOLDER_NAME = "static"
113+
PROJECT_DIR = "yoti_example/"
120114
STATIC_ROOT = os.path.join(BASE_DIR, STATICFILES_FOLDER_NAME)
121-
STATICFILES_DIRS = os.path.join(PROJECT_DIR, STATICFILES_FOLDER_NAME),
115+
STATICFILES_DIRS = (os.path.join(PROJECT_DIR, STATICFILES_FOLDER_NAME),)

examples/yoti_example_django/yoti_example/templates/attribute_snippet.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
{% for image in prop.value %}
1414
<img src="{image.value.base64_content() }" />
1515
{% endfor %}
16+
{% elif prop.name == "document_details" %}
17+
<table>
18+
<tr><td>Type</td><td>{{ prop.value.document_type }}</td></tr>
19+
<tr><td>Issuing Country</td><td>{{ prop.value.issuing_country }}</td></tr>
20+
<tr><td>Document Number</td><td>{{ prop.value.document_number }}</td></tr>
21+
{% if prop.value.expiration_date %}
22+
<tr><td>Expiration Date</td><td>{{ prop.value.expiration_date }}</td></tr>
23+
{% endif %}
24+
{% if prop.value.issuing_authority %}
25+
<tr><td>Issuing Authority</td><td>{{ prop.value.issuing_authority }}</td></tr>
26+
{% endif %}
27+
</table>
1628
{% elif prop.name == "structured_postal_address" %}
1729
<table>
1830
{% for key, value in prop.value.items %}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!DOCTYPE html>
2+
<html class="yoti-html">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6+
<title>Dynamic Share example</title>
7+
<link rel="stylesheet" type="text/css" href="/static/index.css" />
8+
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" />
9+
</head>
10+
11+
<body class="yoti-body">
12+
<main>
13+
<section class="yoti-top-section">
14+
<div class="yoti-logo-section">
15+
<img
16+
class="yoti-logo-image"
17+
src="/static/assets/logo.png"
18+
srcset="/static/assets/[email protected] 2x"
19+
alt="Yoti"/>
20+
</div>
21+
22+
<h1 class="yoti-top-header">We now accept Yoti</h1>
23+
24+
<div class="yoti-sdk-integration-section">
25+
<div id="yoti-share-button"></div>
26+
</div>
27+
28+
<div class="yoti-login-or-separator">or</div>
29+
30+
<div class="yoti-login-dialog">
31+
<h2 class="yoti-login-dialog-header">Login with your email:</h2>
32+
33+
<input class="yoti-input" type="text" placeholder="Name"/>
34+
35+
<input class="yoti-input" type="text" placeholder="Email address"/>
36+
37+
<div class="yoti-login-actions">
38+
<span class="yoti-login-forgot-button">forgot password?</span>
39+
40+
<button class="yoti-login-button">login</button>
41+
</div>
42+
</div>
43+
</section>
44+
45+
<section class="yoti-sponsor-app-section">
46+
<h3 class="yoti-sponsor-app-header">The Yoti app is free to download and use:</h3>
47+
48+
<div class="yoti-store-buttons-section">
49+
<a href="https://itunes.apple.com/us/app/yoti/id983980808?ls=1&mt=8" class="yoti-app-button-link">
50+
<img
51+
src="/static/assets/app-store-badge.png"
52+
srcset="/static/assets/[email protected] 2x"
53+
alt="Download on the App Store"/>
54+
</a>
55+
56+
<a href="https://play.google.com/store/apps/details?id=com.yoti.mobile.android.live" class="yoti-app-button-link">
57+
<img
58+
src="/static/assets/google-play-badge.png"
59+
srcset="/static/assets/[email protected] 2x"
60+
alt="get it on Google Play"/>
61+
</a>
62+
</div>
63+
</section>
64+
</main>
65+
<script src="https://www.yoti.com/share/client/"></script>
66+
<script>
67+
window.Yoti.Share.init({
68+
"elements": [{
69+
"domId": "yoti-share-button",
70+
"clientSdkId": "{{ yoti_client_sdk_id }}",
71+
"shareUrl": "{{ yoti_share_url }}",
72+
"button": {
73+
"label": "Use Yoti"
74+
}
75+
}]
76+
});
77+
</script>
78+
</body>
79+
80+
</html>

0 commit comments

Comments
 (0)