• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / auth / 32997592455
87%

Build:
DEFAULT BRANCH: master
Ran 26 Aug 2026 06:05PM UTC
Jobs 1
Files 25
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Aug 2026 06:03PM UTC coverage: 86.703% (+0.7%) from 86.05%
32997592455

push

github

web-flow
Make the Telegram API base URL configurable, and close what that opens (#316)

* Allow pointing the Telegram provider at another API base URL

The bot API host was formatted inline in two places, the bot methods and
the file downloads, so nothing outside this package could redirect them.
That makes the Telegram provider unreachable from any test that is not
willing to talk to the live API, and it leaves operators behind a proxy
with no way in either.

NewTelegramAPIWithBaseURL takes the base and derives both forms from it.
NewTelegramAPI keeps its signature and its behaviour, delegating with the
public API, so existing callers are unaffected. An empty base falls back
to the public API rather than producing requests against nothing, and a
trailing slash is trimmed so callers need not care.

The test stands up a substitute API and checks every call reaches it,
including the avatar download, which is the second URL and the one easy
to miss.

Mirrored in v1 and v2 per the project rule for shared behaviour.

* Address review: redact the token, validate the base, use the caller's client

Making the host caller-supplied moved a token-bearing URL across a
boundary that used to be frozen, and three things behind it were not
built for that.

The bot token could reach the error text. request redacted its own two
paths and then returned parseError bare, which interpolates the upstream
description raw, so a proxy answering 502 with the request URI in it put
the token into the log through Run, GetUpdates and Send. The token
itself is now scrubbed from anything leaving request, rather than
matching a URL shape, since the leak is whatever the upstream chose to
echo. Covered by a server that echoes its request URI.

The base URL was unvalidated, so "https://api.telegram.org@evil.tld"
resolved to evil.tld and shipped /bot<token>/ there. The constructor
returns an error now: absolute http or https, host required, no
userinfo, query, fragment or opaque part, an optional ... (continued)

115 of 121 new or added lines in 1 file covered. (95.04%)

3332 of 3843 relevant lines covered (86.7%)

9.85 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
88.68
v2/provider/telegram.go
Jobs
ID Job ID Ran Files Coverage
1 32997592455.1 26 Aug 2026 06:05PM UTC 25
86.7
GitHub Action Run
Source Files on build 32997592455
  • Tree
  • List 25
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d9c7fd35 on github
  • Prev Build on master (#32996657349)
  • Next Build on master (#32997592453)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc