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

Add ProofRequiredError Exception and submit-challenge command #320

Merged
merged 3 commits into from
May 7, 2023

Conversation

maltee1
Copy link
Contributor

@maltee1 maltee1 commented Nov 9, 2022

This is still entirely untested since I would need a ProofRequiredError to do so. I am not currently commited enough to try and trigger one for my Signal account, but anyone who has one, please try. Or if you find obvious mistakes without testing, let me know.

I've noticed that ProofRequiredError rarely comes in the SendMessageResult, but usually as a ResponseError, so I created another ProofRequiredException in errors.py. I didn't know how to reconcile the two, since SendMessageResult probably wouldn't work with an Exception instead of a SerializableAttrs, but I also needed to inherit from ResponseError.

When portal.handle_matrix_message() encounters a ProofRequiredError, it should store a token in the respective user, so the user won't have to copy&paste that. Since tokens are temporary in nature and I don't know how to work with databases, it's not stored in the database. I suppose that's fine.

The user can then use the submit-challenge command with just a captcha token to complete the challenge. I currently don't handle PUSH_CHALLENGE. So far, I have only encountered RECAPTCHA, I would prefer to first handle that and then worry about the other (probably just two lines, but still).

@maltee1 maltee1 force-pushed the captcha_challenge branch 2 times, most recently from 3d7768b to 86fd9b9 Compare April 24, 2023 18:27
@maltee1
Copy link
Contributor Author

maltee1 commented Apr 24, 2023

Tested & working. Please have a look.

@tulir tulir merged commit 5822fb0 into mautrix:master May 7, 2023
@exmatrikulator
Copy link

How do I get the captcha token?
Can you add a documentation for that?

Thanks

@maltee1
Copy link
Contributor Author

maltee1 commented Nov 15, 2023

I can't, because the python version of the bridge is deprecated. I suppose the go version will at some point have a similar command, if captchas continue to be requested.

Here's the documentation:
https://signald.org/articles/captcha/

@maltee1 maltee1 deleted the captcha_challenge branch December 22, 2023 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants