Commit Graph

47 Commits

Author SHA1 Message Date
scito
201e6510f8 add type hints (Python 3.11) 2022-12-29 21:29:20 +01:00
scito
f933cd0d32 initial mypy type checking 2022-12-29 16:30:18 +01:00
scito
f4389ca8a3 fix linting 2022-12-29 15:52:17 +01:00
scito
b89a338246 enable mypy type checking 2022-12-29 14:24:12 +01:00
scito
631bacc409 use tmp_path fixture instead of clean_up() in pytests 2022-12-29 13:44:19 +01:00
scito
4209a5db3d move abort to end, use SystemExit instead; improve colors 2022-12-29 11:18:57 +01:00
scito
c90526dcf2 fix undefined name 'abort' and 'qreader' 2022-12-29 04:15:36 +01:00
scito
9f0872c2d0 extract from camera
- add help description
- use f-strings
- handle plural correctly
- rename methods, use otp_url instead of line
- remove importlib.util
- move cv2 imports to top
- remove unnecessary global delcarations
- group image tests
2022-12-28 22:43:40 +01:00
scito
672d18a5ca build docker images, run tests in docker build
- qreader_available flag
- echo commands in upgrade_deps.sh
2022-12-26 23:57:38 +01:00
scito
0490e227e1 docker image with qreader, 2nd image without qreader
- organize imports
- add qreader pytest.mark
- relaxed mode for pytest
- run tests in docker
- more tests
2022-12-26 18:31:09 +01:00
scito
2bcaa35251 organize imports 2022-12-25 11:00:15 +01:00
scito
e754befb52 refactor; update setup.py
more verbose logging
better error messages
2022-12-24 15:30:17 +01:00
scito
343520acb8 support multiple infiles 2022-12-24 04:48:12 +01:00
scito
c2d7c905ff handle wrong stdin streams 2022-12-24 04:19:43 +01:00
scito
4612ab6e7f catch zbar import error 2022-12-24 03:25:10 +01:00
scito
82da427d1a refactor code: extract method 2022-12-24 02:56:40 +01:00
scito
af0d7ffd5d dynamic import of QReader
since this module has a dependency to zbar lib
2022-12-24 02:46:36 +01:00
scito
f4934192ae WIP 2022-12-24 01:59:35 +01:00
qwertyca
483fcc0163 Add the ability so provide an image file as the infile. If the file contains a QR code generated by Google Authenticator's "Transfer Accounts" function, it will be decoded directly in a single step. This is meant to help users who need to access their secrets from Google Authenticator but don't have a QR code decoder and don't want to use an online one due to security concerns. 2022-12-23 10:17:04 +01:00
u231053
a51507b701 fix #30: enforce utf-8 encoding
since windows used non-utf8-encoding
2022-12-19 17:48:17 +01:00
scito
ca4a0bc7d2 improvements for - (stdout)
- - implies -q
- use add_mutually_exclusive_group for -v and -q
- adapt and improve tests
2022-12-18 21:34:24 +01:00
scito
1be4c7e0ef suppor writing csv and json to stdout; print errors to stderr
- add tests
2022-12-18 19:24:07 +01:00
scito
892f4f92ae fix compatibility for Python < 3.11 2022-12-16 13:10:22 +01:00
scito
bda0186d10 test wrong data and improve error handling 2022-12-16 12:43:32 +01:00
scito
a77e775948 add keepass csv export; improve hotp
- export to dedicated totp and hotp csv files for KeePass
- show Typ as totp/hotp instead of OTP_TOTP/OTP_HOTP
  (BREAKING CHANGE in csv, json and stdout, qr codes or urls are not affected)
- add hotp example
- add hotp tests
- export counter for hotp to csv and json files
- add section on KeePass to README
- increase protobuf to 4.21.10
- show file names of exported csv or json files
2022-12-04 16:19:30 +01:00
Wu Tingfeng
eae01a07d5
Test mutually exclusive arguments verbose and quiet (#25) 2022-11-28 21:19:35 +01:00
scito
dbfd3464f2 save qr code to specific dir, improve help, add tests
- use metavar for files and dirs in help
- support several recursive dirs in saveqr
- add saveqr and debug tests
2022-09-09 13:15:22 +02:00
scito
fbefb3474c fix save_qr: dict notation is needed 2022-09-09 13:08:35 +02:00
scito
4baf406211 improve docu
- add help page to README.txt
- remove -p
- mention optional qrcode module
2022-09-08 21:26:19 +02:00
scito
cd2d3258d3 handle not encoded + in query params, fixes #15
- add debug level, by givein parameter -vv
- if the base64 string is not urlencoded, then + will be replaced by a space,
  what cannot be decoded anymore
  --> replace spaces back to plus
- add test
2022-09-07 21:58:03 +02:00
scito
d7f4533c99 enable base64 decode validation
Enable validation for analyzing #15
2022-09-07 19:36:10 +02:00
scito
7fc69ea415 refactor to reduce complexity of extract_otps (main loop)
flake8 is happy now
2022-09-04 08:37:03 +02:00
scito
eac342c0cc fix optional QRCode import 2022-09-03 23:46:05 +02:00
scito
175e7c38e5 refactor to satisfy flak8 2022-09-03 16:38:29 +02:00
scito
c0d1cf6c51 upgrade to protobuf 4.21.5, add quiet mode, refactor code, add unit test
- update README.txt
- rename generated code directory
- refactor code:
    - extract methods
    - make code testable
2022-09-03 14:55:17 +02:00
scito
c344c45e04 fix unsued parameter
The parameter given in convert_secret_from_bytes_to_base32_str() was not used
in the method. Use it now.
2022-09-03 14:28:15 +02:00
scito
7a8ba31947 Fix #9: add export to json and csv 2022-06-29 06:25:56 +02:00
Jeroen Lodder
5dc155f556 Use print_ascii to make it work in powershell
qr.print_tty() doesn't work on windows, but qr.print_ascii() does.

May look a bit less formatted, but can still be scanned
2021-12-31 13:30:22 +01:00
scito
1377f032b9 fix: improve logging, handle file saving without issuer, extend example 2021-02-13 16:58:30 +01:00
scito
a7a6247f47 fix: improve error handling, abort on missing query parameter (data) 2021-02-13 16:54:12 +01:00
scito
e43d9ae925 fix: ignore empty lines in input file 2021-02-13 16:45:43 +01:00
scito
fb66c5f568 minor improvements 2020-12-21 19:52:55 +01:00
FrankAbagnaleJr
cc26f7b589
Option to save QR codes as PNG (#2)
* Generate QR code images

Now generates QR images instead of attempting to display the QR code in the console. Places them in a subdirectory of the current directory, entitled "qr"

* Update README.md

* Changes based on suggestions from scito

https://github.com/scito/extract_otp_secret_keys/pull/2#pullrequestreview-555264890

* Update extract_otp_secret_keys.py

Minor formatting changes and clarifications to help text

* Update extract_otp_secret_keys.py

Remove --qr argument, instead opting to respond to --printqr or --saveqr
2020-12-21 19:19:13 +01:00
scito
6068eb142c Fix #1: Quote otp.name 2020-11-14 13:15:06 +01:00
scito
f8459780c6 fix typo 2020-05-23 09:31:59 +02:00
scito
b19c505fb8 fix typos 2020-05-23 09:10:50 +02:00
scito
750d063a88 Initial 2020-05-23 08:51:41 +02:00