File: verify_json.py

package info (click to toggle)
privacybadger 2025.12.9-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,700 kB
  • sloc: javascript: 56,159; python: 2,225; sh: 403; makefile: 57; xml: 6
file content (24 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3

import json
import sys

KEYS = set([
    'action_map',
    'fp_scripts',
    'snitch_map',
    'tracking_map',
    'version',
])

with open(sys.argv[1], encoding="utf-8") as f:
    try:
        js = json.load(f)
        if set(js.keys()) == KEYS:
            sys.exit(0)
        else:
            print(f"json keys {js.keys()} are not correct")
            sys.exit(1)
    except Exception as e:
        print("error parsing json:", e)
        sys.exit(1)