Added WS endpoint for changing homeassistant password.#15527
Merged
balloob merged 5 commits intohome-assistant:devfrom Jul 19, 2018
Merged
Added WS endpoint for changing homeassistant password.#15527balloob merged 5 commits intohome-assistant:devfrom
balloob merged 5 commits intohome-assistant:devfrom
Conversation
balloob
reviewed
Jul 18, 2018
Member
balloob
left a comment
There was a problem hiding this comment.
Looks good! Will require tests
| provider = _get_provider(hass) | ||
| await provider.async_initialize() | ||
|
|
||
| user = connection.request.get('hass_user') |
| username = None | ||
| for credential in user.credentials: | ||
| if credential.auth_provider_type == provider.type: | ||
| username = credential.data['username'] |
| # Can happen if somehow we didn't clean up a credential | ||
| pass | ||
|
|
||
| async def async_change_password(self, username, new_password): |
Member
There was a problem hiding this comment.
No need for this, just call straight the data object
Member
Author
There was a problem hiding this comment.
Still use executor for password hashing though right?
balloob
reviewed
Jul 18, 2018
| WS_TYPE_CHANGE_PASSWORD = 'config/auth_provider/homeassistant/change_password' | ||
| SCHEMA_WS_CHANGE_PASSWORD = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend({ | ||
| vol.Required('type'): WS_TYPE_CHANGE_PASSWORD, | ||
| vol.Required('current_password'): str, |
Member
There was a problem hiding this comment.
You misunderstood. I think that this is great 👍
Member
Author
There was a problem hiding this comment.
Oh oops 🤦♂️ I'll add it back
balloob
approved these changes
Jul 19, 2018
balloob
pushed a commit
that referenced
this pull request
Jul 19, 2018
* Added WS endpoint for changing homeassistant password. * Remove change password helper. Don't require current password. * Restore current password verification. * Added tests. * Use correct send method
Merged
michaeldavie
pushed a commit
to michaeldavie/home-assistant
that referenced
this pull request
Jul 31, 2018
…t#15527) * Added WS endpoint for changing homeassistant password. * Remove change password helper. Don't require current password. * Restore current password verification. * Added tests. * Use correct send method
girlpunk
pushed a commit
to girlpunk/home-assistant
that referenced
this pull request
Sep 4, 2018
…t#15527) * Added WS endpoint for changing homeassistant password. * Remove change password helper. Don't require current password. * Restore current password verification. * Added tests. * Use correct send method
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:
Adds websocket endpoint to allow changing a user's password using the homeassistant auth_provider.
Related frontend PR: home-assistant/frontend#1464
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: