Repository navigation
feat: scheduled grants with nodkey preapprove (part 1 of #108) - #112
Merged
Merged
Conversation
A tap now can approve a planned use of a secret or an SSH key: from a start time to an end time, for N uses. One grant record in the approval core holds all grants; "Approve N min" and ssh-grant grants use it with no use limit, so they do not change. - nodkey preapprove (--secret ... | --key --user --host ...) --from --until --uses, and nodkey preapprove --cancel ID - per-rule preapprove = true (off by default, refused on never rules) and the [preapprove] limits: max_ahead, max_open, max_uses, max_grants - each use sends the silent notice and counts toward the notice limits - grant_ended audit entry; grant_used via scheduled - DESIGN.md records the answers to open questions 1-6 of #108 Part 2 (Revoke button, message after a later Deny, not-used notice, stop notice) comes in a later pull request. Refs #108
This was referenced Oct 28, 2026
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.
Refs #108. This is part 1 of 2. It does not close the issue.
What it does
A tap can now approve a planned use of a secret or an SSH key: from a start time to an end time, for N uses. A job that runs later uses the grant without a tap.
ssh-grantgrants use the same record with no use limit, so they do not change. There is room for a login scope later; nothing for logins is built.nodkey preapprove (--secret NAME ... | --key K --user U --host H ...) --from T --until T --uses N [--reason TEXT], andnodkey preapprove --cancel ID(only the same client; an unknown ID and an ID of another client get the same answer).preapprove = trueon a rule (off by default, refused onask = "never"), and[preapprove]limits:max_ahead(7 days),max_open(8 h),max_uses(10),max_grants(5 per client).grant_endedaudit entry with the cause and the uses left.grant_usedhas a new via,scheduled./v1/preapproveand/v1/preapprove/cancel, strict decoding with caps.Part 2 (next pull request)
The Revoke button on the message, the change of the message after a later Deny, the "not used" notice, and the stop notice. The core already ends grants for these causes; part 2 adds what the phone shows.
Security review
The
security-revieweragent reviewed the change, then each round of fixes. No critical or high findings. All findings were fixed:grant_ended.approver_failed.grant_ended. Fixed.ssh-grant. The cancel waits at most 30 s. Tests do not hang when they fail. Tests for each fix.Tests
CI=true go test -race ./...passes on Go 1.27.1 and Go 1.26.0.go vet ./...andgolangci-lint run --build-tags e2eare clean.-count=20 -cpu 1,2,4.No new dependencies.