Backend tweaks to make authorization work (#14339)
* Backend tweaks to make authorization work * Lint * Add test * Validate redirect uris * Fix tests * Fix tests * Lint
This commit is contained in:
1 parent
0f3ec94fba
commit
5ec7fc7ddb
17 files changed
+176
-58
No files matched your search
@@ -21,9 +21,9 @@ def mock_view(hass):
|
||||
name = 'bla'
|
||||
|
||||
@verify_client
|
||||
async def get(self, request, client_id):
|
||||
async def get(self, request, client):
|
||||
"""Handle GET request."""
|
||||
clients.append(client_id)
|
||||
clients.append(client)
|
||||
|
||||
hass.http.register_view(ClientView)
|
||||
return clients
|
||||
@@ -36,7 +36,7 @@ async def test_verify_client(hass, aiohttp_client, mock_view):
|
||||
|
||||
resp = await http_client.get('/', auth=BasicAuth(client.id, client.secret))
|
||||
assert resp.status == 200
|
||||
assert mock_view == [client.id]
|
||||
assert mock_view[0] is client
|
||||
|
||||
|
||||
async def test_verify_client_no_auth_header(hass, aiohttp_client, mock_view):
|
||||
|
||||
Reference in new issue
Block a user