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 Token (m.login.token) support added #1203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caronc
Copy link
Owner

@caronc caronc commented Sep 14, 2024

Description:

Related issue (if applicable): #895

The URLs now trigger reference to the Matrix Token based Authentication (m.login.token):

  • {schema}://{token}@{host}/{targets}
  • {schema}://{token}@{host}:{port}/{targets}

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@895-matrix-token-support

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  "matrixs://token@host/#general"

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.35%. Comparing base (09cd2b6) to head (a6d4e72).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1203   +/-   ##
=======================================
  Coverage   99.35%   99.35%           
=======================================
  Files         147      147           
  Lines       20326    20331    +5     
  Branches     3979     3981    +2     
=======================================
+ Hits        20195    20200    +5     
  Misses        121      121           
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc changed the title m.login.token support for Matrix Matrix Token (m.login.token) support added Sep 14, 2024
@caronc caronc linked an issue Sep 14, 2024 that may be closed by this pull request
@ClemontX
Copy link

ClemontX commented Sep 26, 2024

unfortunately i can't say it's working:

❯    apprise -vv -t "Test Title" -b "Test Message" \
  'matrixs://<token>@<hostname>/!<channel-id>'
2024-09-26 09:50:12,914 - WARNING - Failed to handshake with Matrix server: Unauthorized - Invalid Token., error=403.
2024-09-26 09:50:13,109 - WARNING - Failed to handshake with Matrix server: Unauthorized - Invalid Token., error=403.

@ClemontX
Copy link

image

@ClemontX
Copy link

looks like it's going for a registration token instead of an access token.

@caronc
Copy link
Owner Author

caronc commented Sep 26, 2024

It almost looks like m.login.token was dropped from the specs entirely (see here).

What happens if you add ? version=2 to the Apprise URL to leverage the legacy Matrix API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matrix: Logging-in with an access_token
2 participants