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

vocdoni / saas-backend / 28095266962
63%

Build:
DEFAULT BRANCH: main
Ran 24 Jun 2026 11:35AM UTC
Jobs 1
Files 113
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

24 Jun 2026 11:29AM UTC coverage: 61.735% (-0.3%) from 62.016%
28095266962

push

github

web-flow
feat(apikeys): restrict API key creation to integrator organizations (#547)

* feat(apikeys): restrict API key creation to integrator organizations

API keys were intended as an integrator capability — every assignable scope
(quota:read, managed:read/write, voting:write, members:write) is
integrator-oriented, and integrators use keys to drive their managed orgs.
But createAPIKeyHandler only checked admin role with no integrator guard, so
an admin of a managed or plain org could mint working keys.

Add an IsIntegrator guard right after the admin check, returning
ErrNotAnIntegrator (403) otherwise. This also closes the orphan apiKeys-rows
gap for the upcoming DELETE managed-org cascade: once non-integrator orgs
cannot mint keys, deleting a managed org cannot leave orphaned rows behind.

* fix(apikeys): validate address param and document 404 in swagger

Address Copilot review feedback on #547:

- Validate the {address} path param up front with common.IsHexAddress and
  return 400 (ErrMalformedURLParam) on malformed input. common.HexToAddress
  silently maps a bad value to the zero address, which otherwise surfaced as
  a confusing 401/404; matches the integratorAddressFromRequest pattern.
- Document the 404 (ErrOrganizationNotFound) the new org lookup can return,
  in both swag annotations and the regenerated docs/swagger.yaml.
- Cover the malformed-address path in TestAPIKeysRequireIntegrator.

* docs(apikeys): clarify integrator guard comment

Address Copilot review feedback on #547: the previous comment implied
managed/plain orgs are always rejected, but the real guard is
!subscriptions.IsIntegrator(org), which also admits an org enabled as an
integrator via an IntegratorLimits override. Reword the comment to match
the actual condition.

12 of 18 new or added lines in 1 file covered. (66.67%)

210 existing lines in 9 files now uncovered.

9559 of 15484 relevant lines covered (61.73%)

44.26 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
55.0
1.6% api/apikeys_handlers.go

Coverage Regressions

Lines Coverage ∆ File
74
54.51
-7.75% stripe/webhook.go
41
7.77
-0.75% stripe/client.go
38
40.43
-1.11% stripe/service.go
18
79.57
6.49% db/plans.go
17
82.24
0.0% db/types.go
14
88.24
-0.08% api/apicommon/types.go
3
76.92
-5.93% api/plans.go
3
0.0
0.0% scripts/defaultplan/main.go
2
84.62
-3.62% stripe/config.go
Jobs
ID Job ID Ran Files Coverage
1 28095266962.1 24 Jun 2026 11:35AM UTC 113
61.73
GitHub Action Run
Source Files on build 28095266962
  • Tree
  • List 113
  • Changed 11
  • Source Changed 0
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1b54cabe on github
  • Prev Build on main (#28035462302)
  • Next Build on main (#28107569777)
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