Skip to content

Only create front-end client_id once#15214

Merged
balloob merged 6 commits intohome-assistant:devfrom
awarecan:create-or-get-frontend-id
Jul 1, 2018
Merged

Only create front-end client_id once#15214
balloob merged 6 commits intohome-assistant:devfrom
awarecan:create-or-get-frontend-id

Conversation

@awarecan
Copy link
Copy Markdown
Contributor

@awarecan awarecan commented Jun 29, 2018

Description:

Only create front-end client_id once
Check user and client_id before create refresh token

Related issue (if applicable): fixes #15208 fixes #15201

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

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

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Comment thread homeassistant/auth.py Outdated

redirect_uris_counter = Counter(redirect_uris)

for _, client in self.clients.items():
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.

clients.values()

Comment thread homeassistant/auth.py Outdated
redirect_uris_counter = Counter(redirect_uris)

for _, client in self.clients.items():
if (client.name == name
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.

I think that we should just match on name and not allow clients with duplicate names. That can only confuse users.

@balloob balloob added this to the 0.73 milestone Jun 29, 2018
@balloob balloob merged commit a64a66d into home-assistant:dev Jul 1, 2018
@ghost ghost removed the in progress label Jul 1, 2018
balloob pushed a commit that referenced this pull request Jul 1, 2018
* Only create frontend client_id once

* Check user and client_id before create refresh token

* Lint

* Follow code review comment

* Minor clenaup

* Update doc string
@balloob balloob mentioned this pull request Jul 6, 2018
@awarecan awarecan deleted the create-or-get-frontend-id branch July 17, 2018 18:01
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* Only create frontend client_id once

* Check user and client_id before create refresh token

* Lint

* Follow code review comment

* Minor clenaup

* Update doc string
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

Frontend to only create a client id once Validate we can only create refresh tokens for valid client ids

3 participants