Skip to content

Support no-auth Redis for the embedded auth server, distinguishing unset credentials from a misconfigured secret #6550

Closed

Description

@tgrunnagle

Summary

The embedded auth server's Redis-backed storage cannot connect to a Redis/Valkey instance that has no authentication configured. convertRedisACLConfig (pkg/authserver/runner/embeddedauthserver.go) treats a nil ACLUserConfig as a hard error ("acl user config is required"), and even with a config present the password is mandatory. So the only way to run the embedded auth server against Redis today is with a password.

That blocks legitimate deployments where the store runs without auth on purpose: local/dev clusters, single-tenant deployments where network isolation is the boundary, and managed tiers that are provisioned without ACL users. The username is already optional (an empty UsernameEnvVar falls back to the default user / legacy AUTH), so no-auth is the natural next step; only the mandatory password stands in the way.

The goal is to make no auth a selectable mode for the toolhive-owned Redis consumers, while keeping a misconfigured credential a loud failure rather than a silent downgrade.

Why the distinction matters

An unset credential and a misconfigured one look different and must be treated differently.

  • Nil ACLUserConfig means no credential was intended. That should resolve to a no-auth connection.
  • A populated ACLUserConfig whose PasswordEnvVar resolves to empty means something is wrong: a mis-keyed secret, a wrong-namespace secret, or an unsynced external-secrets store. Silently booting unauthenticated in that case would be a downgrade, not a choice, and the store holds sensitive rows (OAuth clients, DCR registrations, session data). That path must keep erroring.

So the split is on presence of the config block, not on whether the resolved password happens to be empty.

Proposed behaviour

  1. convertRedisACLConfig: when ACLUserConfig is nil, return empty username and password with no error (a no-auth config), instead of the current "acl user config is required". createStorage / convertRedisRunConfig no longer require an ACL config for the redis storage type.
  2. Populated-but-empty still errors: when ACLUserConfig is present but PasswordEnvVar resolves to empty, keep returning an error. Do not downgrade to unauthenticated on a config that was clearly meant to carry a credential.
  3. A configured password is carried through unchanged: the existing authenticated path (populated block, password resolves) is unaffected.
  4. One startup WARN on a no-auth resolution: when a toolhive-owned Redis consumer resolves to no authentication, emit exactly one startup WARN naming the store it is connecting to (address / key prefix), so an unintended downgrade is visible in logs rather than silent. This applies to both:
    • the embedded auth server's Redis storage (createStorage / convertRedisRunConfig), and
    • the vMCP Redis session storage (buildSessionDataStorage in pkg/vmcp/server/server.go), which already tolerates an empty THV_SESSION_REDIS_PASSWORD but currently logs unconditionally at INFO without distinguishing whether auth is present. It should log a WARN when it resolves to no auth.

Out of scope

  • No change to the authenticated default: a populated ACLUserConfig still requires its password to resolve.
  • Username stays optional exactly as today (default-user / legacy AUTH fallback).
  • TLS handling, timeouts, and Sentinel/cluster topology are unchanged.
  • Dynamic / IAM-minted credentials are a separate concern, not part of this change.

Notes for the implementer

  • RedisRunConfig.AuthType is documented as must be "aclUser" but the conversion code does not branch on it. Its doc comment (and convertRedisACLConfig's) should be updated to state that a nil ACLUserConfig is now a valid no-auth configuration rather than an error.
  • The no-auth WARN should fire exactly once at startup per consumer, and name the store, so the message is actionable when the no-auth resolution was unintended.

Suggested tests

  • A nil ACLUserConfig yields empty username/password with no error, and a client built from the resulting config connects to a no-auth server.
  • A populated ACLUserConfig whose PasswordEnvVar resolves to empty still returns an error.
  • A populated ACLUserConfig with a resolvable password carries it through unchanged.
  • A no-auth resolution emits exactly one startup WARN naming the store, for both the embedded auth server storage and the vMCP session storage.

Activity

  1. added
    enhancement
    vmcp
    on Sep 8, 2026
  2. added
    needs-triage
    on Sep 8, 2026
  3. self-assigned this
    on Sep 8, 2026
  4. removed
    needs-triage
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authenticationenhancementvmcp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions