Documentation
¶
Overview ¶
Package redisauth is the one fleet Redis seat every tool dials with from the environment: the ACL user and the variable holding its password. It is a leaf (os and fmt only) so a tool that must import no network or subprocess code, nova-tokens under its boundary tests, reads its login here rather than through internal/nsprint/store, which reaches net and, through pkg/seatcred, os/exec.
Index ¶
Constants ¶
const ( UserEnv = "NOVA_SPRINT_REDIS_USER" PasswordEnvEnv = "NOVA_SPRINT_REDIS_PASSWORD_ENV" DefaultPasswordEnv = "NOVA_REDIS_BENCH_PASSWORD" )
UserEnv names the ACL user and turns authentication on; PasswordEnvEnv names the variable holding that user's password, DefaultPasswordEnv when unset.
Variables ¶
This section is empty.
Functions ¶
func Auth ¶
Auth is the one fleet Redis seat every tool dials with (nova-sprint, nova-tokens ledger/report through --user and --password-env). The user is the ACL user, else UserEnv; passwordEnv names the variable holding its password, else PasswordEnvEnv, else DefaultPasswordEnv. With no user the connection is the default user's: a password is read only when passwordEnv names its variable, so a throwaway test Redis needs nothing. A user whose password variable is empty is refused with the remedy, never dialed as default.
func NoUserHint ¶
func NoUserHint() string
NoUserHint is the refusal the fleet Redis needs when the default user is off: the password is already in the environment but the ACL user is unset, so a verb reaches the default user and NOAUTH refuses it. The line names the missing variable and the pair (user + password) in one line.
Types ¶
This section is empty.