Repository navigation
feat: hidden kosli list rego-policies and kosli get rego-policy, read published Rego policies - #1260
Merged
Merged
Conversation
…f an org Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y command escapes the identifier the same way Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its versions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Claude finished @jumboduck's task in 1m 38s —— View job Follow-up review of commit 2036f0b
Previous findings — all three threads are resolved (author replies +
New issues in the changed lines: none found. The No inline comments needed this round. |
…ddress review findings - --version was read from KOSLI_VERSION, which often names the CLI version to install - print a version from the typed regopolicies.Version, so a null field shows as empty - build one URL in run() - test a missing --org and --api-token in both suites, and share one read fake Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mbevc1
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the CLI side of kosli-dev/server#7080 with the read endpoints the server already has (kosli-dev/server#7311). Follows
kosli publish rego-policy(#1256).What it does
kosli list rego-policies:GET /api/v2/rego-policies/{org}.--page/-n/--page-limit(fromaddListFlags),--search,--sort(sent assort_by),--sort-direction. As inlist environmentsandlist controls, the sort values are checked by the server, not the CLI.kosli get rego-policy IDENTIFIER:GET /api/v2/rego-policies/{org}/{identifier}.--policy-version N:GET .../versions/{n}.getonly reads. (publish rego-policyexits 1 on a version that is not valid, because there it is the outcome of the command.)Both commands:
--output jsonprints the server answer as it is; a 404 or 403 is shown in the server's words.Decisions worth a reviewer's attention
rego-policies/rego-policy, notlist policies --type rego/get policyas the #7080 draft says.get policyandlist policiesalready exist for environment policies, and #7079 made rego policies a separate entity; this matchespublish rego-policy.--policy-version, not--version. The CLI reads every flag fromKOSLI_<FLAG>, andKOSLI_VERSIONis often set to the CLI version to install (ourDockerfile.alpine, the docs,capture-managed). With--version, an exportedKOSLI_VERSION=2.38.0failed the command, andKOSLI_VERSION=2silently showed version 2.publish rego-policy, while the endpoints are behindis-server-side-evaluation-enabled.internal/regopolicies(ListURL,PolicyURL,VersionURL), sopublish,getandlistescape the identifier as one path segment and refuse"",.and..the same way. A refactor commit on its own.Not in this PR
Each needs server work first:
current, but_list_item()does not return it. kosli-dev/server#7379get rego-policy). The data layer can list versions; there is no route. kosli-dev/server#7381Testing
cmd/kosli/listRegoPolicies_test.go(11), a shared read fake,cmd/kosli/getRegoPolicy_test.go(16),internal/regopolicies/urls_test.go(4), all against stubbed servers.spec.jsonand the regeneratedcoverage.json.make test_integrationpasses (3585 tests, 53 skipped).make lint: 0 issues.is-server-side-evaluation-enabled.🤖 Generated with Claude Code