-
Notifications
You must be signed in to change notification settings - Fork 451
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
Provide a custom event for AppAPI to receive message to send to bots #11577
Comments
Yeah that's definetly not the right way, as other apps should not invoke internal services directly. They are neither public nor stable APIs.
That sounds like a potential security issue, but an event should be an option. That being said, https://nextcloud-talk.readthedocs.io/en/latest/events/#chat-message-sent should be exactly what you need? |
Wow, thanks, I missed that in docs. We will discuss this in a team, maybe that will be enough and I will close this. |
We definitely can use that, instead of current AppAPI proxy implementation, but what then we can put in |
Is your feature request related to a problem? Please describe.
Starting from AppAPI
2.0
we support installation of ExApps on the remote servers.In these cases, we use additional authentication + brute-force protection using
HaProxy
and a password, which is not compatible with the current implementation of TalkBots.As a temporary solution we implemented such code:
https://github.com/cloud-py-api/app_api/blob/5e492fb4d9102233d0fad03d38c41f5f642d2b70/lib/Controller/TalkBotController.php#L83-L131
Where AppAPI act as a proxy. But it is a temporary solution, and very ugly.
Describe the solution you'd like
Perhaps a solution would be to add a new value to the BotInstallEvent, such as "callFunctionFlag", and when it is set, the call to provided function occurs instead of a request to the URL.
url
in this case will be something like: "\OCA\AppAPI\BotMessage"This will allow PHP applications that installed inside Nextcloud to receive messages directly without authentication.
Describe alternatives you've considered
Implementing a new event: "BotMessage" and PHP applications can listen for it and do with it whenever they want.
Maybe some other alternative will be better and someone has a better idea.
The text was updated successfully, but these errors were encountered: