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
Allow entries with same user_key for Pushover #77904
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the combination of user key and API key is unique right?
Shouldn't that be used as the unique identifier instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first thought of that. But if the api key is removed the user can reauthenticate with a new api key. So that makes the api key not unique.
Can we update the unique_id when reauthenticating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I read the documentation of the Pushover API the API token is unique. Wouldn't that solve the problem? If a user registers this in HA it would be a new instance. Just make the API not changeable for an existing configuration but document the procedure to change the API key is create a new configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An API key can be regenerated which means for the same application an old api token can be revoked and new one used instead.
This means we should still provide a re-authentication flow to enter new api_key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@engrbm87 Can I help you in any way? If a re-authentication flow is problematic I think a valid scenario for now would be to consider the API Token as unique and document the need to remove and recreate the configuration through the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just create a GUID and use that as the unique_id. It is not connected to any combination of User Key and App Key and therefore you can reconfigure both without adjusting the unique_id. I feel this is not the right choice because there would be nothing stopping you from creating multiple services with the same User/App key pair. On the other hand, this does not break anything, just the behavior on the phone-app might not be wat the user expects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know i'm a fringe user as this issue affects me to begin with, but i think i might be 'really' fringe user as i have(had until the HA update) two different Pushover User Keys defined. one for personal use and one for work (Group Key) that gets used by the team. locking the User Key to a single instance would still be a breaking change from the YAML config option that was originally available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to reject adding another config entry with the same user_key + api_key as implemented in the PR.
However, should that check also be done in the reauth flow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the check in the reauth. Please check and confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for progress here!
Do the code changes handle only creating new entries by GUI or would it also allow importing multiple entries from existing
configuration.yaml
?