diff options
| author | dev <dev@example> | 2026-11-15 12:10:23 +0000 |
|---|---|---|
| committer | dev <dev@example> | 2026-11-15 12:10:23 +0000 |
| commit | 85b7fa7f8456c84f65a0d81b760c430098ae7fd8 (patch) | |
| tree | d941ae68672ff71d2181fcb1a0e168f9314f135c /.gitignore | |
| parent | 2e6dd4a8e9e5302efae6b7532f7f4609882fc21d (diff) | |
| download | access-control-85b7fa7f8456c84f65a0d81b760c430098ae7fd8.tar.gz access-control-85b7fa7f8456c84f65a0d81b760c430098ae7fd8.zip | |
Denials to the pusher: one line, and the reason moved to check
The person pushing used to get a sentence about a file they cannot read:
deny: bob holds write on team, but not on refs/heads/main; that ref needs write
It is true, and it is not theirs. The level they hold, the level the ref costs
and why are all facts about somebody else's configuration, and quoting them at a
terminal sends a colleague to a file that is not theirs to edit while telling a
monitor nothing the exit status did not. A refusal is now one line naming the
input it refused:
git-authz: permission denied [user=bob, obj=refs/heads/main]
git-authz: permission denied [obj=refs/heads/main] # no identity
and `check` is where whoever owns the policy reads the reason out, unchanged.
`authorize --explain` prints the same sentence in the hook's own seat, for the
operator who is already standing there.
The other two denials got the same treatment and a reclassification:
invalid policy file exit 3, for an unreadable policy and an unparsable one
alike - no path, no line number, no errno
invalid operation exit 3, was 1, for a stdin line that is not an update:
not three fields, not object ids, not a ref under refs/
Exit 3 now means "the host is broken, not this person" and covers both, which is
what the split was always for: no real git writes those lines, so a hook that
rejects one has a pipe, a wrapper or a debugging session behind it, not a pusher.
Nothing about enforcement changed - a non-zero pre-receive exit stops the push
either way - only which status it is and what the line says.
To keep the pusher's output to one line, policy_load writes its findings to
p->log, stderr by default and NULL for the hook and for authorize mode: the mode
is the audience, not the name it was reached by. check and validate still print
line numbers and errno, so nothing an operator needs has gone missing.
src/ and cmd/ are 1,488 non-blank lines. make strict, make test and
make sanitizer are clean - 128 assertions, up from 113, now pinning the exact
terse line, that a denial is one line, that no policy prose leaks to the pusher,
and that nothing of a rejected line is echoed back.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions
