세션 consumer에 Revoke 추가
This commit is contained in:
@ -50,8 +50,8 @@ func (p *provider_redis) New(input *Authorization) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
p.redisClient.Del(p.ctx, sks...)
|
||||
for _, sk := range sks {
|
||||
p.redisClient.HSet(p.ctx, sk, "inv", "true")
|
||||
p.redisClient.Publish(p.ctx, p.deleteChannel, sk).Result()
|
||||
}
|
||||
|
||||
@ -323,7 +323,17 @@ func (c *consumer_redis) Revoke(pk string) {
|
||||
sk := publickey_to_storagekey(publickey(pk))
|
||||
|
||||
c.redisClient.Del(c.ctx, string(sk))
|
||||
c.redisClient.Publish(c.ctx, c.deleteChannel, string(sk)).Result()
|
||||
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
if sr, ok := c.stages[0].cache[sk]; ok {
|
||||
c.stages[0].deleted[sk] = sr
|
||||
}
|
||||
|
||||
if sr, ok := c.stages[1].cache[sk]; ok {
|
||||
c.stages[1].deleted[sk] = sr
|
||||
}
|
||||
}
|
||||
|
||||
func (c *consumer_redis) IsRevoked(accid primitive.ObjectID) bool {
|
||||
|
||||
Reference in New Issue
Block a user