mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Don’t accept cancel or update via broadcast API
We don’t support these methods at the moment. Instead we were just
ignoring the `msgType` field, so issuing one of these commands would
cause a new alert to be broadcast 🙃
We might want to support `Cancel` in the future, but for now let’s
reject anything that isn’t `Alert` (CAP terminology for the initial
broadcast).
This commit is contained in:
@@ -2,6 +2,7 @@ post_broadcast_schema = {
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"msgType",
|
||||
"reference",
|
||||
"category",
|
||||
"content",
|
||||
@@ -52,6 +53,18 @@ post_broadcast_schema = {
|
||||
"$ref": "#/definitions/area",
|
||||
},
|
||||
},
|
||||
"msgType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Alert",
|
||||
# The following are valid CAP but not supported by our
|
||||
# API at the moment
|
||||
# "Update",
|
||||
# "Cancel",
|
||||
# "Ack",
|
||||
# "Error",
|
||||
],
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"area": {
|
||||
|
||||
Reference in New Issue
Block a user