Skip to content

Commit e88d571

Browse files
author
Vasile Zaremba
committed
Remove verification key
1 parent ffb407d commit e88d571

File tree

23 files changed

+49
-132
lines changed

23 files changed

+49
-132
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ The following env variables are then required for the SDK to work:
4545
The following env variables are additionally used to configure your backend:
4646

4747
* `YOTI_APPLICATION_ID` - found on the Integrations settings page, used to configure the [Yoti Login Button](https://www.yoti.com/developers/#login-button-setup)
48-
* `YOTI_VERIFICATION_KEY` - found on the Integrations settings page -> Callback URL -> VERIFY, used to verify your back-end callback
4948

5049
## Examples ##
5150

@@ -90,7 +89,7 @@ One tool to do just this is [pyenv](https://github.com/yyuu/pyenv)
9089
1. In order to execute integration tests run: `tox pytest_integration.ini`
9190

9291
You can choose a subset of interpreters to test with by running `tox -e <testenv_version>`.
93-
For a list of `<testenv_versions>` see `tox.ini`. Example: `tox -e py26` would run the
92+
For a list of `<testenv_versions>` see `tox.ini`. Example: `tox -e py26` would run the
9493
test suite on Python 2.6 (2.6.9 in our case, as installed with `pyenv`).
9594

9695
To install all the Python versions this SDK has been tested against run:
@@ -114,11 +113,11 @@ will have to be compiled. This will be done automatically, however you may
114113
need to install development headers of `openssl`.
115114

116115
##### On Debian-based systems #####
117-
116+
118117
Install `openssl` headers with `apt-get install openssl-dev`
119118

120119
##### On macOS #####
121-
120+
122121
Install `openssl` headers using [homebrew](http://brew.sh/): `brew install openssl`
123122

124123
Install xcode command line tools so we have access to a C compiler and common libs:

examples/yoti_example_django/yoti_example/app_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
YOTI_APPLICATION_ID = environ.get('YOTI_APPLICATION_ID')
44
YOTI_CLIENT_SDK_ID = environ.get('YOTI_CLIENT_SDK_ID')
55
YOTI_FULL_KEY_FILE_PATH = environ.get('YOTI_KEY_FILE_PATH')
6-
YOTI_VERIFICATION_KEY = environ.get('YOTI_VERIFICATION_KEY')

examples/yoti_example_django/yoti_example/templates/profile.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<meta name="yoti-site-verification" content="{{ verification_key }}">
65
<title>PROFILE</title>
76
</head>
87
<body>

examples/yoti_example_django/yoti_example/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from .app_settings import (
66
YOTI_APPLICATION_ID,
7-
YOTI_VERIFICATION_KEY,
87
YOTI_CLIENT_SDK_ID,
98
YOTI_FULL_KEY_FILE_PATH
109
)
@@ -24,5 +23,4 @@ def get(self, request, *args, **kwargs):
2423
client = Client(YOTI_CLIENT_SDK_ID, YOTI_FULL_KEY_FILE_PATH)
2524
activity_details = client.get_activity_details(request.GET['token'])
2625
context = activity_details.user_profile
27-
context.update({'verification_key': YOTI_VERIFICATION_KEY})
2826
return self.render_to_response(context)

examples/yoti_example_flask/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
YOTI_APPLICATION_ID,
77
YOTI_CLIENT_SDK_ID,
88
YOTI_FULL_KEY_FILE_PATH,
9-
YOTI_VERIFICATION_KEY
109
)
1110

1211
app = Flask(__name__)
@@ -23,7 +22,6 @@ def auth():
2322
activity_details = client.get_activity_details(request.args['token'])
2423
user_profile = activity_details.user_profile
2524
return render_template('profile.html',
26-
verification_key=YOTI_VERIFICATION_KEY,
2725
**user_profile)
2826

2927

examples/yoti_example_flask/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
YOTI_APPLICATION_ID = environ.get('YOTI_APPLICATION_ID')
44
YOTI_CLIENT_SDK_ID = environ.get('YOTI_CLIENT_SDK_ID')
55
YOTI_FULL_KEY_FILE_PATH = environ.get('YOTI_KEY_FILE_PATH')
6-
YOTI_VERIFICATION_KEY = environ.get('YOTI_VERIFICATION_KEY')

examples/yoti_example_flask/templates/profile.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<meta name="yoti-site-verification" content="{{ verification_key }}">
65
<title>PROFILE</title>
76
</head>
87
<body>

plugins/django_yoti/README.md

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,29 @@ Description
88
* First you need to add `django_yoti` plugin to your INSTALLED_APPS setting like this:
99
```python
1010
# your_django_project/settings.py
11-
11+
1212
...
13-
13+
1414
INSTALLED_APPS = [
1515
...
1616
'django_yoti',
1717
]
1818
```
1919

2020
* Django Yoti plugin provides the following template context vars:
21-
- `yoti_site_verification`
2221
- `yoti_application_id`
2322
- `yoti_login_button_*`
2423

2524
* If you're using django template backend that supports context processors
26-
like default DTL (Django Template Language) and want to use context tags
27-
inside your template (e.g. `{{ yoti_login_button_*}}`), then you should
28-
include `django_yoti`'s context processors into your templates
25+
like default DTL (Django Template Language) and want to use context tags
26+
inside your template (e.g. `{{ yoti_login_button_*}}`), then you should
27+
include `django_yoti`'s context processors into your templates
2928
configuration like this:
3029
```python
3130
# your_django_project/settings.py
32-
31+
3332
...
34-
33+
3534
TEMPLATES = [
3635
{
3736
...
@@ -47,7 +46,7 @@ TEMPLATES = [
4746
* Otherwise you'll have to pass yoti context to your templates manually:
4847
```python
4948
from django_yoti import yoti_context
50-
49+
5150
def some_view(request):
5251
return render(request, 'index.html', yoti_context)
5352
```
@@ -57,45 +56,38 @@ def some_view(request):
5756

5857
```python
5958
# your_django_project/settings.py
60-
59+
6160
...
62-
61+
6362
YOTI = {
6463
'YOTI_APPLICATION_ID': '...',
6564
'YOTI_CLIENT_SDK_ID': '...',
6665
'YOTI_KEY_FILE_PATH': '...',
67-
'YOTI_VERIFICATION_KEY': '...',
6866
...
6967
}
7068
```
7169
* **`YOTI_APPLICATION_ID`** - **required**, *can be also set by env variable with the same name*<br>
72-
Your Yoti application's ID, found under the `INTEGRATIONS` tab of your
70+
Your Yoti application's ID, found under the `INTEGRATIONS` tab of your
7371
Yoti application's settings page ([Yoti Dashboard](https://www.yoti.com/dashboard/)).<br>
7472
It is used to configure the [Yoti Login Button](https://www.yoti.com/developers/#login-button-setup).<br>
7573
Example: `ca84f68b-1b48-458b-96bf-963868edc8b6`
7674

7775
* **`YOTI_CLIENT_SDK_ID`** - **required**, *can be also set by env variable with the same name*<br>
78-
Your Yoti application's SDK ID, found under the `INTEGRATIONS` tab of your
76+
Your Yoti application's SDK ID, found under the `INTEGRATIONS` tab of your
7977
Yoti application's settings page ([Yoti Dashboard](https://www.yoti.com/dashboard/)).<br>
8078
Example: `39aef70a-89d6-4644-a687-b3e891613da6`
8179

8280
* **`YOTI_KEY_FILE_PATH`** - **required**, *can be also set by env variable with the same name*<br>
83-
The full path to your private key downloaded from your Yoti application's
81+
The full path to your private key downloaded from your Yoti application's
8482
settings page under the `KEYS` tab ([Yoti Dashboard](https://www.yoti.com/dashboard/)).<br>
8583
Example: `/home/user/.ssh/access-security.pem`
8684

87-
* **`YOTI_VERIFICATION_KEY`** - *can be also set by env variable with the same name*<br>
88-
A key, used to verify your callback URL. Can be found under the
89-
`INTEGRATIONS` tab of your Yoti application's settings page (Callback URL -> VERIFY).<br>
90-
Example: `b14886f972d0c717`
91-
92-
9385
### Endpoints configuration ###
9486

9587
`django_yoti` plugin provides some default endpoints:
9688
```python
9789
# django_yoti/urls.py
98-
90+
9991
urlpatterns = [
10092
url(r'^auth/', views.auth, name='yoti_auth'),
10193
url(r'^login/', views.login, name='yoti_login'),
@@ -107,9 +99,9 @@ The last two URLs are examples and can be overridden by the following settings:
10799

108100
```python
109101
# your_django_project/settings.py
110-
102+
111103
...
112-
104+
113105
YOTI = {
114106
...
115107
'YOTI_LOGIN_VIEW': '...',
@@ -118,7 +110,7 @@ YOTI = {
118110
}
119111
```
120112
* **`YOTI_LOGIN_VIEW`**<br>
121-
If *not* authenticated user is trying to access a view with
113+
If *not* authenticated user is trying to access a view with
122114
`@yoti_authenticated` decorator, he/she will be redirected to this view.<br>
123115
Example: `login`<br>
124116
In this case you should have something like this in your project's `urls.py` file:
@@ -146,13 +138,13 @@ Default value: `yoti_profile` (with `/yoti/profile/` URL
146138

147139
<br>
148140

149-
In order to use `django_yoti` plugin in your project, you should include
141+
In order to use `django_yoti` plugin in your project, you should include
150142
the plugin's endpoints in your project's `urls.py` file:
151143
```python
152144
# your_django_project/urls.py
153-
145+
154146
...
155-
147+
156148
urlpatterns = [
157149
...
158150
url(r'^yoti/', include('django_yoti.urls')),
@@ -162,9 +154,7 @@ urlpatterns = [
162154

163155
### Yoti application configuration ###
164156

165-
Your Yoti application's callback URL should point to `your_site.com/yoti/auth`.<br>
166-
If you want to add a verification tag into any page (other than `/yoti/auth/`),
167-
you can use a `{{ yoti_site_verification }}` tag inside 'head' tag of that page.
157+
Your Yoti application's callback URL should point to `your_site.com/yoti/auth`.
168158

169159
## Using plugin ##
170160

@@ -179,7 +169,7 @@ you can use a `{{ yoti_site_verification }}` tag inside 'head' tag of that page.
179169

180170
By clicking this button, user will be redirected to the Yoti Authentication page.
181171

182-
*Remember to add an appropriate script to your page with login
172+
*Remember to add an appropriate script to your page with login
183173
button in order for it to work. See: [Yoti Developers Documentation](https://www.yoti.com/developers/#login-button-setup)*
184174

185175
2. After successful authentication, user will be redirected to a view,
@@ -189,7 +179,7 @@ you should use a `@yoti_authenticated` decorator.
189179
Example:
190180
```python
191181
from django_yoti import yoti_authenticated
192-
182+
193183
@yoti_authenticated
194184
def profile_view(request):
195185
user_id = request.yoti_user_id
@@ -214,7 +204,7 @@ urlpatterns = [
214204
]
215205
```
216206

217-
4. All *not authenticated* users trying to access endpoint with this decorator,
207+
4. All *not authenticated* users trying to access endpoint with this decorator,
218208
will be redirected to an endpoint, provided by the `YOTI_LOGIN_VIEW` setting.
219209

220210
## Tests ##
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from django.utils.html import format_html
22

33
from .login_button import get_login_button_html
4-
from .settings import YOTI_VERIFICATION_KEY, YOTI_APPLICATION_ID
5-
4+
from .settings import YOTI_APPLICATION_ID
65

76
def yoti_context(request=None):
87
context = login_button_context()
9-
context.update(site_verification_context())
108
context.update(application_context())
119
return context
1210

13-
1411
def login_button_context():
1512
return {
1613
'yoti_login_button': get_login_button_html,
@@ -19,13 +16,5 @@ def login_button_context():
1916
'yoti_login_button_lg': get_login_button_html('large')
2017
}
2118

22-
23-
def site_verification_context():
24-
raw_text = '<meta name="yoti-site-verification" content="{0}">'.format(
25-
YOTI_VERIFICATION_KEY
26-
)
27-
return {'yoti_site_verification': format_html(raw_text)}
28-
29-
3019
def application_context():
3120
return {'yoti_application_id': YOTI_APPLICATION_ID}

plugins/django_yoti/django_yoti/runtests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
YOTI={
3939
'YOTI_APPLICATION_ID': '01234567-8901-2345-6789-012345678901',
4040
'YOTI_CLIENT_SDK_ID': '01234567-8901-2345-6789-012345678901',
41-
'YOTI_VERIFICATION_KEY': '0123456789012345',
4241
'YOTI_KEY_FILE_PATH': '/home/user/.ssh/yoti_key.pem'
4342
}
4443
)

0 commit comments

Comments
 (0)