PyOTP 2.2.5__tar.gz → 2.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyotp
3
- Version: 2.2.5
3
+ Version: 2.2.6
4
4
  Summary: Python One Time Password Library
5
5
  Home-page: https://github.com/pyotp/pyotp
6
6
  Author: PyOTP contributors
@@ -27,8 +27,8 @@ Description: PyOTP - The Python One-Time Password Library
27
27
 
28
28
  * OTPs involve a shared secret, stored both on the phone and the server
29
29
  * OTPs can be generated on a phone without internet connectivity
30
- * OTPs should always be used as a second factor of authentication(if your phone is lost, you account is still secured with a password)
31
- * Google Authenticator allows you to store multiple OTP secrets and provision those using a QR Code(no more typing in the secret)
30
+ * OTPs should always be used as a second factor of authentication (if your phone is lost, you account is still secured with a password)
31
+ * Google Authenticator and other OTP client apps allow you to store multiple OTP secrets and provision those using a QR Code
32
32
 
33
33
  Installation
34
34
  ------------
@@ -78,11 +78,11 @@ Description: PyOTP - The Python One-Time Password Library
78
78
 
79
79
  pyotp.totp.TOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", issuer_name="Secure App")
80
80
 
81
- >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App'
81
+ >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App'
82
82
 
83
83
  pyotp.hotp.HOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", initial_count=0, issuer_name="Secure App")
84
84
 
85
- >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App&counter=0'
85
+ >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App&counter=0'
86
86
 
