feat(database): write endpoints — add / update / delete - #183
Merged
Conversation
Wire add_database / update_database / delete_database via the shared kaswrite seam. update and delete are gated by the #109 confirmation prompt; add is reversible and not prompted. All three honour --dry-run (#132) and emit a #131 audit record; the password is redacted in both. update sends only the explicitly-set flags (keyed on cobra Changed). add_database takes no database_login — KAS generates it and the command prints it on success. The password key splits between actions: --password maps to database_password on add and to database_new_password on update (the same _new_password split the ftpuser/sambauser slices carry). delete_database's confirmation prompt uses the louder verb "permanently delete" because the action drops the database AND every row it contains — the loudest data-loss surface of the v0.2.0 write phase. The read path was extended to decode the in_progress flag the KAS API surfaces on every get_databases entry (new IN_PROGRESS column on the list view; appended to the singular detail when present). Existing read-side tests now pin against the refreshed d0123460 fixture snapshot. Closes #122
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
Wires
add_database/update_database/delete_databasevia the sharedkaswriteseam.updateanddeletegated by the feat(cli): destructive-write confirmation infrastructure (--yes / interactive prompt) #109 confirmation prompt;addis reversible and not prompted.--dry-run(feat(cli): --dry-run for write commands #132) and emit a feat(cli): structured write-action audit log #131 audit record. Password is redacted in both.updatesends only the explicitly-set flags (keyed on cobraChanged).add_databasetakes nodatabase_login— KAS generates it and the command prints it on success.Key asymmetries
--passwordmaps todatabase_passwordonadd,database_new_passwordonupdate(the same split ftpuser/sambauser carry).delete_databaseprompt verb is the louder"permanently delete"rather than the bare"delete"every other slice uses — the action drops the database AND every row it contains.Read-side extension
get_databasesdecoder picks up thein_progressflag the KAS API surfaces on every entry. NewIN_PROGRESScolumn on the list view; appended to the singular detail when non-empty. Existing read tests re-pin against the refreshedd0123460fixture snapshot.Closes #122