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

bots-go-framework / bots-fw / 29491236810
27%

Build:
DEFAULT BRANCH: main
Ran 16 Jul 2026 10:33AM UTC
Jobs 1
Files 82
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

16 Jul 2026 10:33AM UTC coverage: 26.068% (+2.3%) from 23.743%
29491236810

push

github

trakhimenok
feat(botstoken): add compact token codec with HMAC-signed variant for off-platform tokens

New package botstoken implements the (verb, subject, args) token codec
described in architecture.md §4.3 (SYS-CB-010).

Plain codec:
- Encode(verb, subject, args) -> tab-delimited wire format with sorted args
- Decode(token) -> Token{Verb, Subject, Args}
- Enforces a 64-byte limit (ErrTokenTooLong if exceeded) so tokens fit
  in Telegram callback_data and WhatsApp interactive reply ID fields
- Args are sorted by key, making output deterministic across calls

Signed codec (for tokens leaving the platform — web deep links, wa.me URLs):
- EncodeSignedToken(verb, subject, args, now, KeyProvider) -> base64url string
- DecodeSignedToken(token, maxAge, KeyProvider) -> Token (or error)
- HMAC-SHA256 over the payload before the sig field is added, with a
  hex-encoded signature appended as the "sig" arg
- Issued-at timestamp stored as "at" (unix seconds); expiry checked on decode
- Key rotation supported via the KeyProvider interface (SigningKey / VerifyingKey)
- Internal fields (sig, at, kid) are stripped from the returned Token.Args
- Signed tokens carry authentication overhead and are not subject to the
  64-byte plain-codec limit; callers control token length via input length

Errors: ErrTokenTooLong, ErrInvalidToken, ErrTokenExpired, ErrInvalidSignature

16 table-driven tests covering: simple/args encoding, exact-64-byte boundary,
over-64 rejection, round-trip decode, empty/malformed inputs, signed round-trip,
determinism, expiry, tamper detection (modified payload), unknown key ID, invalid
base64, and confirmation that signed tokens are not length-limited.

115 of 129 new or added lines in 1 file covered. (89.15%)

78 existing lines in 1 file now uncovered.

1483 of 5689 relevant lines covered (26.07%)

0.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
89.15
botstoken/token.go

Coverage Regressions

Lines Coverage ∆ File
78
86.85
-0.51% botswebhook/router.go
Jobs
ID Job ID Ran Files Coverage
1 29491236810.1 16 Jul 2026 10:33AM UTC 82
26.07
GitHub Action Run
Source Files on build 29491236810
  • Tree
  • List 82
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • bb7c952a on github
  • Prev Build on main (#29475483533)
  • Next Build on main (#29492005096)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc