Enforce permissions for Websocket API (#18719)

* Handle unauth exceptions in websocket

* Enforce permissions in websocket API
This commit is contained in:
Paulus Schoutsen
2018-11-27 10:12:31 +01:00
committed by GitHub
parent 7248c9cb0e
commit 9d7b1fc3a7
6 changed files with 81 additions and 17 deletions

View File

@@ -6,11 +6,12 @@ DOMAIN = 'websocket_api'
URL = '/api/websocket'
MAX_PENDING_MSG = 512
ERR_ID_REUSE = 1
ERR_INVALID_FORMAT = 2
ERR_NOT_FOUND = 3
ERR_UNKNOWN_COMMAND = 4
ERR_UNKNOWN_ERROR = 5
ERR_ID_REUSE = 'id_reuse'
ERR_INVALID_FORMAT = 'invalid_format'
ERR_NOT_FOUND = 'not_found'
ERR_UNKNOWN_COMMAND = 'unknown_command'
ERR_UNKNOWN_ERROR = 'unknown_error'
ERR_UNAUTHORIZED = 'unauthorized'
TYPE_RESULT = 'result'