feat: kbagent encrypt command + sync push plaintext fix - #117
Merged
Conversation
#116) Part A - New encrypt command: - encrypt values --project ALIAS --component-id ID --input JSON|@file|- - Validates #-prefix keys, string values, KBC:: passthrough - Supports inline JSON, file input, stdin pipe, and --output-file - Registered in permissions.py (write), wired in cli.py Part B - Security fix in sync push: - _encrypt_secrets_in_config() now raises KeboolaApiError on failure instead of silently falling back to plaintext - New --allow-plaintext-on-encrypt-failure escape hatch flag - Parameter flows through push -> push_all -> _push_create/_push_update Documentation: - context.py updated with encrypt section and sync push flag - CLAUDE.md All CLI Commands section updated - SKILL.md regenerated via make skill-gen Tests: 23 new tests (7 encrypt service, 9 encrypt CLI, 7 sync encrypt)
- New encrypt-workflow.md: pipe workflow, input formats, scope rules, common errors, sync push interaction - commands-reference.md: add encrypt section, sync push flag - SKILL.md: add triggers, workflow reference, description update
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.
Summary
Implements #116 (Parts A + B, skipping Part C per discussion).
kbagent encrypt valuescommand -- exposes Keboola Encryption API as a standalone CLI primitive for MCP tool call workflows where ciphertext must exist beforeupdate_config/create_configsync push--_encrypt_secrets_in_config()now fails hard on Encryption API errors instead of silently pushing plaintext secretsChanges
Part A --
kbagent encrypt valuesservices/encrypt_service.pycommands/encrypt.py--input(JSON/@file/stdin),--output-file(0600)cli.pypermissions.py"encrypt.values": "write"Part B -- Sync push fail-closed
services/sync_service.py_encrypt_secrets_in_config()raisesKeboolaApiErrorby defaultcommands/sync.py--allow-plaintext-on-encrypt-failureescape hatch flagDocumentation
context.py-- encrypt section + sync push flag docsCLAUDE.md-- All CLI Commands updatedSKILL.md-- regenerated viamake skill-genPart C -- Skipped
encrypt_values()signature stays as-is (project + component scope =ComponentSecure). Addingconfig_id/branch_typewould break config cloning and branch merging.Test plan
make checkpasses (1378 tests, lint, format, SKILL.md freshness)Closes #116