Skip to content

watcher config block: dotted-path values are literal strings (missing HOCON substitution) — watcher auto-detects ApiKeyAuth from garbage, and watcher paths are outside sanitize coverage #172

Description

@fupelaqu

Found during Story REPL.2 (#162) review; verified against core/src/main/resources/softnetwork-elastic.conf on main.

Problem

The builtin elastic.watcher block intends to inherit from elastic.credentials but omits the HOCON substitution syntax:

method       = elastic.credentials.method        # literal STRING "elastic.credentials.method"
username     = elastic.credentials.username      # literal STRING
password     = elastic.credentials.password      # literal STRING
api-key      = elastic.credentials.api-key       # literal STRING
bearer-token = elastic.credentials.bearer-token  # literal STRING

In HOCON an unquoted dotted path on the right-hand side is just a string value — inheritance requires ${elastic.credentials.method}. Consequences:

  1. Garbage credentials: watcher.api-key is the non-empty string "elastic.credentials.api-key", so once REPL: environment variables AND conf/application.conf are both ignored — only CLI flags configure the connection #162's auth auto-detection is active (ElasticAuthMethod.fromCredentials prefers api-key), any watcher client built from this block would send a nonsense Authorization: ApiKey … header (base64 of the literal path string) instead of no auth or the main credentials.
  2. No inheritance: setting ELASTIC_CREDENTIALS_* / elastic.credentials.* never propagates to the watcher; only the ELASTIC_WATCHER_* env vars work.
  3. Outside sanitize coverage: REPL.2 (REPL.2 — Connection config precedence: CLI flag > env var > config file > default #165) introduced empty/whitespace-env sanitization for the elastic.credentials.* paths; the elastic.watcher.* paths got no equivalent treatment.

Fix

Should ride the 0.20.2 line. Refs #162, #165, #169.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions