Skip to content

Commit

Permalink
de-uglify icon
Browse files Browse the repository at this point in the history
  • Loading branch information
dlenski committed Dec 27, 2020
1 parent 5bb3ffe commit 318cb71
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.png -text binary
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_generate_totp_uri():
'timeskew': 0,
}
test_secret = b'ZqeD\xd9wg]"\x12\x1f7\xc7v6"\xf0\x13\\i'
expected_uri = urlparse.urlparse('otpauth://totp/VIP%20Access:SYMC26070843?secret=LJYWKRGZO5TV2IQSD434O5RWELYBGXDJ&issuer=VIP%20Access&digits=6&algorithm=SHA1&period=30&image=https://vip.symantec.com/favicon.ico')
expected_uri = urlparse.urlparse('otpauth://totp/VIP%20Access:SYMC26070843?secret=LJYWKRGZO5TV2IQSD434O5RWELYBGXDJ&issuer=VIP%20Access&digits=6&algorithm=SHA1&period=30&image=https://raw.githubusercontent.com/dlenski/python-vipaccess/master/vipaccess.png')
generated_uri = urlparse.urlparse(generate_otp_uri(test_token, test_secret))
assert_equal(expected_uri.scheme, generated_uri.scheme)
assert_equal(expected_uri.netloc, generated_uri.netloc)
Expand All @@ -113,7 +113,7 @@ def test_generate_hotp_uri():
'timeskew': 0,
}
test_secret = b'\x9a\x13\xcd2!\xad\xbd\x97R\xfcEE\xb6\x92e\xb4\x14\xb0\xfem'
expected_uri = urlparse.urlparse('otpauth://hotp/VIP%20Access:UBHE57586348?digits=6&algorithm=SHA1&counter=1&issuer=VIP%20Access&secret=TIJ42MRBVW6ZOUX4IVC3NETFWQKLB7TN&image=https://vip.symantec.com/favicon.ico')
expected_uri = urlparse.urlparse('otpauth://hotp/VIP%20Access:UBHE57586348?digits=6&algorithm=SHA1&counter=1&issuer=VIP%20Access&secret=TIJ42MRBVW6ZOUX4IVC3NETFWQKLB7TN&image=https://raw.githubusercontent.com/dlenski/python-vipaccess/master/vipaccess.png')
generated_uri = urlparse.urlparse(generate_otp_uri(test_token, test_secret))
assert_equal(expected_uri.scheme, generated_uri.scheme)
assert_equal(expected_uri.netloc, generated_uri.netloc)
Expand Down
Binary file added vipaccess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vipaccess/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def decrypt_key(token_iv, token_cipher):

return otp_key

def generate_otp_uri(token, secret, issuer='VIP Access', image='https://vip.symantec.com/favicon.ico'):
def generate_otp_uri(token, secret, issuer='VIP Access', image='https://raw.githubusercontent.com/dlenski/python-vipaccess/master/vipaccess.png'):
'''Generate the OTP URI.'''
token_parameters = {}
token_parameters['issuer'] = urllib.quote(issuer)
Expand Down

0 comments on commit 318cb71

Please sign in to comment.