I have a Telegram bot that is set to work with Telegram webhook mechanism but how trust requests and know if they are from Telegram?
base on Telegram docs I find out there is two way:
- limit them to telegam ip (this is dirty, if for some reason telegam change its ip my bot will shut down so it is not a option)
- set a private long url for webhook so only my server and telegram know the url (I don't think it's a good enough solution to secure my webhook, urls are public if for some reason my url leak, everyone can pretend they are telegram and send fake requests)
these two was what I found is there anything I miss? why Telegram don't provide a rsa public key like OAuth2 or some trusted token or signature like Github for its webhook? is private url enough for security?