Skip to content

Hassio auth#17274

Merged
balloob merged 18 commits intodevfrom
hassio-auth
Oct 10, 2018
Merged

Hassio auth#17274
balloob merged 18 commits intodevfrom
hassio-auth

Conversation

@pvizeli
Copy link
Copy Markdown
Member

@pvizeli pvizeli commented Oct 9, 2018

Description:

Allow supervisor to use the user backend from home assistant to provide a SSO for Add-ons.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

_LOGGER.error("Can't find Home Assistant auth.")
raise HTTPNotFound()

asnyc def _check_login(self, username, password):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SyntaxError: invalid syntax


_LOGGER.error("Can't find Home Assistant auth.")
raise HTTPNotFound()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace


def _get_provider(self):
"""Return Homeassistant auth provider."""
for prv in hass.auth.auth_provider:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'hass'

def __init__(self, hass, hassio_ip):
"""Initialize WebView."""
self.hass = hass
sel.hassio_ip = hassio_ip
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'sel'

@@ -0,0 +1,70 @@
"""Implement the auth feature from Hass.io for Add-ons."""
import asyncio
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'asyncio' imported but unused

@home-assistant home-assistant deleted a comment from houndci-bot Oct 9, 2018
@home-assistant home-assistant deleted a comment from houndci-bot Oct 9, 2018
@home-assistant home-assistant deleted a comment from houndci-bot Oct 9, 2018
@home-assistant home-assistant deleted a comment from houndci-bot Oct 9, 2018
@home-assistant home-assistant deleted a comment from houndci-bot Oct 9, 2018
@callback
def async_setup_auth(hass):
"""Auth setup."""
hassio_ip = os.environ['HASSIO'].split(':')[0]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to pre-parse and store that in the view, can just get it on demand?

except HomeAssistantError:
raise HTTPUnauthorized() from None

raise HTTPOk()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. Just return web.Response(status=200) from the view.

@@ -0,0 +1,55 @@
"""The tests for the hassio component."""
import asyncio
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'asyncio' imported but unused

@pvizeli pvizeli changed the title WIP: Hassio auth Hassio auth Oct 9, 2018
@pvizeli pvizeli added this to the 0.80 milestone Oct 9, 2018
@balloob
Copy link
Copy Markdown
Member

balloob commented Oct 10, 2018

Add a test with not-JSON and add a test with JSON that doesn't contain username

@pvizeli
Copy link
Copy Markdown
Member Author

pvizeli commented Oct 10, 2018

@balloob done

@balloob balloob merged commit 40e0966 into dev Oct 10, 2018
@balloob balloob deleted the hassio-auth branch October 10, 2018 12:07
@ghost ghost removed the in progress label 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
@balloob balloob mentioned this pull request Oct 12, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants