Skip to content

Redact secrets from substitution warning; fix manifest version precedence#274

Open
aosmcleod wants to merge 1 commit into
modelcontextprotocol:mainfrom
aosmcleod:fix/minor-log-and-version
Open

Redact secrets from substitution warning; fix manifest version precedence#274
aosmcleod wants to merge 1 commit into
modelcontextprotocol:mainfrom
aosmcleod:fix/minor-log-and-version

Conversation

@aosmcleod

Copy link
Copy Markdown

Two minor correctness fixes from #267.

1. Secret leakage in replaceVariables warning (#267 item 2)

When an array value was used in a string-substitution context, config.ts logged the raw value/array via console.warn(msg, { key, replacement }). user_config options can be sensitive: true (API keys, passwords), so the value must never be logged. Now logs the key name only.

2. manifest_version vs dxt_version precedence (#267 item 3)

getManifestVersionFromRawData fell through to the deprecated dxt_version when manifest_version was present but unsupported (e.g. "99.0"), silently ignoring the authoritative field. Now a present-but-unsupported manifest_version resolves to null; dxt_version is consulted only when manifest_version is absent. Supported-version and absent-field behaviour is unchanged.

Tests

  • config.test.ts: the array-in-string warning references the key but not the sensitive values (serializes object args so a value logged inside an object is caught).
  • manifestVersionResolve.test.ts (new): supported version resolves; dxt_version fallback works when manifest_version absent; present-but-unsupported manifest_version returns null; non-object input returns null.

Both new assertions fail against the old code and pass with the fix. yarn lint + yarn test (these suites) green.

Addresses #267.

…ence

Two minor correctness fixes from modelcontextprotocol#267:

- replaceVariables logged the raw replacement value (and array) via console.warn
  when an array was used in string context. user_config values can be sensitive
  (API keys, passwords), so log the key name only — never the value.

- getManifestVersionFromRawData fell back to the deprecated dxt_version when
  manifest_version was present but unsupported, silently ignoring the
  authoritative field. Treat a present-but-unsupported manifest_version as a
  resolution failure (null); only consult dxt_version when manifest_version is
  absent.

Adds tests for both. Addresses modelcontextprotocol#267 (items 2 and 3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant