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

Internal Telegram bot API tokens #16

Closed
JulyIghor opened this issue Nov 5, 2020 · 9 comments
Closed

Internal Telegram bot API tokens #16

JulyIghor opened this issue Nov 5, 2020 · 9 comments

Comments

@JulyIghor
Copy link

JulyIghor commented Nov 5, 2020

As I understand this service is working like a proxy between a bot clients and MProto, so their Telegram bot API tokens transferred directly to a Telegram servers.
Is there any way we can make own local database of custom bot API tokens that can be used by a local bots, but work under specified public Telegram bot API token?
This way real public Telegram bot API token will not be stored on a local bot service side, but only in the telegram-bot-api service storage.
Also we could set some local rights for internal api tokens, to restrict them for some actions or channels/groups.

@JulyIghor JulyIghor changed the title Database of local API keys Internal API keys Nov 5, 2020
@levlam
Copy link
Contributor

levlam commented Nov 5, 2020

What are you calling "API keys"?

@JulyIghor
Copy link
Author

What are you calling "API keys"?

Sorry for confusing, I mean Telegram bot API token

@JulyIghor JulyIghor changed the title Internal API keys Internal Telegram bot API tokens Nov 5, 2020
@kolayne
Copy link

kolayne commented Nov 5, 2020

@JulyIghor, in easier words, you are suggesting to create a Telegram bot API (for a certain bot) and asking, won't it interfere with the work of Telegram bots API? If I understand you correctly, I'm pretty sure you don't want to use this project for that. You can consider this project a proxy between your bot and Telegram servers (you can find many more details about what local bot API is and what it can be used for in #1). So it seems to be technically possible to do what you want (at least I don't see anything preventing you from doing this), but why not make it a part of a bot itself? If you want to make your bot of many pieces which should be seen by Telegram as one bot with one token, just implement such one bot and give it one token

@JulyIghor
Copy link
Author

JulyIghor commented Nov 5, 2020

@JulyIghor, in easier words, you are suggesting to create a Telegram bot API (for a certain bot) and asking, won't it interfere with the work of Telegram bots API? If I understand you correctly, I'm pretty sure you don't want to use this project for that. You can consider this project a proxy between your bot and Telegram servers (you can find many more details about what local bot API is and what it can be used for in #1). So it seems to be technically possible to do what you want (at least I don't see anything preventing you from doing this), but why not make it a part of a bot itself? If you want to make your bot of many pieces which should be seen by Telegram as one bot with one token, just implement such one bot and give it one token

I wish to automate creating new API tokens for new bots without t.me/BotFather and store them in own DB.
Each of my bots doing different job for different channels, but using the same @ bot name.
And I wish all my bot services to not have access to a API tokens used by other bots and restrict them by allowed rights.

Yes, of course I can do own service to handle all of that, but since this project is a proxy, it would be great to have possibility of creating some proxy filter rules with a custom local API tokens database.

@kolayne
Copy link

kolayne commented Nov 5, 2020

@JulyIghor sounds better with a more detailed explanation but seems to be a very specific problem... I don't think it will ever be available out of the box

@JulyIghor
Copy link
Author

@JulyIghor sounds better with a more detailed explanation but seems to be a very specific problem... I don't think it will ever be available out of the box

It is more a feature request than a problem. And it would make some bot servers more secure.
It could work similar to a local BotFather per stored API tokens to create new local API tokens.
For now I see the only usage of current release to break 50Mb file upload limit and I think we need more features here.

@RememberTheAir
Copy link

RememberTheAir commented Nov 5, 2020

I think we need more features here

I think the main scope of this project is not to push people to use their own self-hosted instance by providing a more feature-rich alternative to the telegram-hosted bot api, rather it's to give an alternative/solution to people who need to overcome certain limits or to those who require a custom implementation, for some reasons. Something you can work on to fit your needs. I don't think this project was ever meant to compete with api.telegram.org - also considering Telegram's API is running on this same exact code - so I don't know how the maintainer feels about this, but I feel like deriving too much from what is the set of features offered by the official bot api is a bit out of the scope. Just my two cents. Anyone can still fork this project and add an additional bearer auth-like authentication

@levlam
Copy link
Contributor

levlam commented Nov 5, 2020

@JulyIghor You can do that if you fork the project and add this funtionality. It doesn't sound hard to implement, but it is out of the scope of this repository.

@JulyIghor
Copy link
Author

@JulyIghor You can do that if you fork the project and add this funtionality. It doesn't sound hard to implement, but it is out of the scope of this repository.

ok, thanks for the info

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

No branches or pull requests

4 participants