rediscluster

Provide token storage in Redis cluster.

To get started simply start a redis cluster and assign all hashslots to the connected nodes. Add the redis hostname and port to master configs as eauth_redis_host and eauth_redis_port. Default values for these configs are as follow:

eauth_redis_host: localhost
eauth_redis_port: 6379
depends:
  • redis-py-cluster Python package

saltext.redis.tokens.rediscluster.mk_token(opts, tdata)[source]

Mint a new token using the config option hash_type and store tdata with ‘token’ attribute set to the token. This module uses the hash of random 512 bytes as a token.

Parameters:
  • opts – Salt master config options

  • tdata – Token data to be stored with ‘token’ attribute of this dict set to the token.

Returns:

tdata with token if successful. Empty dict if failed.

saltext.redis.tokens.rediscluster.get_token(opts, tok)[source]

Fetch the token data from the store.

Parameters:
  • opts – Salt master config options

  • tok – Token value to get

Returns:

Token data if successful. Empty dict if failed.

saltext.redis.tokens.rediscluster.rm_token(opts, tok)[source]

Remove token from the store.

Parameters:
  • opts – Salt master config options

  • tok – Token to remove

Returns:

Empty dict if successful. None if failed.

saltext.redis.tokens.rediscluster.list_tokens(opts)[source]

List all tokens in the store.

Parameters:

opts – Salt master config options

Returns:

List of dicts (token_data)