Skip to content

fix(valkey): valkey.url is one validated url, its path names the database, and the separate host, port and db settings go #2060

Description

@dan-petty

Problem

#2026 made valkey.url keep its scheme and name the address, so a valkeys:// URL dials TLS. The rest of step B of tracking issue #1113 is not done:

  • valkey.url is not validated as one URL: other schemes, credentials in the URL, bad ports, fragments and unknown query keys are not refused.
  • The database path of the URL (valkey://host:6379/2) is not read.
  • valkey.host, valkey.port, valkey.db and their environment variables still exist beside the URL.

Proposed fix

  • Validate valkey.url once with a Pydantic URL type (or urllib.parse with explicit checks) and refuse each case above with a message that names the setting.
  • Read the database from the URL path.
  • Remove valkey.host, valkey.port, valkey.db and their environment variables, with no shim (pre-1.0).

Acceptance criteria

  • A test refuses each invalid URL case with a message that names valkey.url.
  • A test reads the database from the URL path.
  • No setting or environment variable named valkey.host, valkey.port or valkey.db remains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/configtype/refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions