koigrid 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ All notable changes to the koigrid CLI are documented here. Format: [Keep a Chan
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.27.0] — 2026-12-02
8
+
9
+ ### Added
10
+
11
+ - `koigrid jobs oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]`: OIDC identity for a cron job.
12
+ With it on, each run of a container job gets a fresh 1-hour token at `/var/run/secrets/koigrid/oidc-token`
13
+ (`AWS_WEB_IDENTITY_TOKEN_FILE`, plus `AWS_ROLE_ARN` when set), so the job reaches your AWS or GCP without static
14
+ keys. `token` issues one to test your trust policy.
15
+
16
+ ## [0.26.0] — 2026-12-01
17
+
18
+ ### Added
19
+
20
+ - `koigrid apps oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]`: the app's OIDC identity, so it
21
+ can reach your AWS or GCP without static cloud keys. `on` enables it, `show` prints the issuer and subject to trust in
22
+ your cloud, and `token` issues a 1-hour token to test `aws sts assume-role-with-web-identity`.
23
+
7
24
  ## [0.25.0] — 2026-11-30
8
25
 
9
26
  ### Changed
@@ -584,6 +584,31 @@ export async function apps(a) {
584
584
  const r = await api(`/apps/${encodeURIComponent(id)}/retention`, { method: 'PUT', body: { keepLast } });
585
585
  return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Retention: keep last ${r.retention?.keepLast ?? 'all'}${r.pruned ? ` (pruned ${r.pruned})` : ''}`));
586
586
  }
587
+ case 'oidc': {
588
+ // Identidad OIDC de la app (ficha ef39289f): koigrid como emisor para entrar en la nube del cliente sin claves fijas.
589
+ need(' [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
590
+ const act = a.positionals[1] || 'show';
591
+ const base = `/apps/${encodeURIComponent(id)}/oidc`;
592
+ if (act === 'token') {
593
+ const r = await api(`/apps/${encodeURIComponent(id)}/oidc/token`, { method: 'POST' });
594
+ return console.log(json ? JSON.stringify(r, null, 2) : r.token);
595
+ }
596
+ if (act === 'show' && a.flags.audience === undefined && a.flags['role-arn'] === undefined) {
597
+ const r = await api(base);
598
+ return console.log(json ? JSON.stringify(r, null, 2) : `oidc: ${r.oidc?.enabled ? 'on' : 'off'}\nissuer: ${r.oidc?.issuer}\nsubject: ${r.oidc?.subject}\naudience: ${r.oidc?.audience}${r.oidc?.roleArn ? `\nrole: ${r.oidc.roleArn}` : ''}`);
599
+ }
600
+ if (!['show', 'on', 'off'].includes(act))
601
+ throw new Error('usage: koigrid apps oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
602
+ const body = {};
603
+ if (act === 'on' || act === 'off')
604
+ body.enabled = act === 'on';
605
+ if (a.flags.audience !== undefined)
606
+ body.audience = a.flags.audience === 'default' ? null : String(a.flags.audience);
607
+ if (a.flags['role-arn'] !== undefined)
608
+ body.roleArn = a.flags['role-arn'] === 'none' ? null : String(a.flags['role-arn']);
609
+ const r = await api(base, { method: 'PUT', body });
610
+ return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ OIDC ${r.oidc?.enabled ? 'on' : 'off'} · issuer ${r.oidc?.issuer} · audience ${r.oidc?.audience}`));
611
+ }
587
612
  case 'protection': {
588
613
  need(' [show|password|ips|off]');
589
614
  const act = a.positionals[1] || 'show';
@@ -121,5 +121,33 @@ export async function jobs(a) {
121
121
  console.log(json ? JSON.stringify(r, null, 2) : green('✓ Job updated'));
122
122
  return;
123
123
  }
124
+ if (sub === 'oidc') {
125
+ // Identidad OIDC del job (ficha ce57ede9): cada ejecución recibe un token de 1 h para entrar en la nube del cliente sin
126
+ // claves fijas, como `koigrid apps oidc`.
127
+ const id = a.positionals[0];
128
+ if (!id)
129
+ throw new Error('usage: koigrid jobs oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
130
+ const act = a.positionals[1] || 'show';
131
+ const base = `/jobs/${encodeURIComponent(id)}/oidc`;
132
+ if (act === 'token') {
133
+ const r = await api(`/jobs/${encodeURIComponent(id)}/oidc/token`, { method: 'POST' });
134
+ return console.log(json ? JSON.stringify(r, null, 2) : r.token);
135
+ }
136
+ if (act === 'show' && a.flags.audience === undefined && a.flags['role-arn'] === undefined) {
137
+ const r = await api(base);
138
+ return console.log(json ? JSON.stringify(r, null, 2) : `oidc: ${r.oidc?.enabled ? 'on' : 'off'}\nissuer: ${r.oidc?.issuer}\nsubject: ${r.oidc?.subject}\naudience: ${r.oidc?.audience}${r.oidc?.roleArn ? `\nrole: ${r.oidc.roleArn}` : ''}${r.oidc && !r.oidc.appliesToRuns ? '\n(HTTP job: runs do not receive the token)' : ''}`);
139
+ }
140
+ if (!['show', 'on', 'off'].includes(act))
141
+ throw new Error('usage: koigrid jobs oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
142
+ const body = {};
143
+ if (act === 'on' || act === 'off')
144
+ body.enabled = act === 'on';
145
+ if (a.flags.audience !== undefined)
146
+ body.audience = a.flags.audience === 'default' ? null : String(a.flags.audience);
147
+ if (a.flags['role-arn'] !== undefined)
148
+ body.roleArn = a.flags['role-arn'] === 'none' ? null : String(a.flags['role-arn']);
149
+ const r = await api(base, { method: 'PUT', body });
150
+ return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ OIDC ${r.oidc?.enabled ? 'on' : 'off'} · issuer ${r.oidc?.issuer} · audience ${r.oidc?.audience}`));
151
+ }
124
152
  throw new Error(`unknown: jobs ${sub}`);
125
153
  }
package/dist/manifest.js CHANGED
@@ -26,13 +26,13 @@ export const CLI_COMMANDS = [
26
26
  same <slug>.apps… name; if your DNS has no ALIAS, CNAME www and redirect the root to www.
27
27
  move <domain> takes it from another of your apps, keeping its certificate. verify re-checks the DNS.`,
28
28
  },
29
- subs: ['ls', 'deploy', 'logs', 'http', 'requests', 'rm', 'rename', 'health-path', 'port', 'release', 'build-settings', 'traffic-ramp', 'max-surge', 'min-ready', 'deploy-analysis', 'scale', 'resize', 'autoscale', 'scale-out', 'env', 'domains', 'volumes', 'cdn', 'cache', 'protection', 'retention', 'github', 'github-repos', 'hooks', 'rollback', 'pause', 'resume', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle', 'registry', 'loadtest'],
30
- endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/http', 'apps/[id]/requests', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/scale-out', 'apps/[id]/env', 'apps/[id]/env/verify', 'apps/[id]/domains', 'apps/[id]/domains/verify', 'apps/[id]/volumes', 'apps/[id]/volumes/[volId]', 'apps/[id]/volumes/[volId]/backups', 'apps/[id]/volumes/[volId]/backups/[backupId]/restore', 'apps/[id]/cdn', 'apps/[id]/cache', 'apps/[id]/cache/purge', 'apps/[id]/protection', 'apps/[id]/protection/evaluate', 'apps/[id]/retention', 'apps/[id]/github', 'github/repos', 'apps/[id]/deploy-hooks', 'apps/[id]/deploy-hooks/[hookId]', 'apps/[id]/rollback', 'apps/[id]/pause', 'apps/[id]/resume', 'apps/[id]/restore', 'apps/[id]/migrate', 'apps/[id]/previews', 'apps/[id]/rules', 'apps/[id]/rules/[ruleId]', 'apps/[id]/registry', 'apps/[id]/loadtest'],
29
+ subs: ['ls', 'deploy', 'logs', 'http', 'requests', 'rm', 'rename', 'health-path', 'port', 'release', 'build-settings', 'traffic-ramp', 'max-surge', 'min-ready', 'deploy-analysis', 'scale', 'resize', 'autoscale', 'scale-out', 'env', 'domains', 'volumes', 'cdn', 'cache', 'protection', 'retention', 'oidc', 'github', 'github-repos', 'hooks', 'rollback', 'pause', 'resume', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle', 'registry', 'loadtest'],
30
+ endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/http', 'apps/[id]/requests', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/scale-out', 'apps/[id]/env', 'apps/[id]/env/verify', 'apps/[id]/domains', 'apps/[id]/domains/verify', 'apps/[id]/volumes', 'apps/[id]/volumes/[volId]', 'apps/[id]/volumes/[volId]/backups', 'apps/[id]/volumes/[volId]/backups/[backupId]/restore', 'apps/[id]/cdn', 'apps/[id]/cache', 'apps/[id]/cache/purge', 'apps/[id]/protection', 'apps/[id]/protection/evaluate', 'apps/[id]/retention', 'apps/[id]/oidc', 'apps/[id]/oidc/token', 'apps/[id]/github', 'github/repos', 'apps/[id]/deploy-hooks', 'apps/[id]/deploy-hooks/[hookId]', 'apps/[id]/rollback', 'apps/[id]/pause', 'apps/[id]/resume', 'apps/[id]/restore', 'apps/[id]/migrate', 'apps/[id]/previews', 'apps/[id]/rules', 'apps/[id]/rules/[ruleId]', 'apps/[id]/registry', 'apps/[id]/loadtest'],
31
31
  },
32
32
  { name: 'db', aliases: ['databases', 'database'], product: 'databases', summary: 'Managed Postgres (HA) — incl. SQL console (db query/tables) + branching (db branch) + managed restore (db restore-dump)', subs: ['ls', 'info', 'create', 'rm', 'rename', 'pause', 'resume', 'retention', 'weekly', 'monthly', 'url', 'connect', 'metrics', 'events', 'top-queries', 'slots', 'logs', 'backups', 'restore', 'restore-dump', 'fix-ownership', 'analyze', 'import', 'restore-status', 'ext', 'replicas', 'dr-copy', 'network', 'recovery-cert', 'backup-key', 'backup-access', 'pub', 'query', 'tables', 'branch', 'roles', 'params', 'pooler', 'rotation', 'patching', 'sync', 'slot-cap', 'resize', 'apply-config', 'maintenance', 'subs', 'data', 'rpc'], endpoints: ['databases', 'databases/[id]', 'databases/[id]/pause', 'databases/[id]/resume', 'databases/[id]/connection', 'databases/[id]/backups', 'databases/[id]/restore', 'databases/[id]/restore-dump', 'databases/[id]/restore-dump/upload-url', 'databases/[id]/restore-dump/[jobId]', 'databases/[id]/fix-ownership', 'databases/[id]/analyze', 'databases/[id]/metrics', 'databases/[id]/events', 'databases/[id]/queries', 'databases/[id]/replication-slots', 'databases/[id]/logs', 'databases/[id]/extensions', 'databases/[id]/replicas', 'databases/[id]/dr-copy', 'databases/[id]/network', 'databases/recovery-certificate', 'databases/[id]/backups/encryption-key', 'databases/[id]/backups/access', 'databases/[id]/publications', 'databases/[id]/subscriptions', 'databases/[id]/subscriptions/preflight', 'databases/[id]/subscriptions/verify', 'databases/[id]/subscriptions/verify/[verificationId]', 'databases/[id]/subscriptions/sync-sequences', 'databases/[id]/apply-config', 'databases/[id]/maintenance/apply', 'databases/[id]/maintenance/defer', 'databases/[id]/query', 'databases/[id]/branches', 'databases/[id]/branches/[branchId]', 'databases/[id]/branches/[branchId]/reset', 'databases/[id]/roles', 'databases/[id]/roles/[roleName]', 'databases/[id]/parameters', 'databases/[id]/pooler', 'databases/[id]/rotation', 'databases/[id]/rotation/rotate', 'databases/[id]/rotation/migrate', 'databases/[id]/data/[table]', 'databases/[id]/rpc/[fn]'] },
33
33
  { name: 'redis', aliases: ['cache'], product: 'cache', summary: 'Managed Redis (HA)', subs: ['apply-config', 'ls', 'create', 'rm', 'rename', 'resize', 'url', 'connect', 'metrics', 'backups', 'restore', 'dr-copy', 'network', 'password', 'maintenance'], endpoints: ['redis/[id]/apply-config', 'redis/[id]/maintenance/defer', 'redis/[id]/password', 'redis', 'redis/[id]', 'redis/[id]/connection', 'redis/[id]/backups', 'redis/[id]/restore', 'redis/[id]/metrics', 'redis/[id]/dr-copy', 'redis/[id]/network'] },
34
34
  { name: 'storage', aliases: ['buckets'], product: 'storage', summary: 'Object storage (S3): buckets, object browser (list/upload/download/delete), versioning + restore, public read (storage public)', subs: ['ls', 'create', 'rm', 'keys', 'key', 'key-scope', 'versions', 'restore', 'objects', 'upload-url', 'download-url', 'object-rm', 'replication', 'public'], endpoints: ['buckets', 'buckets/[id]', 'buckets/[id]/versions', 'buckets/[id]/objects', 'buckets/[id]/objects/upload-url', 'buckets/[id]/objects/download-url', 'buckets/[id]/public', 'storage/keys', 'storage/keys/[id]', 'storage/keys/[id]/scope'] },
35
- { name: 'jobs', aliases: ['cron'], product: 'jobs', summary: 'Cron / scheduled jobs', subs: ['ls', 'create', 'update', 'rm', 'trigger', 'runs'], endpoints: ['jobs', 'jobs/[id]', 'jobs/[id]/runs', 'jobs/[id]/trigger'] },
35
+ { name: 'jobs', aliases: ['cron'], product: 'jobs', summary: 'Cron / scheduled jobs', subs: ['ls', 'create', 'update', 'rm', 'trigger', 'runs', 'oidc'], endpoints: ['jobs', 'jobs/[id]', 'jobs/[id]/runs', 'jobs/[id]/trigger', 'jobs/[id]/oidc', 'jobs/[id]/oidc/token'] },
36
36
  { name: 'events', aliases: ['activity'], product: 'observability', summary: 'Events and metrics', subs: ['ls', 'metrics'], endpoints: ['events', 'metrics'] },
37
37
  { name: 'links', aliases: ['link'], product: 'links', summary: 'Short links + QR (create, retarget, retire)', subs: ['ls', 'create', 'update', 'rm'], endpoints: ['links', 'links/[id]'] },
38
38
  { name: 'share', aliases: ['files'], product: 'share', summary: 'Share files behind an expiring link', subs: ['ls', 'upload', 'rm'], endpoints: ['share', 'share/[id]'] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koigrid",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "koigrid CLI — deploy apps, databases, redis, storage and more from your terminal (or your AI agent).",
5
5
  "bin": {
6
6
  "koigrid": "dist/index.js"