koigrid 0.26.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,15 @@ 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
+
7
16
  ## [0.26.0] — 2026-12-01
8
17
 
9
18
  ### Added
@@ -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
@@ -32,7 +32,7 @@ export const CLI_COMMANDS = [
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.26.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"