You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Erik Hollensbe 2763a384de minor refactor to consolidate some logic 1 month ago
cmd minor refactor to consolidate some logic 1 month ago
pkg Test a token encrypted by another key 1 month ago
sampledata ok, jwt time 1 month ago
.gitignore validate handler 1 month ago
Dockerfile stuff 1 month ago
Makefile ok, jwt time 1 month ago
README.md Update readme to be correct and remove an old constant 1 month ago
go.mod ok, jwt time 1 month ago
go.sum ok, jwt time 1 month ago

README.md

tokens expire after one minute, this is tweakable via constant in pkg/jwtgen/jwt.go.

usage:

make start

starts the daemons on your laptop. the default token is printed to the screen. http runs on 8000; grpc 8123.

bearercli validate <token> # validates the token is alive
bearercli refresh <token> # creates a new token, prints it

bearerhttpd can be driven through curl. it runs on port 8000:

curl -H "Authorization: Bearer <token>" -D- localhost:8000

Assuming your token works, you should see this:

HTTP/1.1 200 OK
Date: Sun, 23 Aug 2020 12:52:06 GMT
Content-Length: 14
Content-Type: text/plain; charset=utf-8

hello, world!

otherwise:

HTTP/1.1 403 Forbidden
Date: Sun, 23 Aug 2020 12:52:10 GMT
Content-Length: 0

Please read the code. Thanks.