@geolonia/geonicdb-cli 0.5.0 → 0.6.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/README.md +5 -2
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -172,6 +172,7 @@ Displays the current authenticated user, token expiry, and active profile.
|
|
|
172
172
|
| `--origins <origins>` | Allowed origins (comma-separated, at least 1 required) |
|
|
173
173
|
| `--entity-types <types>` | Allowed entity types (comma-separated) |
|
|
174
174
|
| `--rate-limit <n>` | Rate limit (requests per minute) |
|
|
175
|
+
| `--dpop-required` | Require DPoP token binding (RFC 9449) |
|
|
175
176
|
| `--save` | Save the API key to profile config |
|
|
176
177
|
|
|
177
178
|
```bash
|
|
@@ -182,6 +183,8 @@ geonic me api-keys create --name my-app --scopes read:entities --save
|
|
|
182
183
|
geonic me api-keys create '{"name":"my-app","allowedScopes":["read:entities"]}'
|
|
183
184
|
```
|
|
184
185
|
|
|
186
|
+
`me api-keys list` output includes a `dpopRequired` field (boolean).
|
|
187
|
+
|
|
185
188
|
### entities — Manage context entities
|
|
186
189
|
|
|
187
190
|
| Subcommand | Description |
|
|
@@ -369,9 +372,9 @@ Temporal entityOperations query supports: `--aggr-methods`, `--aggr-period`.
|
|
|
369
372
|
| `admin api-keys update <keyId> [json]` | Update an API key |
|
|
370
373
|
| `admin api-keys delete <keyId>` | Delete an API key |
|
|
371
374
|
|
|
372
|
-
`admin api-keys list` supports `--tenant-id` to filter by tenant. `admin api-keys create` supports flag options: `--name`, `--scopes`, `--origins`, `--entity-types`, `--rate-limit`, `--tenant-id`, `--save`.
|
|
375
|
+
`admin api-keys list` supports `--tenant-id` to filter by tenant. `admin api-keys create` supports flag options: `--name`, `--scopes`, `--origins`, `--entity-types`, `--rate-limit`, `--dpop-required`, `--tenant-id`, `--save`. `admin api-keys update` supports `--name`, `--scopes`, `--origins`, `--entity-types`, `--rate-limit`, `--dpop-required` / `--no-dpop-required`.
|
|
373
376
|
|
|
374
|
-
**Note**: `allowedOrigins` must contain at least 1 item when specified. Use `*` to allow all origins. `allowedEntityTypes` is enforced at runtime — API key holders can only access entities of the specified types.
|
|
377
|
+
**Note**: `allowedOrigins` must contain at least 1 item when specified. Use `*` to allow all origins. `allowedEntityTypes` is enforced at runtime — API key holders can only access entities of the specified types. `admin api-keys list` / `admin api-keys get` output includes a `dpopRequired` field (boolean).
|
|
375
378
|
|
|
376
379
|
#### admin cadde
|
|
377
380
|
|
package/dist/index.js
CHANGED
|
@@ -1370,7 +1370,7 @@ function addMeApiKeysSubcommand(me) {
|
|
|
1370
1370
|
command: "geonic me api-keys list"
|
|
1371
1371
|
}
|
|
1372
1372
|
]);
|
|
1373
|
-
const create = apiKeys.command("create [json]").description("Create a new API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Allowed scopes (comma-separated)").option("--origins <origins>", "Allowed origins (comma-separated)").option("--entity-types <types>", "Allowed entity types (comma-separated)").option("--rate-limit <n>", "Rate limit per minute").option("--save", "Save the API key to config for automatic use").action(
|
|
1373
|
+
const create = apiKeys.command("create [json]").description("Create a new API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Allowed scopes (comma-separated)").option("--origins <origins>", "Allowed origins (comma-separated)").option("--entity-types <types>", "Allowed entity types (comma-separated)").option("--rate-limit <n>", "Rate limit per minute").option("--dpop-required", "Require DPoP token binding").option("--save", "Save the API key to config for automatic use").action(
|
|
1374
1374
|
withErrorHandler(async (json, _opts, cmd) => {
|
|
1375
1375
|
const opts = cmd.opts();
|
|
1376
1376
|
if (opts.origins !== void 0) {
|
|
@@ -1383,12 +1383,13 @@ function addMeApiKeysSubcommand(me) {
|
|
|
1383
1383
|
let body;
|
|
1384
1384
|
if (json) {
|
|
1385
1385
|
body = await parseJsonInput(json);
|
|
1386
|
-
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit) {
|
|
1386
|
+
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit || opts.dpopRequired !== void 0) {
|
|
1387
1387
|
const payload = {};
|
|
1388
1388
|
if (opts.name) payload.name = opts.name;
|
|
1389
1389
|
if (opts.scopes) payload.allowedScopes = opts.scopes.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1390
1390
|
if (opts.origins) payload.allowedOrigins = opts.origins.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1391
1391
|
if (opts.entityTypes) payload.allowedEntityTypes = opts.entityTypes.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1392
|
+
if (opts.dpopRequired !== void 0) payload.dpopRequired = opts.dpopRequired;
|
|
1392
1393
|
if (opts.rateLimit) {
|
|
1393
1394
|
const raw = opts.rateLimit.trim();
|
|
1394
1395
|
if (!/^\d+$/.test(raw)) {
|
|
@@ -1453,6 +1454,10 @@ function addMeApiKeysSubcommand(me) {
|
|
|
1453
1454
|
{
|
|
1454
1455
|
description: "Create an API key with rate limiting",
|
|
1455
1456
|
command: "geonic me api-keys create --name my-app --rate-limit 100"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
description: "Create an API key with DPoP required",
|
|
1460
|
+
command: "geonic me api-keys create --name my-app --dpop-required"
|
|
1456
1461
|
}
|
|
1457
1462
|
]);
|
|
1458
1463
|
const del = apiKeys.command("delete <keyId>").description("Delete an API key").action(
|
|
@@ -3363,6 +3368,7 @@ function buildBodyFromFlags(opts) {
|
|
|
3363
3368
|
}
|
|
3364
3369
|
payload.rateLimit = { perMinute };
|
|
3365
3370
|
}
|
|
3371
|
+
if (opts.dpopRequired !== void 0) payload.dpopRequired = opts.dpopRequired;
|
|
3366
3372
|
if (opts.tenantId) payload.tenantId = opts.tenantId;
|
|
3367
3373
|
return payload;
|
|
3368
3374
|
}
|
|
@@ -3408,14 +3414,14 @@ function registerApiKeysCommand(parent) {
|
|
|
3408
3414
|
command: "geonic admin api-keys get <key-id>"
|
|
3409
3415
|
}
|
|
3410
3416
|
]);
|
|
3411
|
-
const create = apiKeys.command("create [json]").description("Create a new API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Comma-separated scopes").option("--origins <origins>", "Comma-separated origins").option("--entity-types <types>", "Comma-separated entity types").option("--rate-limit <n>", "Rate limit per minute").option("--tenant-id <id>", "Tenant ID").option("--save", "Save the API key to profile config").action(
|
|
3417
|
+
const create = apiKeys.command("create [json]").description("Create a new API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Comma-separated scopes").option("--origins <origins>", "Comma-separated origins").option("--entity-types <types>", "Comma-separated entity types").option("--rate-limit <n>", "Rate limit per minute").option("--dpop-required", "Require DPoP token binding").option("--tenant-id <id>", "Tenant ID").option("--save", "Save the API key to profile config").action(
|
|
3412
3418
|
withErrorHandler(async (json, _opts, cmd) => {
|
|
3413
3419
|
const opts = cmd.opts();
|
|
3414
3420
|
validateOrigins(void 0, opts);
|
|
3415
3421
|
let body;
|
|
3416
3422
|
if (json) {
|
|
3417
3423
|
body = await parseJsonInput(json);
|
|
3418
|
-
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit || opts.tenantId) {
|
|
3424
|
+
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit || opts.dpopRequired !== void 0 || opts.tenantId) {
|
|
3419
3425
|
body = buildBodyFromFlags(opts);
|
|
3420
3426
|
} else {
|
|
3421
3427
|
body = await parseJsonInput();
|
|
@@ -3452,12 +3458,16 @@ function registerApiKeysCommand(parent) {
|
|
|
3452
3458
|
description: "Create an API key with flags",
|
|
3453
3459
|
command: "geonic admin api-keys create --name my-key --scopes entities:read,entities:write --origins '*'"
|
|
3454
3460
|
},
|
|
3461
|
+
{
|
|
3462
|
+
description: "Create an API key with DPoP required",
|
|
3463
|
+
command: "geonic admin api-keys create --name my-key --dpop-required"
|
|
3464
|
+
},
|
|
3455
3465
|
{
|
|
3456
3466
|
description: "Create an API key from JSON and save to config",
|
|
3457
3467
|
command: "geonic admin api-keys create @key.json --save"
|
|
3458
3468
|
}
|
|
3459
3469
|
]);
|
|
3460
|
-
const update = apiKeys.command("update <keyId> [json]").description("Update an API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Comma-separated scopes").option("--origins <origins>", "Comma-separated origins").option("--entity-types <types>", "Comma-separated entity types").option("--rate-limit <n>", "Rate limit per minute").action(
|
|
3470
|
+
const update = apiKeys.command("update <keyId> [json]").description("Update an API key").option("--name <name>", "Key name").option("--scopes <scopes>", "Comma-separated scopes").option("--origins <origins>", "Comma-separated origins").option("--entity-types <types>", "Comma-separated entity types").option("--rate-limit <n>", "Rate limit per minute").option("--dpop-required", "Require DPoP token binding").option("--no-dpop-required", "Disable DPoP token binding").action(
|
|
3461
3471
|
withErrorHandler(
|
|
3462
3472
|
async (keyId, json, _opts, cmd) => {
|
|
3463
3473
|
const opts = cmd.opts();
|
|
@@ -3465,7 +3475,7 @@ function registerApiKeysCommand(parent) {
|
|
|
3465
3475
|
let body;
|
|
3466
3476
|
if (json) {
|
|
3467
3477
|
body = await parseJsonInput(json);
|
|
3468
|
-
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit) {
|
|
3478
|
+
} else if (opts.name || opts.scopes || opts.origins || opts.entityTypes || opts.rateLimit || opts.dpopRequired !== void 0) {
|
|
3469
3479
|
body = buildBodyFromFlags(opts);
|
|
3470
3480
|
} else {
|
|
3471
3481
|
body = await parseJsonInput();
|
|
@@ -3488,6 +3498,14 @@ function registerApiKeysCommand(parent) {
|
|
|
3488
3498
|
description: "Update an API key name",
|
|
3489
3499
|
command: "geonic admin api-keys update <key-id> --name new-name"
|
|
3490
3500
|
},
|
|
3501
|
+
{
|
|
3502
|
+
description: "Enable DPoP requirement",
|
|
3503
|
+
command: "geonic admin api-keys update <key-id> --dpop-required"
|
|
3504
|
+
},
|
|
3505
|
+
{
|
|
3506
|
+
description: "Disable DPoP requirement",
|
|
3507
|
+
command: "geonic admin api-keys update <key-id> --no-dpop-required"
|
|
3508
|
+
},
|
|
3491
3509
|
{
|
|
3492
3510
|
description: "Update an API key from a JSON file",
|
|
3493
3511
|
command: "geonic admin api-keys update <key-id> @key.json"
|