block changeme callsigns

This commit is contained in:
Michaela Wheeler 2022-01-17 08:53:19 +11:00
parent 2a56b3810a
commit b291a74993
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import base64
import datetime
from email.utils import parsedate
CALLSIGN_BLOCK_LIST = ["CHANGEME_RDZTTGO"]
import es
@ -48,6 +49,8 @@ def lambda_handler(event, context):
payload["uploader_position"][2],
f"{payload['uploader_position'][0]},{payload['uploader_position'][1]}",
)
if payload["uploader_callsign"] in CALLSIGN_BLOCK_LIST:
return {"statusCode": 403, "body": "callsign blocked or invalid"}
index = datetime.datetime.utcnow().strftime("listeners-%Y-%m")
payload["ts"] = datetime.datetime.utcnow().isoformat()

View File

@ -36,7 +36,7 @@ payload = {
"timeEpoch": 1612051825409,
},
"body": """
{"software_name": "radiosonde_auto_rx", "software_version": "1.5.8-beta2", "uploader_callsign": "LZ3DJ-18", "uploader_position": [null,null,null], "uploader_antenna": "Dipole", "uploader_contact_email": "none@none.com", "mobile": false}
{"software_name": "radiosonde_auto_rx", "software_version": "1.5.8-beta2", "uploader_callsign": "CHANGEME_RDZTTGO", "uploader_position": [null,null,null], "uploader_antenna": "Dipole", "uploader_contact_email": "none@none.com", "mobile": false}
""",
"isBase64Encoded": False,
}