pub fn validate_chat_push(
extra: &Map<String, Value>,
caps: &HashMap<Id, ChatPushCapability>,
) -> Result<(), Box<SetError>>Expand description
Check the chatPush property in a PushSubscription’s extra map
before it is stored.
caps maps each account that advertises
urn:ietf:params:jmap:chat:push to its account-level capability object.
An absent or null chatPush, and a null entry for an account, are
accepted.
§Errors
The first offending value gets an invalidProperties SetError
naming it:
chatPush: the value is not an object.chatPush/<accountId>: the account is not incaps, or the entry is not aChatPushConfig. draft-atwood-jmap-chat-push-00 §PushSubscriptionExtension: “If aPushSubscription/setcreate or update includes achatPushentry for an account whoseaccountCapabilitiesdoes not includeurn:ietf:params:jmap:chat:push, the server MUST return aninvalidPropertiesSetErrorwhosepropertiesnames the offending entry (e.g.,chatPush/<id>) and MUST NOT store the subscription change.”chatPush/<accountId>/kinds: a value other than"direct","group"or"channel".chatPush/<accountId>/properties: a name that is not aChatMessageEntryfield the server supports.chatPush/<accountId>/urgencyand.../mentionUrgency: a value not in the account’ssupportedUrgencyValues, including any value outside RFC 8030 §5.3, which no capability can list. draft-atwood-jmap-chat-push-00 §ChatPushConfig: “the server MUST return aninvalidPropertiesSetErroronPushSubscription/setwhosepropertiesnames the offending path (e.g.,chatPush/<id>/urgency)”.