Skip to content

Support hashing from standard input #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wrouesnel
Copy link

Detect the presence of the terminal when invoking the hash command, and if not found assume the password is being supplied on standard input.

This supports scripting operations.

Example usage:

echo password | go run ./ hash
using config file: /home/wrouesnel/src/github.com/amdonov/lite-idp/config.yaml
$2a$10$JbXAVtwMN4rFnl5iRYpKAurWBJtdiU3uwPetJc6pQ070r7XfkU2gy

This stops short of trying to remove the "using config line", but a simple | tail -n1 will get the hashed string.

wrouesnel added 5 commits July 2, 2025 13:17
Detect the presence of the terminal when invoking
the hash command, and if not found assume the password
is being supplied on standard input.

This supports scripting operations.
The SP certificate decode depended on raw PEM
blocks being pasted and would fail if the usual
headers and footers were provided. This made for
very inconvenient command line usage.

It has been modified to simply accpet a block with
normal PEM headers.
Set the `log-level` parameter to a valid logrus level to adjust.
This is useful for debugging authentication.
Some SPs require response signatures. There's no harm to adding them, and
it fixes a compatibility hole.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant