https://github.com/grottopress/pawn
A low-level API client for Pwned Passwords
https://github.com/grottopress/pawn
api crystal have-i-been-pwned http-client pwned-passwords
Last synced: about 2 months ago
JSON representation
A low-level API client for Pwned Passwords
- Host: GitHub
- URL: https://github.com/grottopress/pawn
- Owner: GrottoPress
- License: mit
- Created: 2021-08-26T15:04:20.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-19T08:42:50.000Z (about 2 months ago)
- Last Synced: 2025-04-19T15:07:39.877Z (about 2 months ago)
- Topics: api, crystal, have-i-been-pwned, http-client, pwned-passwords
- Language: Crystal
- Homepage:
- Size: 27.3 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Pawn
**Pawn** is a low-level API client for [*Pwned Passwords*](https://haveibeenpwned.com/Passwords).
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
pawn:
github: GrottoPress/pawn
```1. Run `shards update`
1. Require *Pawn* in your app/library:
```crystal
# ...
require "pawn"
# ...
```## Usage
1. Check if a password appears in any breach:
```crystal
Pawn.pwned?("password") # <= true
```1. Find how many times a password appears in breaches:
```crystal
Pawn.count("password") # <= 3861493
```Either method accepts an optional `padding`, a `Bool` argument that sends a `Add-Padding` header along with the request to *Pwned Passwords* API.
## Development
Run tests with `crystal spec`.
## Contributing
1. [Fork it](https://github.com/GrottoPress/pawn/fork)
1. Switch to the `master` branch: `git checkout master`
1. Create your feature branch: `git checkout -b my-new-feature`
1. Make your changes, updating changelog and documentation as appropriate.
1. Commit your changes: `git commit`
1. Push to the branch: `git push origin my-new-feature`
1. Submit a new *Pull Request* against the `GrottoPress:master` branch.