telegram

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWK

type JWK struct {
	Kid string `json:"kid"`
	Kty string `json:"kty"`
	Alg string `json:"alg"`
	Use string `json:"use"`
	// RSA fields
	N string `json:"n,omitempty"`
	E string `json:"e,omitempty"`
	// EC / OKP fields
	Crv string   `json:"crv,omitempty"`
	X   string   `json:"x,omitempty"`
	Y   string   `json:"y,omitempty"`
	X5c []string `json:"x5c,omitempty"`
}

type JWKSResponse

type JWKSResponse struct {
	Keys []JWK `json:"keys"`
}

type TgClaims

type TgClaims struct {
	jwt.RegisteredClaims

	Id    int64  `json:"-"`
	Login string `json:"-"`

	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Picture       string `json:"picture"`
	Locale        string `json:"locale"`
}

func (*TgClaims) UnmarshalJSON

func (c *TgClaims) UnmarshalJSON(data []byte) error

UnmarshalJSON is defined explicitly so the "id" claim can be decoded via telegramID while every other field keeps the default struct-tag-driven unmarshaling.

type TokenParser

type TokenParser struct {
	// contains filtered or unexported fields
}

func NewTokenParser

func NewTokenParser(jwksURL, issuer, audience string) TokenParser

func (*TokenParser) ParseAndVerifyIdToken

func (tp *TokenParser) ParseAndVerifyIdToken(idToken string) (TgClaims, error)

Jump to

Keyboard shortcuts

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