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

go-pkgz / auth / 30137880201
85%

Build:
DEFAULT BRANCH: master
Ran 25 Jul 2026 01:11AM 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

25 Jul 2026 01:08AM UTC coverage: 85.545% (+0.1%) from 85.445%
30137880201

push

github

web-flow
feat: opt-in github numeric user id, reject non-2xx user info (#301)

* feat: add opt-in github user id derived from immutable numeric id

GitHub logins are released on rename or account removal and can be claimed
by someone else, so a local id derived from the login may be inherited by
the next holder of the name. Every other oauth2 provider here keys on an
immutable subject, github was the only one on a mutable field.

Add Params.GithubNumericID and Service.AddGithubProviderWithNumericID to
derive the id from the numeric account id instead. Off by default because
it changes the id of every existing github user, and records stored under
the old id cannot be remapped offline once a login is hashed.

The numeric id is read from the raw response body with a typed unmarshal.
data.Value is not usable for it, json numbers decode to float64 and format
as "1.345027e+06". A missing or zero id keeps the login-based value rather
than hashing an empty string.

Applied to both the v1 (provider/) and v2 (v2/provider/) module paths.

* fix(review-loop): iteration 1 addressed 8 findings

- [major] [provider/providers.go:70] numeric ids shared a hash namespace with logins, which may be all-digit; domain-separate the hashed input with a "gid:" prefix
- [major] [auth_test.go] AddGithubProviderWithNumericID had no test; add Service-level coverage plus the default-unchanged negative case
- [minor] [provider/providers.go:69] warn when the numeric id is unusable instead of falling back silently
- [minor] [provider/providers.go:52] default the logger in NewGithub, the mapUser closure captures p before initOauth2Handler defaults its own copy
- [minor] [provider/providers.go:65] comment claimed the login fallback was safe; state the recycling caveat instead
- [minor] [provider/oauth2.go:62] document the best-effort fallback on Params.GithubNumericID and the Service method
- [minor] [auth.go:389] add the advanced-configuration note the AddMicrosoftProvider godoc carries
- [min... (continued)

37 of 41 new or added lines in 4 files covered. (90.24%)

3107 of 3632 relevant lines covered (85.55%)

8.6 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
71.24
v2/provider/oauth1.go
Jobs
ID Job ID Ran Files Coverage
1 30137880201.1 25 Jul 2026 01:11AM UTC 25
85.55
GitHub Action Run
Source Files on build 30137880201
  • Tree
  • List 25
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 81084029 on github
  • Prev Build on master (#29076222938)
  • Next Build on master (#30137880275)
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