You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: jh registry registrator get and update (#29)
* registry add, update and config commands
* updated add update help section
* registry list cmd in one line, changed add and update to config add and update
* updated print messages for add and update registry
* added registry permission list, set and delete commands
* separate commands for admin user and group list and public user and group list
* updated helptext
* jh registry registrator config
* removed unwanted files
* resolved conflucts
* formatting
Copy file name to clipboardExpand all lines: CLAUDE.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The application follows a command-line interface pattern using the Cobra library
13
13
-**main.go**: Core CLI structure with command definitions and configuration management
14
14
-**auth.go**: OAuth2 device flow authentication with JWT token handling
15
15
-**datasets.go**: Dataset operations (list, download, upload, status) with REST API integration
16
-
-**registries.go**: Registry operations (list, config, add, update) with REST API integration
16
+
-**registries.go**: Registry operations (list, config, add, update, registrator) with REST API integration
17
17
-**packages.go**: Package operations (search, dependency) with REST API primary path (`/packages/info`), GraphQL fallback, and documentation API (`/docs/{registry}/{package}/stable/pkg.json`)
18
18
-**projects.go**: Project management using GraphQL API with user filtering
19
19
-**user.go**: User information retrieval using GraphQL API and REST API for listing users
@@ -45,12 +45,16 @@ The application follows a command-line interface pattern using the Cobra library
-`jh registry registrator`: Show registrator config by name; subcommand update accepts JSON via stdin or `--file`
48
50
-`jh package`: Package search and dependency (REST primary via `/packages/info`, GraphQL fallback; dependency data from `/docs/{registry}/{package}/stable/pkg.json`)
49
51
-`jh project`: Project management (list with GraphQL, supports user filtering)
-`jh admin credential list`: List all registry credentials (tokens, SSH keys, GitHub Apps); supports verbose mode
56
60
-`jh admin credential add`: Add a credential — subcommands: `token`, `ssh`, `github-app`; accepts JSON argument or stdin
@@ -143,6 +147,24 @@ go run . registry config add --file registry.json
143
147
144
148
# Update an existing registry (same JSON schema, same flags)
145
149
go run . registry config update --file registry.json
150
+
151
+
# Show registrator config for a registry
152
+
go run . registry registrator MyRegistry
153
+
154
+
# Update registrator config (JSON via stdin or --file)
155
+
echo'{
156
+
"enabled": true,
157
+
"email": "pkg@example.com",
158
+
"authorization": true,
159
+
"ssl_verify": true,
160
+
"registry_fork_url": null,
161
+
"registry_deps": ["General"]
162
+
}'| go run . registry registrator update MyRegistry
163
+
go run . registry registrator update MyRegistry --file registrator.json
164
+
165
+
# Get, edit, push back
166
+
go run . registry registrator MyRegistry > registrator.json
167
+
go run . registry registrator update MyRegistry --file registrator.json
146
168
```
147
169
148
170
### Test project and user operations
@@ -444,6 +466,10 @@ jh run setup
444
466
- Registry add/update commands (`jh registry config add` / `jh registry config update`) use REST API endpoint `/api/v1/registry/config/registry/{name}` (POST); the backend creates or updates based on whether the registry already exists
445
467
- Both commands accept the full registry JSON payload via `--file <path>` or stdin; the payload `name` field identifies the registry
446
468
- Registry add/update always poll `/api/v1/registry/config/registry/{name}/savestatus` every 3 seconds up to a 2-minute timeout
469
+
- Registry registrator command (`jh registry registrator <name>`) uses REST API endpoint `/api/v1/registry/config/registrator/{name}` (GET) and prints the full JSON response
470
+
- Registry registrator update command (`jh registry registrator update <name>`) uses REST API endpoint `/api/v1/registry/config/registrator/{name}` (POST); the registry name comes from the positional argument (`RegistratorInfo` has no `name` field)
471
+
- Registrator update validates that `"email"` is non-empty when `"enabled"` is true
472
+
- GET returns 404 "Registry not found" when no registrator has been configured for that registry yet
447
473
- Bundle provider type automatically sets `license_detect: false` in the payload
448
474
- Admin token list command (`jh admin token list`) uses REST API endpoint `/app/token/activelist` which requires appropriate permissions
449
475
- Token list output is concise by default (Subject, Created By, and Expired status only); use `--verbose` flag for detailed information (signature, creation date, expiration date with estimate indicator)
@@ -498,6 +524,12 @@ jh run setup
498
524
-`submitRegistry` POSTs to `/api/v1/registry/config/registry/{name}` with retry on 500s, then calls `pollRegistrySaveStatus()`
499
525
-`pollRegistrySaveStatus` GETs `/api/v1/registry/config/registry/{name}/savestatus` every 3 seconds up to a 2-minute deadline
-`getRegistrator` uses `apiGet` to GET `/api/v1/registry/config/registrator/{name}` and pretty-prints the JSON response
530
+
-`setRegistrator(server, name, filePath)` reads `RegistratorInfo` JSON from `--file` or stdin, validates `"email"` is set when `"enabled"` is true, then POSTs to `/api/v1/registry/config/registrator/{name}`
531
+
- No polling — the POST response is the final result
532
+
501
533
### Julia Credentials Management (`run.go`)
502
534
503
535
The Julia credentials system consists of three main functions:
0 commit comments