Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/faustinoaq/secrets
Useful to get input on noecho, secrets, passwords, token, hints
https://github.com/faustinoaq/secrets
crystal password secrets
Last synced: 20 days ago
JSON representation
Useful to get input on noecho, secrets, passwords, token, hints
- Host: GitHub
- URL: https://github.com/faustinoaq/secrets
- Owner: faustinoaq
- License: mit
- Created: 2018-04-22T16:06:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-17T09:07:55.000Z (over 6 years ago)
- Last Synced: 2024-08-01T00:41:13.704Z (3 months ago)
- Topics: crystal, password, secrets
- Language: Crystal
- Size: 10.7 KB
- Stars: 12
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Secrets
[![Build Status](https://travis-ci.org/faustinoaq/secrets.svg?branch=master)](https://travis-ci.org/faustinoaq/secrets)
Crystal shard to get secrets with hint and backspace support.
![Secrets](https://i.imgur.com/R52pscI.png "Secrets")
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
secrets:
github: faustinoaq/secrets
```## Usage
```crystal
require "secrets"secret = Secrets.gets prompt: "Write your secret: "
puts "Your secret has #{secret.size} character(s)"
```![secrets-example](https://i.imgur.com/i6XzYPn.gif "Getting secrets...")
```crystal
require "secrets"secret = Secrets.gets prompt: "Write your secret: ", hint: "*", empty_error: "Empty input, Try again!"
puts "Your secret has #{secret.size} character(s)"
```![secrets-example-error](https://i.imgur.com/ZLriiBx.gif "No empty secrets!")
```crystal
require "secrets"secret = Secrets.gets prompt: "Write your secret: ", empty_error: "Retry!", retry: 3
if secret.empty?
puts "Oh, no!, your secret is empty!"
else
puts "Your secret has #{secret.size} character(s)"
end
```![secrets-example-error-retry](https://i.imgur.com/FL0vxBJ.gif)
## Development
Execute `spec/` using:
```
crystal spec
Finished in 564.18 milliseconds
8 examples, 0 failures, 0 errors, 0 pending
```## Contributing
1. Fork it ( https://github.com/faustinoaq/secrets/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [faustinoaq](https://github.com/faustinoaq) Faustino Aguilar - creator, maintainer