Repository navigation
Conversation
Native repository broker refusals (a push to another ref, another repository, a withdrawn binding, the per-session exchange limit) wrote nothing to the worker or repository-credentials log, and Git shows the Agent only the HTTP status (finding 2411). The broker now writes one repository-credentials.denied JSON line per refused request that carried a session credential: the code the Agent received, where it was refused, the operation once known, and the session ID, Namespace and repositoryRef. Unauthenticated challenge round trips stay silent. No bearer, token, URL or ref is logged.
… session A request for a repository that no binding names carries the session's Git credential but is refused before session lookup. Match the token it presents against open sessions (log attribution only) so its record names the session, and test a Bearer REST request on the Git-only route as request_refused.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review endedClawSweeper stopped reviewing this revision because the pull request closed. |
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(repository): log each native broker refusal for operators This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the native repository path, the repository broker refused pushes to another ref, requests for another repository, requests after the binding was withdrawn and requests over the per-session exchange limit without writing anything to the worker or the
repository-credentialscontainer log. Git shows the Agent only the HTTP status (for example a bare 503), so neither the Agent nor an operator could tell a withdrawal from a capacity refusal (finding 2411; the 4-request limit was documented in #3581). The OpenShell route already logsworker.openshell-git-deniedwith areasonCode.Change
transport/agent.ts: every refusal of a request that carried credentials emits onerepository-credentials.deniedrecord:status,reasonCode(the code the Agent received),reason(credential_refused,session_unavailable,capacity,request_refused,input_refused,not_dispatched,operation_conflictorservice_error),operation(the route category, such asgit-push, once known) and the session ID, Namespace andrepositoryRefwhen the credential matches an open session. Unauthenticated requests are Git's normal challenge round trip and stay silent. Records never carry the bearer, a token, a URL, a ref or a body.service.identify) matches only an open session's exact bearer digest. A request for a repository no binding names carries the session's Git credential but is refused before session lookup; the handler matches the presented token for log attribution only, so that record still names the session. Authentication itself is unchanged.runService(therepository-credentialsprocess composition) writes each record as one JSON line on stderr, next to its existingstarted/shutdownevents.Not changed: the Agent still sees the same statuses. Git displays only the status code, and telling a withdrawal apart from an unavailable owner at the broker would need the worker-to-broker use protocol to carry the refusal reason, which is a contract change; raised separately.
Verification
postgres-prepared-repository-git-broker.test.mjs(real broker, real worker owner, PostgreSQL, real withdrawal through the HTTP API): each refusal logs exactly one record with the expectedreason,reasonCode,operationand session identity: cold send (not_dispatched), mixed-ref push (input_refused), another repository / REST / GraphQL with the Git credential (credential_refused), REST with an API credential (request_refused), expired send window and the withdrawn fetch and discovery (not_dispatched). Successful clone, push, pull and an uncertain push log nothing. No record contains the bearer, the push ref or the repository name.repository-credentials-transport-bounds.test.mjs: the per-session exchange limit logscapacity/exchange-capacitywith the session ID.repository-credentials-service-loss.test.mjs: the forked productionrunServiceprocess writes the JSON line on stderr for a credentialed refusal, nothing for the unauthenticated challenge, and never the bearer.postgres-platformlane on a remote test VM: pass; localtsc --build, eslint and prettier clean.Risks
Low. Logging only; answers, statuses and authorization are unchanged. A misbehaving Agent can raise log volume by sending many refused requests, at the same rate it could already send them.