func SetKeySecrets(key string, secrets [][]byte) {
	setKeySecretsCh <- &keySecretsCast{key, secrets}
}
Overwrites the active list of secrets for a specific key
package auth
var globalSecrets = [][]byte{}
var getSecretsCh = make(chan chan [][]byte)
var setSecretsCh = make(chan [][]byte)
type keySecretsCast struct {
	key     string
	secrets [][]byte
}
type keySecretsCall struct {
	key   string
	retCh chan [][]byte
}
var keySecrets = map[string]map[string]bool{}
var getKeySecretsCh = make(chan *keySecretsCall)
var setKeySecretsCh = make(chan *keySecretsCast)
var addKeySecretsCh = make(chan *keySecretsCast)
var remKeySecretsCh = make(chan *keySecretsCast)
func init() {
	go keeper()
}
func keeper() {
	for {
		select {
		case retCh := <-getSecretsCh:
			retCh <- globalSecrets
		case secrets := <-setSecretsCh:
			globalSecrets = secrets
		case call := <-getKeySecretsCh:
			if secrets, ok := keySecrets[call.key]; ok {
				ret := make([][]byte, 0, len(secrets))
				for secretStr := range secrets {
					ret = append(ret, []byte(secretStr))
				}
				call.retCh <- ret
			} else {
				call.retCh <- [][]byte{}
			}
		case cast := <-setKeySecretsCh:
			secrets := map[string]bool{}
			for _, secret := range cast.secrets {
				secrets[string(secret)] = true
			}
			keySecrets[cast.key] = secrets
		case cast := <-addKeySecretsCh:
			secrets, ok := keySecrets[cast.key]
			if !ok {
				secrets = map[string]bool{}
				keySecrets[cast.key] = secrets
			}
			for _, secret := range cast.secrets {
				secrets[string(secret)] = true
			}
		case cast := <-remKeySecretsCh:
			if secrets, ok := keySecrets[cast.key]; ok {
				for _, secret := range cast.secrets {
					delete(secrets, string(secret))
				}
				if len(secrets) == 0 {
					delete(keySecrets, cast.key)
				}
			}
		}
	}
}
func GetGlobalSecrets() [][]byte {
	retCh := make(chan [][]byte)
	getSecretsCh <- retCh
	return <-retCh
}
func SetGlobalSecrets(secrets [][]byte) {
	setSecretsCh <- secrets
}
func GetKeySecrets(key string) [][]byte {
	call := keySecretsCall{key, make(chan [][]byte)}
	getKeySecretsCh <- &call
	return <-call.retCh
}