Repository navigation
feat: a one-time login that gives the bot a token without an expiry - #2
Merged
Merged
Conversation
… by a password login that asks for no refresh token, which MAS gives a token without an expiry; it refuses an expiring one and prints the token alone, to pipe into the secret
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.
The bot's token copied out of Element stopped working (
401 M_UNKNOWN_TOKEN): matrix.org's logins go through MAS, and Element's session token is short-lived and renewed by Element itself.MAS gives a legacy password login (
m.login.password) that asks for no refresh token an access token without an expiry (crates/handlers/src/compat/login.rs: "If the client asked for a refreshable token, make it expire"). A test login on matrix.org confirmed it: noexpires_in_ms, no refresh token, the requested device ID kept.python -m matrix_space.loginlogs the bot in once as the deviceoverpressure-github, refuses a token that expires (and ends its session), checks whose the token is, and prints it alone on standard output, to pipe into the secret:uv run python -m matrix_space.login | gh secret set MATRIX_ACCESS_TOKEN --env matrix --repo overpressure/matrix. Running it again replaces the session.Apican log in without a token, and log out.The workflows are unchanged: they read
MATRIX_ACCESS_TOKENas before.