feat(rotation): 90-day policy, due runs wait for owner approval (CLI 0.16.0) (#270)

Every automatic secret older than the team's max age (90 days default) is
queued as one run in awaiting-approval. An owner/admin approves it on the
Rotation page or with `teams rotation-approve`; machine keys can queue but
never approve. logicsrc-rotate --queue (*/5 cron) runs approved runs with
propagate + health checks + rollback. rotation_auto_approve per team is the
paid automatic rotation add-on (off by default).

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sh1pt-actions-fleet[bot] 2026-10-29 04:36:26 +00:00 • committed by GitHub
parent 87bbc50423
commit 0f237cb6e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 407 additions and 24 deletions

View file

@ -824,3 +824,31 @@ export async function teamsRotateFromQueue(slug: string, options: FromQueueOptio
}
return reports;
}
/**
* The 90-day policy: ask the app to queue every automatic key older than the
* team's max age as one run. It waits for an owner or admin to approve it on the
* Rotation page (or `teams rotation-approve`), unless the team has the paid
* automatic rotation add-on; then `--from-queue --approve` rotates it.
*/
export async function teamsQueueDueAction(slug: string, options: { format?: OutputFormat } = {}) {
const { client } = authedClient();
const out = await client.queueDueRotation(slug);
if (options.format && options.format !== "table") return print(out, options.format), out;
if (!out.run) console.log(`Nothing in ${slug} is older than ${out.maxAgeDays} days.`);
else {
const verb = out.created ? "Queued" : "Already open";
console.log(`${verb}: run ${out.run.id}, ${out.run.keys.length} key(s) older than ${out.maxAgeDays} days, status ${out.run.status}.`);
if (out.run.status === "awaiting-approval") console.log(`Approve: https://app.logicsrc.com${out.approveUrl} or logicsrc teams rotation-approve ${slug} ${out.run.id}`);
}
return out;
}
/** An owner or admin approves a due run; the queue runner then rotates it. */
export async function teamsRotationApproveAction(slug: string, runId: string, options: { format?: OutputFormat } = {}) {
const { client } = authedClient();
const { run } = await client.approveRotationRun(slug, runId);
if (options.format && options.format !== "table") return print(run, options.format), run;
console.log(`Approved run ${run.id} (${run.keys.length} key(s)): status ${run.status}. The queue runner rotates it next.`);
return run;
}