Browse Source

filter "home-assistant-entity-registry": also remove webhook ids from mobile app unique ids

Mobile app entity unique ids are prefixed with the webhook id, which allows posting to the webhook without authentication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabian Peter Hammerle 1 day ago
parent
commit
11841bcd80
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gitconfig

+ 1 - 1
gitconfig

@@ -68,7 +68,7 @@
 	smudge = cat
 
 [filter "home-assistant-entity-registry"]
-	clean = "jq '((.data.entities[]?, .data.deleted_entities[]?) | select(.unique_id != null)) |= if .platform == \"matter\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-[[:xdigit:]]{16}-)\"; \"\\(.p)…\") elif .platform == \"samsungtv\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") else . end' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\""
+	clean = "jq '((.data.entities[]?, .data.deleted_entities[]?) | select(.unique_id != null)) |= if .platform == \"matter\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-[[:xdigit:]]{16}-)\"; \"\\(.p)…\") elif .platform == \"samsungtv\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") elif .platform == \"mobile_app\" then (.unique_id |= sub(\"^[[:xdigit:]]{64}(?=_)\"; \"…\")) | if .previous_unique_id != null then .previous_unique_id |= sub(\"^[[:xdigit:]]{64}(?=_)\"; \"…\") else . end else . end' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\""
 	smudge = cat
 	required = true