-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Matrix: Allow token only client API authorization with token parameter #1236
Conversation
apprise/plugins/matrix.py
Outdated
@@ -1474,6 +1478,9 @@ def url(self, privacy=False, *args, **kwargs): | |||
|
|||
auth = '' | |||
if self.mode != MatrixWebhookMode.T2BOT: | |||
if self.version == "token": |
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.
Change to if self.version == MatrixVersion.TOKEN:
🙏
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1236 +/- ##
=======================================
Coverage 99.36% 99.36%
=======================================
Files 147 147
Lines 20555 20560 +5
Branches 3663 3665 +2
=======================================
+ Hits 20425 20430 +5
Misses 121 121
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
apprise/plugins/matrix.py
Outdated
@@ -1574,6 +1581,8 @@ def parse_url(url): | |||
|
|||
elif 'v' in results['qsd'] and len(results['qsd']['v']): | |||
results['version'] = NotifyMatrix.unquote(results['qsd']['v']) | |||
if results['version'] == "token": |
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.
See previous comment
Thanks for reviewing this and pointing out the change 👍 Edit: Going to test this. Edit2: Works. |
1 note and 1 question 😉 📓 : see above as you correctly updated the For your solution, i'm not sure if the |
I just checked the code. So since V3 is the default, this uses V3. Not V2. it could use V2, but that's not how it currently goes. So when V4 comes out, that will become the default, and the endpoint should remain. People using As far as #1203 (comment) goes, I can see the payload contains See https://github.com/caronc/apprise/pull/1236/files#diff-4389ebe118730ba468f8fc5780602cfe968c64076c77db4c89e007e041191eabR1482 You're using My environment seems a bit different, so if you could just link the Maybe the person testing it doesn't have it set up to work? When I originally built this, I started doing it your way. After reading the documentation, and the code, I decided it was quick to go to T2/ webhook mode, so I figured this was actually less complex, and maybe less confusing too? |
Personally, I no longer have Matrix so it was difficult for me to test. The fact you're engaged to fix tihs is amazing and I really want you to get all of he credit. I'd much rather close my PR and use yours. However, I'm a bit picky 😉 .. And i feel your solution is so spot on... the only thing i'd rather you do is leverage this block of code here vs introducing a new version. I like the idea of All of the logic is in my PR to figure out if you're rolling with a Token or User/Pass (it's a wee bit more code, but allows us to catch/adjust if the token changes in future versions. Is there a way you could check out my branch... steal all my code (please)... or whatever is valid within it... and just apply your efforts. I can also see that i went off to make a call upstream with Keep in mind that the I'll help you with your unit testing; so don't worry about that. See if you can just make it work (and sorry to give you more work). I'm excited to merge your version vs mine quite honestly. 🙏 |
There, that also works. 1cd6f6a The problem is that you were trying to log in, when the token means you've already logged in. You just want to pass the token along with whatever you were going to do after. The 1cd6f6a#diff-4389ebe118730ba468f8fc5780602cfe968c64076c77db4c89e007e041191eabR617 |
…r Remove Whitspace
Removed whitespace to pass |
Merged; thank you 🙏 |
Description:
Related issue (if applicable): #
N/A
Checklist
flake8
)Description
When a token is passed and the url version is
token
we force it out of T2/Webhook mode and just pass the token as authentication instead.Test out the changes with the following command: