Commit e702a84d authored by noamsml@chromium.org's avatar noamsml@chromium.org

Rename /privet/v2/ to /privet/v3/ in python prototype

Privet v2 was renamed to privet v3

BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/306073006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273911 0039d316-1c4b-4281-b951-d872f2087c98
parent 150cf09b
...@@ -704,14 +704,14 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -704,14 +704,14 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
'/internal/ping': self.do_ping, '/internal/ping': self.do_ping,
'/privet/info': self.do_info, '/privet/info': self.do_info,
'/deprecated/wifi/switch': self.do_wifi_switch, '/deprecated/wifi/switch': self.do_wifi_switch,
'/privet/v2/session/handshake': self.do_session_handshake, '/privet/v3/session/handshake': self.do_session_handshake,
'/privet/v2/session/cancel': self.do_session_cancel, '/privet/v3/session/cancel': self.do_session_cancel,
'/privet/v2/session/call': self.do_session_call, '/privet/v3/session/call': self.do_session_call,
'/privet/v2/setup/start': '/privet/v3/setup/start':
self.get_insecure_api_handler(self.do_secure_setup_start), self.get_insecure_api_handler(self.do_secure_setup_start),
'/privet/v2/setup/cancel': '/privet/v3/setup/cancel':
self.get_insecure_api_handler(self.do_secure_setup_cancel), self.get_insecure_api_handler(self.do_secure_setup_cancel),
'/privet/v2/setup/status': '/privet/v3/setup/status':
self.get_insecure_api_handler(self.do_secure_status), self.get_insecure_api_handler(self.do_secure_status),
} }
...@@ -723,9 +723,9 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -723,9 +723,9 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
} }
self.secure_handlers = { self.secure_handlers = {
'/privet/v2/setup/start': self.do_secure_setup_start, '/privet/v3/setup/start': self.do_secure_setup_start,
'/privet/v2/setup/cancel': self.do_secure_setup_cancel, '/privet/v3/setup/cancel': self.do_secure_setup_cancel,
'/privet/v2/setup/status': self.do_secure_status '/privet/v3/setup/status': self.do_secure_status
} }
@staticmethod @staticmethod
...@@ -786,7 +786,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -786,7 +786,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
@post_only @post_only
def do_session_handshake(self, request, response_func): def do_session_handshake(self, request, response_func):
"""Handles /privet/v2/session/handshake requests.""" """Handles /privet/v3/session/handshake requests."""
data = json.loads(request.body) data = json.loads(request.body)
try: try:
...@@ -834,7 +834,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -834,7 +834,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
@post_only @post_only
def do_session_cancel(self, request, response_func): def do_session_cancel(self, request, response_func):
"""Handles /privet/v2/session/cancel requests.""" """Handles /privet/v3/session/cancel requests."""
data = json.loads(request.body) data = json.loads(request.body)
try: try:
session_id = data['sessionID'] session_id = data['sessionID']
...@@ -853,7 +853,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -853,7 +853,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
@post_only @post_only
def do_session_call(self, request, response_func): def do_session_call(self, request, response_func):
"""Handles /privet/v2/session/call requests.""" """Handles /privet/v3/session/call requests."""
try: try:
session_id = request.headers['X-Privet-SessionID'] session_id = request.headers['X-Privet-SessionID']
except KeyError: except KeyError:
...@@ -910,7 +910,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -910,7 +910,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
return True return True
def do_secure_status(self, unused_request, response_func, unused_params): def do_secure_status(self, unused_request, response_func, unused_params):
"""Handles /privet/v2/setup/status requests.""" """Handles /privet/v3/setup/status requests."""
setup = { setup = {
'registration': { 'registration': {
'required': True 'required': True
...@@ -933,7 +933,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate): ...@@ -933,7 +933,7 @@ class WebRequestHandler(WifiHandler.Delegate, CloudDevice.Delegate):
response_func(200, setup) response_func(200, setup)
def do_secure_setup_start(self, unused_request, response_func, params): def do_secure_setup_start(self, unused_request, response_func, params):
"""Handles /privet/v2/setup/start requests.""" """Handles /privet/v3/setup/start requests."""
has_wifi = False has_wifi = False
token = None token = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment