Skip to content

About

Go kit: stringsvc2 with JWT

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Go kit: stringsvc2 with JWT

Go kit
stringsvc2

As part of learning Go Kit, now I'm trying to add JWT to stringsvc2.

  • Use custom claims to save client ID in JWT
  • Add /auth endpoint for getting a token
  • Protect /uppercase and /count endpoints with JWT
  • Use Context to pass client ID
  • Log client ID and record client ID in metrics
  • Protect /metrics endpoint with basic auth
go build -o server
./server
curl -v -XPOST -d '{"clientId": "mobile", "clientSecret": "m_secret"}' http://localhost:8080/auth
curl -v -XPOST -d '{"s": "hello world"}' -H "Authorization: Bearer eyJhbGci..." http://localhost:8080/uppercase
curl -v --user prometheus:password http://localhost:8080/metrics

About

Go kit: stringsvc2 with JWT

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages