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

pysogs zmq bot api #7

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

majestrate
Copy link
Contributor

bot api for sogs

sogs/model.py Outdated Show resolved Hide resolved
sogs/legacy_routes.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/model.py Outdated Show resolved Hide resolved
sogs/model.py Outdated Show resolved Hide resolved
@majestrate majestrate force-pushed the pysogs-bot-api-2021-11-22 branch 3 times, most recently from d1ccb04 to 650ded2 Compare November 29, 2021 16:42
sogs/base_config.py Outdated Show resolved Hide resolved
sogs/filtration.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
sogs/filtration.py Outdated Show resolved Hide resolved
@majestrate majestrate force-pushed the pysogs-bot-api-2021-11-22 branch 6 times, most recently from 6ae6d25 to 83464c5 Compare December 9, 2021 19:59
@majestrate majestrate force-pushed the pysogs-bot-api-2021-11-22 branch 2 times, most recently from e916894 to d5a8aa8 Compare December 17, 2021 19:13
sogs/events.py Outdated Show resolved Hide resolved
sogs/events.py Outdated Show resolved Hide resolved
@dillfrescott
Copy link

I will be able to send messages via curl with this right?

@majestrate
Copy link
Contributor Author

I will be able to send messages via curl with this right?

no, you can do that already using the non legacy http endpoints. this PR is for using zmq.

@majestrate
Copy link
Contributor Author

the current planned http endpoints are defined here: https://github.com/oxen-io/session-pysogs/blob/dev/api.yaml
some are implemented, most are not. if you want to help implement some of the endpoints that'd be useful.

@jagerman
Copy link
Member

some are implemented, most are not.

Actually almost all are implemented now with the recent PRs; I think the only one left is file downloading, which I'll be tackling tomorrow.

@dillfrescott
Copy link

Awesome! I'm really naive when it comes to api stuff but I find it very interesting.

@dillfrescott
Copy link

I just want to be able to send a message via curl lol

@jagerman
Copy link
Member

Curl likely won't ever be possible (by itself) because you have to be able to compute blake2b hashes to sign your request header with your session ID. So a few lines of Python, sure, but it needs a bit more than a static HTTP request.

@dillfrescott
Copy link

Oh. Could you take a look at this service https://github.com/caronc/apprise/wiki#notification-services and let me know if it would be possible to use it to send a message to my open group?

@majestrate
Copy link
Contributor Author

Oh. Could you take a look at this service https://github.com/caronc/apprise/wiki#notification-services and let me know if it would be possible to use it to send a message to my open group?

make an issue for this so it is tracked. thanks.

majestrate and others added 7 commits February 28, 2022 09:21
* wire up event subscription via zmq to notify connections of new events
* add zmq handler to inject http rpc calls via zmq authenticated by zmq curve pubkey
if data is a string or bytes dont try to bencode the repsonse
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
@majestrate
Copy link
Contributor Author

dont use assert, throw

Why?

it is an exceptional case and should not just be an assert so that i can happen on release mode too.

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.

3 participants