瀏覽代碼

filter "home-assistant-config-entries": also remove access tokens

E.g. Victron Energy BLE stores the device's advertisement encryption key as data.access_token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabian Peter Hammerle 1 月之前
父節點
當前提交
bd407298da
共有 1 個文件被更改,包括 1 次插入 和 1 次删除
  1. 1 1
      gitconfig

+ 1 - 1
gitconfig

@@ -43,7 +43,7 @@
 	textconv = od -t x1z --
 
 [filter "home-assistant-config-entries"]
-	clean = jq '(.data.entries[].data | select(.password != null) | .password) = \"…\"' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\"
+	clean = jq '.data.entries[].data |= with_entries(if (.key | IN(\"password\", \"access_token\")) and .value != null then .value = \"…\" else . end)' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\"
 	smudge = cat
 	required = true