diff options
| author | dev <dev@example> | 2026-11-15 11:28:47 +0000 |
|---|---|---|
| committer | dev <dev@example> | 2026-11-15 11:28:47 +0000 |
| commit | c2b95afc6aefbab69133a202cab95a50a2df82fc (patch) | |
| tree | 4788b1b9302ef77b244c4107de2f3da15982f303 /test/check.c | |
| parent | 5a9afae082f36812a2e7c9e61d8662628b798f41 (diff) | |
| download | access-control-c2b95afc6aefbab69133a202cab95a50a2df82fc.tar.gz access-control-c2b95afc6aefbab69133a202cab95a50a2df82fc.zip | |
Drop grant/revoke and validate's host-wiring checks
Two features out, to answer a size target: src/ and cmd/ go from 2,306
non-blank lines to 1,495.
`grant` and `revoke` were a convenience wrapper over a file that is a
read-only mount in production by design, so they sat outside the
enforcement path. src/edit.c is gone; both names now report an unknown
command with exit 64.
`validate` keeps the policy checks - parse errors with their line
numbers, an unreadable policy, the @all-whole-repo and not-readable-by-
the-git-account warnings - and stops cross-checking the machine around
it. The repository cross-check, hook/hooksPath, sshd, the git account's
shell and the key/htpasswd identity checks are deleted, along with
--root, --hook-dir, --gitconfig, --sshd-config, --passwd, --keys,
--htpasswd and --no-host; plain `validate` is what `validate --no-host`
used to be. The container's build gate and the test suite are updated to
match, since both called the removed flag.
Orphaned by the removals and deleted with them: authz_repo_reachable,
and authz_rule_validate's ref_ok parameter, which existed only so grant
could interleave its own ref-pattern test.
Surviving behaviour is unchanged. A 1,370-invocation differential run
against the pre-removal binary - the check matrix, every authorize path,
the hook reached through its own name, fake-git ancestry and HEAD,
policy-only validate, the failure modes - differs only in the usage text
that documented the removed surface. make strict, make test and
make sanitizer are all clean, with ASan and UBSan silent.
Also folded in from the same effort, since it touched the same files:
authz_rule_validate as the single grammar, rule_covers() as the single
answer for rule/ref coverage, vmsgv() behind the validate message tags,
one kv reader for gitconfig and sshd_config while both were still there,
and `sanitizer:` in the Makefile appending to CFLAGS rather than
replacing it.
Diffstat (limited to 'test/check.c')
| -rw-r--r-- | test/check.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/test/check.c b/test/check.c index 4db4b9e..4b9a093 100644 --- a/test/check.c +++ b/test/check.c @@ -142,19 +142,6 @@ static void test_scope_edges(void) expect_deny(&p, "bob", "web", LV_WRITE, "refs/heads/main", "but not on"); expect_deny(&p, "bob", "api", LV_WRITE, "refs/heads/dev", "no rule"); policy_free(&p); - - // reachable-by-nobody detection, which validate reports - rc = load_text(&p, "bob team write\n"); - CHECK_INT(rc, 0); - CHECK(authz_repo_reachable(&p, "team")); - CHECK(authz_repo_reachable(&p, "team.git")); - CHECK(!authz_repo_reachable(&p, "other")); - policy_free(&p); - - rc = load_text(&p, "bob * write\n"); - CHECK_INT(rc, 0); - CHECK(authz_repo_reachable(&p, "anything")); - policy_free(&p); } int main(void) |
