From 1725d357bda7a652b5b257dca0d88a91cb3be8cb Mon Sep 17 00:00:00 2001 From: Niccolo Zapponi Date: Mon, 1 Feb 2021 12:22:29 +0000 Subject: [PATCH] Release v1.10.1 (#321) --- README.rst | 22 +++++++++++++++++++--- setup.py | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 3608b4b..9b2c777 100644 --- a/README.rst +++ b/README.rst @@ -64,11 +64,28 @@ If you would like to delete a password stored in your system keyring, you can cl Two-step and two-factor authentication (2SA/2FA) ************************************************ -If you have enabled `two-step authentication (2SA) `_ for the account you will have to do some extra work: +If you have enabled two-factor authentications (2FA) or `two-step authentication (2SA) `_ for the account you will have to do some extra work: .. code-block:: python - if api.requires_2sa: + if api.requires_2fa: + print "Two-factor authentication required." + code = input("Enter the code you received of one of your approved devices: ") + result = api.validate_2fa_code(code) + print("Code validation result: %s" % result) + + if not result: + print("Failed to verify security code") + sys.exit(1) + + if not api.is_trusted_session: + print("Session is not trusted. Requesting trust...") + result = api.trust_session() + print("Session trust result %s" % result) + + if not result: + print("Failed to request trust. You will likely be prompted for the code again in the coming weeks") + elif api.requires_2sa: import click print "Two-step authentication required. Your trusted devices are:" @@ -88,7 +105,6 @@ If you have enabled `two-step authentication (2SA) `_, but the authentication will time out after a few hours. Full support for two-factor authentication (2FA) is not implemented in PyiCloud yet. See issue `#102 `_. Devices diff --git a/setup.py b/setup.py index de7c062..5163f0a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages from codecs import open REPO_URL = "https://github.com/picklepete/pyicloud" -VERSION = "0.9.7" +VERSION = "0.10.1" with open("requirements.txt") as f: required = f.read().splitlines()