87
87
  This URL can then be rendered as a QR Code (for example, using https://github.com/neocotic/qrious) which can then be scanned
88
88
  and added to the users list of OTP credentials.
@@ -19,8 +19,8 @@ Quick overview of using One Time Passwords on your phone
19
19
 
20
20
  * OTPs involve a shared secret, stored both on the phone and the server
21
21
  * OTPs can be generated on a phone without internet connectivity
22
- * OTPs should always be used as a second factor of authentication(if your phone is lost, you account is still secured with a password)
23
- * Google Authenticator allows you to store multiple OTP secrets and provision those using a QR Code(no more typing in the secret)
22
+ * OTPs should always be used as a second factor of authentication (if your phone is lost, you account is still secured with a password)
23
+ * Google Authenticator and other OTP client apps allow you to store multiple OTP secrets and provision those using a QR Code
24
24
 
25
25
  Installation
26
26
  ------------
@@ -70,11 +70,11 @@ ability to generate provisioning URIs for use with the QR Code scanner built int
70
70
 
71
71
  pyotp.totp.TOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", issuer_name="Secure App")
72
72
 
73
- >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App'
73
+ >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App'
74
74
 
75
75
  pyotp.hotp.HOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", initial_count=0, issuer_name="Secure App")
76
76
 
77
- >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App&counter=0'
77
+ >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App&counter=0'
78
78
 
79
79
  This URL can then be rendered as a QR Code (for example, using https://github.com/neocotic/qrious) which can then be scanned
80
80
  and added to the users list of OTP credentials.
@@ -7,7 +7,7 @@ install_requires = [line.rstrip() for line in open(os.path.join(os.path.dirname(
7
7
 
8
8
  setup(
9
9
  name="pyotp",
10
- version="2.2.5",
10
+ version="2.2.6",
11
11
  url="https://github.com/pyotp/pyotp",
12
12
  license="BSD License",
13
13
  author="PyOTP contributors",
@@ -34,9 +34,10 @@ class HOTP(OTP):
34
34
  """
35
35
  Returns the provisioning URI for the OTP. This can then be
36
36
  encoded in a QR Code and used to provision an OTP app like
37
- Google Authenticator. See
38
- https://github.com/google/google-authenticator/wiki/Key-Uri-Format
39
- for more details.
37
+ Google Authenticator.
38
+
39
+ See also:
40
+ https://github.com/google/google-authenticator/wiki/Key-Uri-Format
40
41
 
41
42
  :param name: name of the user account
42
43
  :type name: str
@@ -71,9 +71,10 @@ class TOTP(OTP):
71
71
  """
72
72
  Returns the provisioning URI for the OTP. This can then be
73
73
  encoded in a QR Code and used to provision an OTP app like
74
- Google Authenticator. See
75
- https://github.com/google/google-authenticator/wiki/Key-Uri-Format
76
- for more details.
74
+ Google Authenticator.
75
+
76
+ See also:
77
+ https://github.com/google/google-authenticator/wiki/Key-Uri-Format
77
78
 
78
79
  :param name: name of the user account
79
80
  :type name: str
@@ -61,7 +61,7 @@ def build_uri(secret, name, initial_count=None, issuer_name=None,
61
61
  label = quote(name)
62
62
  if issuer_name is not None:
63
63
  label = quote(issuer_name) + ':' + label
64
- url_args['issuer'] = quote(issuer_name)
64
+ url_args['issuer'] = issuer_name
65
65
 
66
66
  if is_initial_count_present:
67
67
  url_args['counter'] = initial_count
@@ -72,7 +72,7 @@ def build_uri(secret, name, initial_count=None, issuer_name=None,
72
72
  if is_period_set:
73
73
  url_args['period'] = period
74
74
 
75
- uri = base_uri.format(otp_type, label, urlencode(url_args))
75
+ uri = base_uri.format(otp_type, label, urlencode(url_args).replace("+", "%20"))
76
76
  return uri
77
77
 
78
78
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyotp
3
- Version: 2.2.5
3
+ Version: 2.2.6
4
4
  Summary: Python One Time Password Library
5
5
  Home-page: https://github.com/pyotp/pyotp
6
6
  Author: PyOTP contributors
@@ -27,8 +27,8 @@ Description: PyOTP - The Python One-Time Password Library
27
27
 
28
28
  * OTPs involve a shared secret, stored both on the phone and the server
29
29
  * OTPs can be generated on a phone without internet connectivity
30
- * OTPs should always be used as a second factor of authentication(if your phone is lost, you account is still secured with a password)
31
- * Google Authenticator allows you to store multiple OTP secrets and provision those using a QR Code(no more typing in the secret)
30
+ * OTPs should always be used as a second factor of authentication (if your phone is lost, you account is still secured with a password)
31
+ * Google Authenticator and other OTP client apps allow you to store multiple OTP secrets and provision those using a QR Code
32
32
 
33
33
  Installation
34
34
  ------------
@@ -78,11 +78,11 @@ Description: PyOTP - The Python One-Time Password Library
78
78
 
79
79
  pyotp.totp.TOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", issuer_name="Secure App")
80
80
 
81
- >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App'
81
+ >>> 'otpauth://totp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App'
82
82
 
83
83
  pyotp.hotp.HOTP('JBSWY3DPEHPK3PXP').provisioning_uri("alice@google.com", initial_count=0, issuer_name="Secure App")
84
84
 
85
- >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure+App&counter=0'
85
+ >>> 'otpauth://hotp/Secure%20App:alice%40google.com?secret=JBSWY3DPEHPK3PXP&issuer=Secure%20App&counter=0'
86
86
 
87
87
  This URL can then be rendered as a QR Code (for example, using https://github.com/neocotic/qrious) which can then be scanned
88
88
  and added to the users list of OTP credentials.
@@ -67,7 +67,7 @@ class HOTPExampleValuesFromTheRFC(unittest.TestCase):
67
67
  self.assertEqual(url.path, '/FooCorp%21:mark%40percival')
68
68
  self.assertEqual(dict(parse_qsl(url.query)),
69
69
  {'secret': 'wrn3pqx5uqxqvnqr', 'counter': '0',
70
- 'issuer': 'FooCorp%21'})
70
+ 'issuer': 'FooCorp!'})
71
71
 
72
72
  key = 'c7uxuqhgflpw7oruedmglbrk7u6242vb'
73
73
  hotp = pyotp.HOTP(key, digits=8, digest=hashlib.sha256)
@@ -90,7 +90,7 @@ class HOTPExampleValuesFromTheRFC(unittest.TestCase):
90
90
  self.assertEqual(url.path, '/Foo%20Corp:baco%40peperina')
91
91
  self.assertEqual(dict(parse_qsl(url.query)),
92
92
  {'secret': 'c7uxuqhgflpw7oruedmglbrk7u6242vb',
93
- 'counter': '10', 'issuer': 'Foo%20Corp',
93
+ 'counter': '10', 'issuer': 'Foo Corp',
94
94
  'digits': '8'})
95
95
 
96
96
  def test_other_secret(self):
@@ -199,7 +199,7 @@ class TOTPExampleValuesFromTheRFC(unittest.TestCase):
199
199
  self.assertEqual(url.path, '/FooCorp%21:mark%40percival')
200
200
  self.assertEqual(dict(parse_qsl(url.query)),
201
201
  {'secret': 'wrn3pqx5uqxqvnqr',
202
- 'issuer': 'FooCorp%21'})
202
+ 'issuer': 'FooCorp!'})
203
203
 
204
204
  key = 'c7uxuqhgflpw7oruedmglbrk7u6242vb'
205
205
  totp = pyotp.TOTP(key, digits=8, interval=60, digest=hashlib.sha256)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes