Skip to main content

License: MIT PyPI version Python code style

Yet Another OTP Bot

@yaotpbot : A Telegram Bot to generate OTPs.

Disclaimer: This project is intended as a toy project and should not be used for serious or production purposes. The author does not recommend using this for any critical applications.

Architecture

flowchart LR;

T[Telegram Server]

D[Dynamo DB]

subgraph K[Kubernetes Cluster]
    direction TB
    Y[Yaotpbot]
    GO[Gitlab Operator]
    GO -->|Deploy and sync| Y
end

subgraph G[GitLab]
    direction TB
    R[Repository]
    RE[Container Registry]
    R -->|CI| RE

end

K -.->|Poll update| T
D <---> |Store and retrieve| K
K -.-> |Watch and sync| G

Software

Yaotpbot is written in Python and use telegram-bot-api to interact with Telegram.

Infrastructure

A DynamoDB table it's used to store the identifiers of the chats and all the related seeds, needed to generate OTPs. All those information are stored encrypted and just decrpyted at runtime, using dynamodb-encryption-sdk library with AES encryption.

Deployment

CI/CD is automated with GitOps. in particular:

  • The pipeline
  • The operator deploys and keep synced the manifests created on a local k3s cluster.

Installation and usage

The bot can either be used as a container (registry) or installed directly with pip running

pip3 install --upgrade yaotpbot 

Note that following environment variables must be set:

Name Description
TELEGRAM_API_TOKEN Telegram Api Token of your bot needed to interact with Telegram. You always get a new one when creating a new bot.
LOCALSTACK_ENDPOINT A localstack endpoint to use when not using AWS. By default the bot looks for a table called yaotpbot-table and use sts to verify the connection.
DYNAMO_AES_SIGN_KEY Key used to sign encrypted data stored on DynamoDB. Can be generated running python scrips/keys.py
DYNAMO_AES_ENCRYPTION_KEY Key used to encrypt data stored on DynamoDB. Can be generated running python scrips/keys.py
AWS_ACCESS_KEY_ID AWS access key id. Used with AWS_SECRET_ACCESS_KEY to interact with DynamoDB.
AWS_SECRET_ACCESS_KEY AWS secret access key. Used with AWS_ACCESS_KEY_ID to interact with DynamoDB.

Metadata

Release files for yaotpbot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yaotpbot 0.1.0
File Size Uploaded Provenance Actions
yaotpbot-0.1.0.tar.gz 10.1 kB Without provenance Details for yaotpbot-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yaotpbot 0.1.0
File Interpreter ABI Platform Actions
yaotpbot-0.1.0-py3-none-any.whl Python 3 none any Details for yaotpbot-0.1.0-py3-none-any.whl

Total release size: 24.1 kB

Release files / yaotpbot-0.1.0.tar.gz

Download URL yaotpbot-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19a6be8dd1801016cefa8cd6d6c7df489676fdb8823fb4c92ed4f8b18ed22b7b
BLAKE2b-256 checksum
How to use checksums
c77b79034857d91820db8ace70f7cf74b3b3d29b81b94c7da3f45d9569b28815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / yaotpbot-0.1.0-py3-none-any.whl

Download URL yaotpbot-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9609d1d23d365d2e8506e3424d2beb19ddb358a7622a009e8e65946fad9272ec
BLAKE2b-256 checksum
How to use checksums
bed0731c124eb1bd96eb6af2a10b0c8a02d2a285ef4d8d82fa733ddb203b6ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for yaotpbot 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page