8000 Hive auth fix for users by KJonline · Pull Request #73247 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hive auth fix for users #73247

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

Merged
merged 3 commits into from
Jun 10, 2022
Merged

Hive auth fix for users #73247

merged 3 commits into from
Jun 10, 2022

Conversation

KJonline
Copy link
Contributor
@KJonline KJonline commented Jun 8, 2022

Breaking change

Proposed change

refine and update authentication flow to fix some issues.

Pyhass/Pyhiveapi@v0.5.5...v0.5.9

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @Rendili, mind taking a look at this pull request as it has been labeled with an integration (hive) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@KJonline
Copy link
Contributor Author
KJonline commented Jun 8, 2022

@balloob, @frenck please can this be considered for the next 2022.6.X release?

Thank You

@balloob balloob added this to the 2022.6.5 milestone Jun 10, 2022
@balloob balloob merged commit 1dd7781 into home-assistant:dev Jun 10, 2022
@KJonline KJonline deleted the hive-auth-fix branch June 10, 2022 06:43
balloob pushed a commit that referenced this pull request Jun 10, 2022
@balloob balloob mentioned this pull request Jun 10, 2022
@kami-kazee
Copy link

Still broken I'm afraid, hive Auth issues - couldn't refresh token line 506 init_py, restore back to 2022.5.5 it's all good again

@rdbarry
Copy link
rdbarry commented Jun 11, 2022

Same
Error after entering auth token

Logger: aiohttp.server
Source: components/hive/config_flow.py:108
First occurred: 3:14:30 PM (1 occurrences)
Last logged: 3:14:30 PM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 205, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 93, in async_step_2fa
return await self.async_setup_hive_entry()
File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 108, in async_setup_hive_entry
await self.hive_auth.device_registration("Home Assistant")
File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 460, in device_registration
await self.confirm_device(device_name)
File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 480, in confirm_device
result = await self.loop.run_in_executor(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 391, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 705, in _make_api_call
http, parsed_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 725, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 104, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 134, in _send_request
request = self.create_request(request_dict, operation_model)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 117, in create_request
self._event_emitter.emit(event_name, request=request,
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 357, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 93, in handler
return self.sign(operation_name, request)
File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 165, in sign
auth.add_auth(request)
File "/usr/local/lib/python3.9/site-packages/botocore/auth.py", line 378, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials
``

@platypus11
Copy link

ditto

Logger: aiohttp.server
Source: components/hive/config_flow.py:108
First occurred: 10:16:29 (1 occurrences)
Last logged: 10:16:29

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 205, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 93, in async_step_2fa
return await self.async_setup_hive_entry()
File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 108, in async_setup_hive_entry
await self.hive_auth.device_registration("Home Assistant")
File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 460, in device_registration
await self.confirm_device(device_name)
File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 480, in confirm_device
result = await self.loop.run_in_executor(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 391, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 705, in _make_api_call
http, parsed_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 725, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 104, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 134, in _send_request
request = self.create_request(request_dict, operation_model)
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 117, in create_request
self._event_emitter.emit(event_name, request=request,
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 357, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 93, in handler
return self.sign(operation_name, request)
File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 165, in sign
auth.add_auth(request)
File "/usr/local/lib/python3.9/site-packages/botocore/auth.py", line 378, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jun 12, 2022
@MartinHjelmare
Copy link
Member

Please open a new issue if there's still a problem. Don't comment on merged PRs unless it's a specific code comment.

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.

7 participants
0