koigrid 0.26.0 → 0.28.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.28.0] — 2026-12-02
8
+
9
+ ### Added
10
+
11
+ - `--registry-aws-region <r> --registry-aws-role <arn>` on `koigrid apps deploy|registry` and `koigrid jobs create|update`:
12
+ pull a private ECR image without storing AWS keys. koigrid assumes that IAM role with the OIDC token of the app or job
13
+ (turn it on with `koigrid apps oidc <id> on` / `koigrid jobs oidc <id> on`) and mints a fresh ECR token on every deploy or run.
14
+
15
+ ## [0.27.0] — 2026-12-02
16
+
17
+ ### Added
18
+
19
+ - `koigrid jobs oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]`: OIDC identity for a cron job.
20
+ With it on, each run of a container job gets a fresh 1-hour token at `/var/run/secrets/koigrid/oidc-token`
21
+ (`AWS_WEB_IDENTITY_TOKEN_FILE`, plus `AWS_ROLE_ARN` when set), so the job reaches your AWS or GCP without static
22
+ keys. `token` issues one to test your trust policy.
23
+
7
24
  ## [0.26.0] — 2026-12-01
8
25
 
9
26
  ### 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]'] },
@@ -5,13 +5,16 @@ export function credencialRegistryDeFlags(a) {
5
5
  const registryAwsRegion = a.flags['registry-aws-region'];
6
6
  const registryAwsAccessKeyId = a.flags['registry-aws-key'];
7
7
  const registryAwsSecretKey = a.flags['registry-aws-secret'];
8
+ const registryAwsRoleArn = a.flags['registry-aws-role'];
9
+ if (registry && registryAwsRegion && registryAwsRoleArn && !registryAwsAccessKeyId && !registryAwsSecretKey)
10
+ return { registry, registryAwsRegion, registryAwsRoleArn };
8
11
  if (registry && registryUsername && registryPassword)
9
12
  return { registry, registryUsername, registryPassword };
10
13
  if (registry && registryAwsRegion && registryAwsAccessKeyId && registryAwsSecretKey)
11
14
  return { registry, registryAwsRegion, registryAwsAccessKeyId, registryAwsSecretKey };
12
- if (registry || registryUsername || registryPassword || registryAwsRegion || registryAwsAccessKeyId || registryAwsSecretKey) {
13
- throw new Error('incomplete registry credentials: --registry with (--registry-user + --registry-password) or (--registry-aws-region + --registry-aws-key + --registry-aws-secret)');
15
+ if (registry || registryUsername || registryPassword || registryAwsRegion || registryAwsAccessKeyId || registryAwsSecretKey || registryAwsRoleArn) {
16
+ throw new Error('incomplete registry credentials: --registry with (--registry-user + --registry-password), (--registry-aws-region + --registry-aws-key + --registry-aws-secret) or (--registry-aws-region + --registry-aws-role)');
14
17
  }
15
18
  return {};
16
19
  }
17
- export const AYUDA_REGISTRY = '[--registry <host> (--registry-user <u> --registry-password <p> | --registry-aws-region <r> --registry-aws-key <k> --registry-aws-secret <s>)]';
20
+ export const AYUDA_REGISTRY = '[--registry <host> (--registry-user <u> --registry-password <p> | --registry-aws-region <r> --registry-aws-key <k> --registry-aws-secret <s> | --registry-aws-region <r> --registry-aws-role <arn>)]';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koigrid",
3
- "version": "0.26.0",
3
+ "version": "0.28.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"