Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apprise/plugins/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ class MatrixVersion:
# Version 3
V3 = "3"

# Token
TOKEN = "token"


# webhook modes are placed into this list for validation purposes
MATRIX_VERSIONS = (
MatrixVersion.V2,
MatrixVersion.V3,
MatrixVersion.TOKEN
)


Expand Down Expand Up @@ -1474,6 +1478,9 @@ def url(self, privacy=False, *args, **kwargs):

auth = ''
if self.mode != MatrixWebhookMode.T2BOT:
if self.version == "token":
self.access_token = self.user

# Determine Authentication
if self.user and self.password:
auth = '{user}:{password}@'.format(
Expand Down Expand Up @@ -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":
results['mode'] = MatrixWebhookMode.DISABLED

return results

Expand Down