Files
renovate/lib/types
Jamie Tanna 7386ea49c4 refactor(host-rules): add an inherited trust tier
As part of looking to allow Inherit Config to manage Host Rules' grants,
we need to perform a prefactor to create an additional trust tier
between the global self-hosted administrator's config, and presets/repo
config.

The `find()` method already resolves sensitive fields - `headers`,
`enabled`, and the computed internal-host grant - a "trust tier" at a
time, so that the outcome cannot depend on how specific a rule from a
less trusted tier makes itself. The new `inherit` tier slots in between
the two we had:

- `headers` are applied untrusted first, then inherited, then the
  administrator's, so theirs still win outright
- `enabled` is taken from the administrator's rules, falling back to
  inherited config's, then a repository's
- an administrator's `allowInternal: false` acts as a veto: it is
  resolved before inherited config's rules, and clears the scoped
  and implicit grants too, so inherited config cannot re-grant the
  host in any shape by out-scoping it. Meanwhile any inherited rule
  naming a host in its `matchHost` - credentialed or not - now
  implicitly permits it, like the admin's own rules do

We introduce a separate field than `trusted` to avoid Inherit Config
gaining the same precedence as the admin themselves.

Co-authored-by: Claude Fable 5 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-09-10 14:52:01 +01:00
..
2024-07-25 15:28:16 +02:00
2026-09-10 14:52:01 +01:00