class Google::Auth::Stores::RedisTokenStore
‘g-user-token:`
are stored as JSON using the supplied key, prefixed with
Implementation of user token storage backed by Redis. Tokens
def delete id
def delete id key = key_for id @redis.del key end
def initialize options = {}
- Note: - If no redis instance is provided, a new one is created and
Parameters:
-
prefix
(String
) -- -
redis
(::Redis, String
) --
def initialize options = {} super() redis = options.delete :redis prefix = options.delete :prefix @redis = case redis when Redis redis else Redis.new options end @prefix = prefix || DEFAULT_KEY_PREFIX end
def key_for id
-
(String)
-
Parameters:
-
id
(String
) --
def key_for id @prefix + id end
def load id
def load id key = key_for id @redis.get key end
def store id, token
def store id, token key = key_for id @redis.set key, token end