Skip to content

Commit 5f8ff65

Browse files
authored
Merge pull request #102 from iovation/3.8-DEV
Feature/totp (#101)
2 parents c08f61c + cbcf567 commit 5f8ff65

32 files changed

+1421
-380
lines changed

CHANGES.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG for LaunchKey Python SDK
22
==================================
33

4+
3.8.0
5+
-----
6+
7+
* Added TOTP generate_user_totp and remove_user_totp to Directory Client and verify_totp to Service Client
8+
49
3.7.0
510
-----
611

Pipfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ verify_ssl = true
55

66
[packages]
77
launchkey = {path = ".",editable = true}
8-
urllib3 = ">= 1.24.2" # Ensure CVE-2019-11324 is mitigated
8+
urllib3 = ">= 1.25.10"
99

1010
[dev-packages]
1111
# From setup.py tests_require to lock testing requirements
@@ -14,15 +14,15 @@ nose-exclude = ">= 0.5.0, < 1.0.0"
1414
mock = ">= 2.0.0, < 3.0.0"
1515
ddt = ">= 1.1.1, < 2.0.0"
1616
# Tools for static analysis
17-
flake8 = "~=3.6.0"
18-
pylint = "~=2.2.2"
17+
flake8 = "~=3.8.3"
18+
pylint = "~=2.5.3"
1919
coverage = "~=4.5.2"
20-
astroid = "~=2.1.0" # Remove after pylint is updated to 2.3.0+
2120
# Tools for multi-environment testing before sending to CI
2221
tox = "~=3.7.0"
2322
behave = "~=1.2.6"
2423
appium-python-client = "*"
2524
pyhamcrest = "*"
25+
pyotp = "*"
2626

2727
[requires]
28-
python = "~=3.4"
28+
python = "~=3.6"

Pipfile.lock

+248-179
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.rst

+33
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,39 @@ When a user logs out
186186
187187
service_client.session_end(user)
188188
189+
TOTP
190+
****
191+
192+
A user can have TOTP configured via the `generate_user_totp` method on the `DirectoryClient`.
193+
194+
.. code-block:: python
195+
196+
identifier = "my-permanent-unique-user-identifier"
197+
configuration = directory_client.generate_user_totp(identifier)
198+
print(" Secret: " + configuration.secret)
199+
print(" Algorithm: " + configuration.algorithm)
200+
print(" Period: " + configuration.period)
201+
print(" Digits: " + configuration.digits)
202+
203+
TOTP configurations can be removed via the `generate_user_totp` method on the `DirectoryClient`.
204+
205+
.. code-block:: python
206+
207+
identifier = "my-permanent-unique-user-identifier"
208+
directory_client.remove_user_totp(identifier)
209+
210+
Finally codes can be validated via the `verify_totp` method on the `ServiceClient`.
211+
212+
.. code-block:: python
213+
214+
identifier = "my-permanent-unique-user-identifier"
215+
otp = "569874"
216+
valid = service_client.verify_totp(identifier, otp)
217+
if valid:
218+
# Handle success scenario
219+
else:
220+
# Handle failure scenario
221+
189222
Dealing with Webhooks
190223
*********************
191224

examples/cli/Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ click = "*"
1010
six = "*"
1111
launchkey = {path = "./../..", editable = true}
1212
urllib3 = ">= 1.24.2" # Ensure CVE-2019-11324 is mitigated
13+
qrcode = "*"
1314

1415
[requires]
1516
python_version = "3.7"

examples/cli/Pipfile.lock

+68-67
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)