~martijnbraam/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Allow empty issuer in andotp import

Lorenzo Martinico <lorenzo+git@martinico.me>
Details
Message ID
<20211217162404.38588-1-lorenzo+git@martinico.me>
DKIM signature
pass
Download raw message
Patch: +1 -1
---
 contrib/andotp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/andotp.py b/contrib/andotp.py
index a98e004..337ec0d 100755
--- a/contrib/andotp.py
+++ b/contrib/andotp.py
@@ -10,7 +10,7 @@ for item in items:
    label = quote(item["label"])
    secret = item["secret"]
    url = f"otpauth://totp/{label}?secret={secret}"
    if item["issuer"]:
    if "issuer" in item:
        issuer = quote(item["issuer"])
        url += f"&issuer={issuer}"
    print(url)
-- 
2.31.1
Details
Message ID
<4553cbfa-d4cb-3288-e16f-92efc4e5d6f3@brixit.nl>
In-Reply-To
<20211217162404.38588-1-lorenzo+git@martinico.me> (view parent)
DKIM signature
missing
Download raw message
Thanks, applied. I've slightly modified it to also check if issuer is 
not empty/null to make the checking complete.

On 12/17/21 17:24, Lorenzo Martinico wrote:
> ---
>   contrib/andotp.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/andotp.py b/contrib/andotp.py
> index a98e004..337ec0d 100755
> --- a/contrib/andotp.py
> +++ b/contrib/andotp.py
> @@ -10,7 +10,7 @@ for item in items:
>       label = quote(item["label"])
>       secret = item["secret"]
>       url = f"otpauth://totp/{label}?secret={secret}"
> -    if item["issuer"]:
> +    if "issuer" in item:
>           issuer = quote(item["issuer"])
>           url += f"&issuer={issuer}"
>       print(url)
Reply to thread Export thread (mbox)