feat(control-plane): add org/project get+delete and repo grant list+remove · Entire
feat(control-plane): add org/project get+delete and repo grant list+remove
aed697d·
toothbrush·3w ago·4 files·+176 added/-12 removed
Consume the v1 CRUD-gap endpoints (entiredb #2122):
- entire org get|delete <name|ULID>
- entire project get|delete <name|ULID>
- entire grant repo list
- entire grant repo remove
(--provider/--provider-user-id or --grantee-type/--grantee-id)
Org/project args resolve friendly names via the shared resolveref helpers. The grantee-mode helper (renamed parseGranteeMode) and the provider/by-id remove form are now shared by project and repo. Repo args stay ULID-only for now — resolving a repo by name needs a project scope.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Sessions
a995fb3417fbView transcript
Changes
4
cmd/entire/cli
Mgrant.go+78/-8
Mgrant_test.go+18/-4
Morg.go+40
Mproject.go+40
43 unmodified lines
44
45
46
47
48
49
50
47
48
49
50
51
26 unmodified lines
78
79
80
81
82
83
84
85
86
87
88
89
169 unmodified lines
259
260
261
258
262
263
264
265
33 unmodified lines
299
300
301
298
302
303
304
305
306
1 unmodified line
308
309
310
306
311
312
313
314
315
311
316
317
318
319
22 unmodified lines
342
343
344
345
346
347
348
349
28 unmodified lines
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
43 unmodified lines
}
// newGrantCmd is the hidden `entire grant` command group: manage access
// grants and org membership on the Entire control plane. Surface follows
// what the Core API exposes per resource: org and project support
// add / list / remove, while repo supports only add (the API has no
// repo-grant list or revoke route yet). Surfaced via `entire labs`.
// grants and org membership on the Entire control plane. Org, project, and
// repo each support add / list / remove. Surfaced via `entire labs`.
// Grantees are addressed by their identity provider + provider user id
// (e.g. --provider github --provider-user-id 12345), matching the control
return []string{g.GranteeType, g.GranteeId, g.Role}
}
// repoGrantRow mirrors projectGrantRow; RepoGrant and ProjectGrant share the
// grantee-type/grantee/role shape, so both reuse projectGrantColumns.
func repoGrantRow(g coreapi.RepoGrant) []string {
return []string{g.GranteeType, g.GranteeId, g.Role}
}
// --- org membership -------------------------------------------------------
func newGrantOrgCmd() *cobra.Command {
```
```
// granteeMode names the two ways `grant project remove` can address a grantee.
// granteeMode names the two ways `grant project remove` / `grant repo remove`
// can address a grantee.
type granteeMode int
const (
granteeModeID // --grantee-type + --grantee-id
)
// projectGranteeMode validates that exactly one addressing mode was supplied
// parseGranteeMode validates that exactly one addressing mode was supplied
// and fully specified, returning which one. The two modes are mutually
// exclusive: a provider account (github + user id) hits the by-provider revoke
// route, while a ULID grantee hits the typed-id route that also covers org and
// team grantees.
func projectGranteeMode(provider, providerUserID, granteeType, granteeID string) (granteeMode, error) {
// End of content.