fix: handle ntfy access token auth, and handle @ in credentials#424
Open
w33ble wants to merge 1 commit intoFinsys:mainfrom
Open
fix: handle ntfy access token auth, and handle @ in credentials#424w33ble wants to merge 1 commit intoFinsys:mainfrom
w33ble wants to merge 1 commit intoFinsys:mainfrom
Conversation
a7c1289 to
1dea242
Compare
|
I can confirm ntfy notifications currently don't work using token auth. |
|
they work for me, however in other form - not present in dockhand docs, but in ntfy/apprise docs:
|
|
Just started testing this, and I am not working either |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #398
Also addresses some of the comments in #15
Fixes the ntfy Apprise URL parsing. It works when an
@is used in the credentials and also adds support for using an access token as a Bearer token in the header.Support for both is accomplished by using
URL.parse, which will URL encode the@character in the credentials. And because that method separates the username and password, we can assume that when a password is not provided that it is actualyl an access token, and pass it as a Bearer token in the header directly.Testing
I threw together a local test setup to help iterate and also to show that the original code didn't do what was needed. These tests provide the
appriseUrland payload as well as theurlandheadersthey should produce.The original code failed when the credentials contain a
@character, or used an access token:The changes in this PR pass in all cases:
I also tested these changes with my own private ntfy instance. And when run with an access token or with an
@in the credentials, it worked as expected.