telegramsecret

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package telegramsecret derives the webhook secret that Telegram echoes back in the X-Telegram-Bot-Api-Secret-Token header of every webhook call. The secret is derived, never stored: it rotates automatically whenever the bot token changes, and a database leak cannot expose it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Derive

func Derive(botToken string) string

Derive computes the webhook secret token for a bot token. The result is 64 hex characters, within Telegram's 1-256 length limit and its [A-Za-z0-9_-] alphabet.

func Equal

func Equal(presented, expected string) bool

Equal compares a presented secret with the expected one in constant time, so the comparison leaks nothing about the expected value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL