1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

jwt: add redis blocklist

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-11-02 06:31:28 +02:00
parent 836fb18c57
commit f1ebddb6d9
8 changed files with 388 additions and 48 deletions

View File

@@ -16,11 +16,16 @@ type Blocklist interface {
jwt.TokenValidator
// InvalidateToken should invalidate a verified JWT token.
InvalidateToken(token []byte, expiry int64)
InvalidateToken(token []byte, c Claims) error
// Del should remove a token from the storage.
Del(token []byte)
// Count should return the total amount of tokens stored.
Count() int
Del(key string) error
// Has should report whether a specific token exists in the storage.
Has(token []byte) bool
Has(key string) (bool, error)
// Count should return the total amount of tokens stored.
Count() (int64, error)
}
type blocklistConnect interface {
Connect() error
IsConnected() bool
}