Repository navigation
feat(admin): operator commands for disputes across accounts and for the operator role (list, grant, revoke) - #225
Merged
Conversation
pviti
force-pushed
the
feature/admin-disputes-operators
branch
from
November 26, 2026 15:31
02d7f7b to
cba6393
Compare
pviti
force-pushed
the
feature/admin-webhooks-audit
branch
from
November 27, 2026 15:33
d3ed9c9 to
e76bf9a
Compare
pviti
force-pushed
the
feature/admin-disputes-operators
branch
from
November 27, 2026 15:34
cba6393 to
1f1dc5c
Compare
…he operator role rail0 admin disputes every dispute, by status, payment, chain, reason, time rail0 admin operators who holds the operator role rail0 admin operators grant give it, with --note and --expires (a duration or a time) rail0 admin operators revoke remove it, by the account's id grant and revoke need write mode, read the account and ask first naming it; a duplicate grant gets a hint of its own. Refused in agent mode like the rest of the group. rail0-go at the branch of commercelayer/rail0-go#98.
pviti
force-pushed
the
feature/admin-disputes-operators
branch
from
November 27, 2026 15:49
1f1dc5c to
e80104d
Compare
pviti
changed the base branch from
feature/admin-webhooks-audit
to
milestone/next
November 27, 2026 15:49
pviti
marked this pull request as ready for review
November 27, 2026 15:50
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.
go.modrequires the released rail0-go v1.12.0 (commercelayer/rail0-go#96 and commercelayer/rail0-go#98 are in it).What
Two more groups under
rail0 admin(OP8 and OP11 of the operator proposal).admin disputes--status,--payment,--chain,--reason,--from,--toadmin operatorsadmin operators grant <account>--noteand--expiresadmin operators revoke <account>Refused in agent mode like the rest of the group: the role is given and taken by a person at a terminal.
Decisions worth a look
grantandrevokeboth ask first, naming the account. They read the account, and the question says its name, its contact and, for a grant, what the role opens and until when.--yesskips it. They are the two most consequential writes of the group.--expirestakes a duration or a time:7d,12h, or an ISO-8601 instant. A duration is turned into an instant here, in UTC. A value not in the future is refused before anything is sent. A time-boxed grant typed as an absolute timestamp is easy to get wrong, hence the duration.revoketakes the account's id, not the grant's, as the gateway does and asadmin operatorslists it.disputes --reasonis checked against the dictionary the merchant commands already use (rail0 disputes reasons), likepayments dispute --reason.(expired), from the local clock); the JSON is the gateway's record, unchanged.Tests
gofmt,go vet ./...,go test ./...green;docs/clianddocs/manregenerated.cmd/admin_operators_test.go: the dispute filters and their three local refusals; the grant refused without write mode with nothing sent, the account read before the question, nothing granted without an answer, the note trimmed and the expiry worked out from7d, a bare grant sending neither; the revoke with the same three steps;parseGrantExpiry(durations, instants, a zone offset, six refusals); the question's wording, for a deactivated account too; the conflict hint.Checked against staging (test operator key, session revoked afterwards)
admin operators(two grants),admin disputes --status open,--reason,--chain,--pretty.write_mode_required; in write mode →revokeof the session's own account:422 self_revoke;granton an account that already holds the role:409; an unknown account:404;revokeon an account with no grant:404; the question at a terminal, answered no.unavailable_in_agent_mode.Not done live: no grant was created and none was revoked. The two successful paths are covered by the unit tests only.