https://github.com/frohoff/pwdagent
A barebones CLI utility to prompt for and cache a password in memory, then hand it out over HTTP or raw TCP
https://github.com/frohoff/pwdagent
Last synced: 13 days ago
JSON representation
A barebones CLI utility to prompt for and cache a password in memory, then hand it out over HTTP or raw TCP
- Host: GitHub
- URL: https://github.com/frohoff/pwdagent
- Owner: frohoff
- License: mit
- Created: 2015-06-19T23:10:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-19T23:11:00.000Z (about 11 years ago)
- Last Synced: 2025-02-28T16:11:57.096Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
PwdAgent
=========
A barebones CLI utility to prompt for and cache a password in memory, then hand it out over HTTP or raw TCP.
DISCLAIMER: This program is only intended for use in local application development to avoid putting passwords on disk or prompting on every application startup. DO NOT use it for non-local/production systems!
```bash
$ pwdagent -p 6666 -s opensesame
Password: [supersecretpassword]
listening on http://127.0.0.1:6666/opensesame
$ curl localhost:6666/opensesame
supersecretpassword
```
Installation & Setup
------------
using git, bundle, and rake (assumes they've already been installed; may require root/sudo depending on rubygems config)
```bash
$ git clone [git-url]
$ cd [project]
$ bundle install
$ bundle exec rake install
```
OR using out-of-band (i.e. email) distributed gem binary:
```bash
$ gem install [project]-[version].gem
```
OR using https://github.com/rdp/specific_install:
```bash
# only needed the first time
$ gem install specific_install
$ gem specific_install -l [git-url]
```
Usage
---------
```bash
$ pwdagent -h
usage: /home/cfrohoff/bin/pwdagent [options]
-h, --help
-v, --verbose
-t, --tcp use raw TCP connection instead of HTTP
-p, --port TCP port to listen on
-H, --hostname TCP hostname to listen on
-s, --secret secret string to require before sending password
```
Example Usage
---------
```bash
$ pwdagent -p 6666
Password: [supersecretpassword]
$ curl localhost:6666
supersecretpassword
$ pwdagent -p 6666 -s opensesame
Password: [supersecretpassword]
listening on http://127.0.0.1:6666/opensesame
$ curl localhost:6666/opensesame
supersecretpassword
$ pwdagent -t -p 6666
Password: [supersecretpassword]
$ nc localhost 6666
supersecretpassword
pwdagent -t -p 6666
Password: [supersecretpassword]
listening on 127.0.0.1:6666 with secret 'opensesame'
$ echo -n "opensesame" | nc localhost 6666
supersecretpassword
```
Development
----------------
```bash
$ bundle install # install dependencies
$ bundle exec ruby -Ilib bin/pwdagent [options] # run from exploded dir
$ gem build pwdagent.gemspec # build gem file
```