koding / kite

Micro-service framework in Go

Home Page:https://godoc.org/github.com/koding/kite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kite: add support for VerifyKontrol

rjeczalik opened this issue · comments

Currently, when kiteKey auth is used, recipient will reject a request when sender used a kiteKey which was signed using different key pair. In order to support multiple kiteKey in a system, a recipient needs to ask kontrol to verify whether public key matches any of the private key stored in the key pair storage.

Add kontrol.verify method which will accept list of public keys and will respend whether they are: valid, invalid, expired (deleted).

Add config.VerifyKontrol bool field, when set to true will supersed any config.VerifyFunc or default verify behaviour. The VerifyKontrol method will call kontrol.verify when kontrolKey in received kiteKey does not match the internal one. The result of kontrol.verify are going to be cached by the internal cache.

Kite / client with each kontrol.verify request additionaly to foreign kontrolKey should also send its own kontrolKey to validate, whether the key is not expired, and ask for a new one in case it was deleted. Bonus improvement.