Merged
Conversation
houndci-bot
reviewed
Oct 9, 2018
| _LOGGER.error("Can't find Home Assistant auth.") | ||
| raise HTTPNotFound() | ||
|
|
||
| asnyc def _check_login(self, username, password): |
|
|
||
| _LOGGER.error("Can't find Home Assistant auth.") | ||
| raise HTTPNotFound() | ||
|
|
houndci-bot
reviewed
Oct 9, 2018
|
|
||
| def _get_provider(self): | ||
| """Return Homeassistant auth provider.""" | ||
| for prv in hass.auth.auth_provider: |
| def __init__(self, hass, hassio_ip): | ||
| """Initialize WebView.""" | ||
| self.hass = hass | ||
| sel.hassio_ip = hassio_ip |
| @@ -0,0 +1,70 @@ | |||
| """Implement the auth feature from Hass.io for Add-ons.""" | |||
| import asyncio | |||
houndci-bot
reviewed
Oct 9, 2018
balloob
reviewed
Oct 9, 2018
| @callback | ||
| def async_setup_auth(hass): | ||
| """Auth setup.""" | ||
| hassio_ip = os.environ['HASSIO'].split(':')[0] |
Member
There was a problem hiding this comment.
No need to pre-parse and store that in the view, can just get it on demand?
balloob
reviewed
Oct 9, 2018
| except HomeAssistantError: | ||
| raise HTTPUnauthorized() from None | ||
|
|
||
| raise HTTPOk() |
Member
There was a problem hiding this comment.
This is weird. Just return web.Response(status=200) from the view.
houndci-bot
reviewed
Oct 9, 2018
houndci-bot
reviewed
Oct 9, 2018
tests/components/hassio/test_auth.py
Outdated
| @@ -0,0 +1,55 @@ | |||
| """The tests for the hassio component.""" | |||
| import asyncio | |||
balloob
reviewed
Oct 10, 2018
Member
|
Add a test with not-JSON and add a test with JSON that doesn't contain username |
Member
Author
|
@balloob done |
balloob
approved these changes
Oct 10, 2018
balloob
pushed a commit
that referenced
this pull request
Oct 10, 2018
* Create auth.py * Update auth.py * Update auth.py * Update __init__.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Update auth.py * Add tests * Update test_auth.py * Update auth.py * Update test_auth.py * Update auth.py
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Allow supervisor to use the user backend from home assistant to provide a SSO for Add-ons.
Checklist:
tox. Your PR cannot be merged unless tests pass