Switch branches/tags
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
main.go

README.md

Overview

pgw-key is a helper utility for managing Polymur-gateway API key registration in Consul.

Installation

Requires Go 1.6

  • go get -u github.com/jamiealquiza/polymur/...
  • go install github.com/jamiealquiza/polymur/cmd/util/pgw-key
  • Binary will be found at $GOPATH/bin/pgw-key

Usage

$ ./pgw-key 
Commands ('pgw-key <command>' for help):
	list
	create
	regen
	delete

Example

Create a test key

% ./pgw-key create test
Successfully registered test with key 0a8208f91d178f2b634fc0f6
$ ./pgw-key list all
test: 0a8208f91d178f2b634fc0f6

Key sync'd in Polymur-gateway

2016/08/02 14:21:33 Running API key sync
2016/08/02 14:21:33 API keys refreshed: 1 new, 0 removed

Running Polymur-proxy with the test key

$ ./polymur-proxy -gateway="https://localhost:443" -cert="/path/to/cert.pem"  -api-key="0a8208f91d178f2b634fc0f6"
2016/08/02 14:21:35 ::: Polymur-proxy :::
2016/08/02 14:21:35 Pinging gateway https://localhost:443
2016/08/02 14:21:35 Connection to gateway https://localhost:443 successful

Key validated by the gateway

2016/08/02 14:21:35 [client 127.0.0.1:52647] key for test is valid