-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hass.io sent token to supervisor #15536
Conversation
tests/components/hassio/test_init.py
Outdated
aioclient_mock.get( | ||
"http://127.0.0.1/homeassistant/info", json={ | ||
'result': 'ok', 'data': {'last_version': '10.0'}}) | ||
|
||
@asyncio.coroutine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
tests/components/hassio/test_init.py
Outdated
@asyncio.coroutine | ||
def test_setup_api_ping(hass, aioclient_mock): | ||
"""Test setup with API ping.""" | ||
@pytest.fixture(autouse=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
else: | ||
token = None | ||
|
||
yield from hassio.update_hass_api(config.get('http', {}), token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want migrate it to await
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a different PR.
@pvizeli for supervisor support, it looks like the supervisor won't allow unused options to be sent in. I think that we should change that so that it's easier to develop new features. I would like this change to go out on Friday, however right now it will break sending data to the supervisor. Would you be fine with adding an |
Hass.io sent token to supervisor
This commit why hass.io tab gets a blank white page now? |
@thecodingcheese Please do not use PR's to raise issues. |
Description:
Have the Hass.io component create a system user and share a refresh token with the supervisor on startup. It will only generate it once and sent the same refresh token on each start.
The supervisor can use this token to fetch an access token to allow add-ons to access the Home Assistant API. In the future we might extend this to be a system account per add-on that wants access.
If the auth system is not active, the refresh token value is set to
null
.Blocked by release of home-assistant/supervisor#575
CC @pvizeli
Related issue (if applicable): fixes #15220
Example entry for
configuration.yaml
(if applicable):hassio:
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code does not interact with devices: