Skip to content

Commit

Permalink
Change auth warning (#16216)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored and fabaff committed Aug 27, 2018
1 parent 9466262 commit 9d491f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions homeassistant/components/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,10 @@ def __init__(self, hass, api_password,
if is_ban_enabled:
setup_bans(hass, app, login_threshold)

if hass.auth.active:
if hass.auth.support_legacy:
_LOGGER.warning("Experimental auth api enabled and "
"legacy_api_password support enabled. Please "
"use access_token instead api_password, "
"although you can still use legacy "
"api_password")
else:
_LOGGER.warning("Experimental auth api enabled. Please use "
"access_token instead api_password.")
elif api_password is None:
_LOGGER.warning("You have been advised to set http.api_password.")
if hass.auth.active and hass.auth.support_legacy:
_LOGGER.warning(
"legacy_api_password support has been enabled. If you don't"
"require it, remove the 'api_password' from your http config.")

setup_auth(app, trusted_networks, hass.auth.active,
support_legacy=hass.auth.support_legacy,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/http/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def auth_middleware(request, handler):
if request.path not in old_auth_warning:
_LOGGER.log(
logging.INFO if support_legacy else logging.WARNING,
'Please change to use bearer token access %s from %s',
'You need to use a bearer token to access %s from %s',
request.path, request[KEY_REAL_IP])
old_auth_warning.add(request.path)

Expand Down

0 comments on commit 9d491f5

Please sign in to comment.