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

stacklok / toolhive / 40946339513
73%

Build:
DEFAULT BRANCH: main
Ran 29 Oct 2026 08:18PM UTC
Jobs 1
Files 987
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

29 Oct 2026 08:08PM UTC coverage: 72.129% (+0.08%) from 72.053%
40946339513

push

github

web-flow
Limit delegate token exchange to source clients (#6988)

* Add token-exchange source policy for clients

A configured delegate client may exchange any self-issued token the
server has issued, including tokens issued to unrelated clients. Those
tokens are bearer credentials, so a token that leaks from one client, or
that a malicious dynamically registered client collects through normal
consent, can be laundered through any delegate into that delegate's own
downstream access. RFC 8693 leaves exchange policy to the authorization
server, and RFC 8707 audience limits do not stop this when both clients
share an audience, so the server has to bind the source itself.

Add an optional token_exchange block per delegate with
self_issued_subject_tokens (any or restricted). Restricted limits the
delegate to subject tokens issued to itself or to its
allowed_source_clients, and requires any may_act to match. A may_act
claim cannot replace this check: the server never writes may_act into
its own tokens, and when one is present it skips the client_id binding,
so it cannot narrow access on the self-issued path.

Examples:

- Blocked laundering: a dashboard client B logs a user in, and a broker
  delegate A holds the token-exchange grant. With restricted and no
  allowed_source_clients, A cannot exchange B's token for its own
  downstream access.
- Intended sharing: A brokers requests for a CLI client B. Listing B in
  allowed_source_clients lets A exchange B's tokens and nothing else.
- Audience grant: A is granted api_audience for a reporting API with no
  subject-token coverage. This is an explicit, operator-chosen exception
  for self-issued tokens only.

The default stays any, so existing delegates keep today's behaviour and
get the startup WARN. A client that sets grant_types must declare the
block and a mode, so the trust level is an explicit choice.

Not closed here: a stolen bearer token can still be exchanged by a
delegate on the source list, and api_audience ... (continued)

156 of 156 new or added lines in 7 files covered. (100.0%)

6 existing lines in 2 files now uncovered.

90976 of 126129 relevant lines covered (72.13%)

131.07 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
83.54
-0.17% pkg/authserver/storage/redis.go
3
63.89
4.58% pkg/workloads/manager.go
Jobs
ID Job ID Ran Files Coverage
1 40946339513.1 29 Oct 2026 08:18PM UTC 987
72.13
GitHub Action Run
Source Files on build 40946339513
  • Tree
  • List 987
  • Changed 14
  • Source Changed 8
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40946339513
  • 22276ab0 on github
  • Prev Build on main (#40898763317)
  • Next Build on main (#40963107193)
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