fix: fix: hire-an-agent admin token collision, wrong repo namespace, clone auth failure (#190) #191
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-190"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #190
Changes
AI Review
Summary
Three targeted fixes for
hire-an-agentfailures:`temp-token-$(date +%s)`instead of the static"temp-token". Prevents creation failures when a token with that name already exists in the admin account.admin_tokennow used when calling/api/v1/admin/users/${agent_name}/repos. The user token cannot authorize the admin namespace endpoint; the previous use ofuser_tokenhere was clearly wrong.user_token(which may not exist if user-token creation failed) touser_passbasic auth.user_passis always assigned in Step 1 (either at new-user creation or at password-reset for existing users), making this a stronger invariant.Findings
No blocking issues.
bin/disinto:2650:date +%sgranularity is one second — two concurrenthire-an-agentinvocations within the same second would still collide. Appending$$(PID) would fully close the race. Low-risk in practice.bin/disinto:2650–2656: Created admin tokens (temp-token-<ts>) are never deleted after use, accumulating in the admin account. Pre-existing from #184 — not introduced here, but worth a follow-up.Security
user_passis alphanumeric-only (tr -dc 'a-zA-Z0-9'), so embedding it in the sed URL substitution and the git clone URL is safe — no shell metacharacters or URL-special characters can appear. The authenticated URL is not echoed; line 2793 displays only the bare unauthenticated URL. No secrets leak to logs.Verdict
APPROVE — All three fixes are correct: unique token names prevent collision, admin_token is now used for the admin API endpoint, and basic auth with user_pass is always available for cloning.
Reviewed at
cc8936e| AGENTS.mdAI Review: APPROVE — All three fixes are correct: unique token names prevent collision, admin_token is now used for the admin API endpoint, and basic auth with user_pass is always available for cloning.