jugmac00 / hibpcli Goto Github PK
View Code? Open in Web Editor NEWA Python CLI application to access the API of haveibeenpwned.com
License: MIT License
A Python CLI application to access the API of haveibeenpwned.com
License: MIT License
In order to not have to think about code formatting, the black code formatter should be used for all Python code, cf https://github.com/ambv/black
maybe related to https://mastodon.social/@hynek/109539593583271270
This has been fixed upstream, but not released yet -> cannot use PyKeePass
4.0.0
One should be able to check single password against the hibp API for being leaked or not.
Also see #17 for more information about the new interface.
The newly introduced requires.io badge shows that some packages are outdated.
... and run pre-commit via tox.
Travis builds do no longer show up on the pr page.
tox: mypy
mypy run-test-pre: PYTHONHASHSEED='3025488449'
mypy run-test: commands[0] | mypy --strict src
src/hibpcli/cli.py:10: error: Module has no attribute "group"; maybe "Group"?
src/hibpcli/cli.py:10: error: Untyped decorator makes function "main" untyped
src/hibpcli/cli.py:16: error: Module has no attribute "command"; maybe "Command"?
src/hibpcli/cli.py:16: error: Untyped decorator makes function "check_keepass" untyped
src/hibpcli/cli.py:17: error: Module has no attribute "argument"; maybe "Argument"?
src/hibpcli/cli.py:17: error: Untyped decorator makes function "check_keepass" untyped
src/hibpcli/cli.py:18: error: Module has no attribute "option"; maybe "Option"?
src/hibpcli/cli.py:18: error: Untyped decorator makes function "check_keepass" untyped
src/hibpcli/cli.py:22: error: Module has no attribute "prompt"
src/hibpcli/cli.py:28: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:30: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:33: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:34: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:36: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:39: error: Module has no attribute "command"; maybe "Command"?
src/hibpcli/cli.py:39: error: Untyped decorator makes function "check_password" untyped
src/hibpcli/cli.py:40: error: Module has no attribute "option"; maybe "Option"?
src/hibpcli/cli.py:40: error: Untyped decorator makes function "check_password" untyped
src/hibpcli/cli.py:44: error: Module has no attribute "prompt"
src/hibpcli/cli.py:51: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:54: error: Module has no attribute "echo"; maybe "secho"?
src/hibpcli/cli.py:56: error: Module has no attribute "echo"; maybe "secho"?
Found 22 errors in 1 file (checked 5 source files)
ERROR: InvocationError for command /home/runner/work/hibpcli/hibpcli/.tox/mypy/bin/mypy --strict src (exited with code 1)
current behaviour
When the user enters a wrong path, a nasty traceback is returned to the user.
wished behaviour
When the user enters a wrong path, a decent error message is returned.
bonus
The user gets another prompt and has a chance to enter a correct path, again.
cli.py makes use of the click framework, and thus it is a bit harder to test it.
Fortunately, click supports testing.
There is some documenation how to test a click application at
https://click.palletsprojects.com/en/7.x/testing/
Above message is shown when checking the local test.kdbx / on Python 3.8.
Not only for graphical applications, but also for CLI applications a good interface is important.
I will collect ideas about how to desgin the interface, ie the commands, subcommands, arguments and options.
I'd be very happy if you share your ideas.
Current favorite design
The above checks will be tested against the online API - local checks will be added later.
Any thoughts?
currently users get to see:
pykeepass.exceptions.CredentialsIntegrityError: Credentials are wrong or integrity check failed
The wording of messages “Hooray, everything is safe!” and “Your password is safe!” implies these passwords are safe. Actually they only have not been reported as unsafe until now.
How about: “Your password is probably safe.” or “This password has not been reported unsafe until now.” or let's find a better message in the discussion.
current behaviour
When the hibp API is not available, the user gets a nasty traceback.
wished behaviour
When the hibp API is not available, the user gets a decent error message.
Currently, the test calls the real hibp API -when the internet connection is down, the test would fail.
=> mock the call
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.