Skip to content

Commit

Permalink
fix: sensitive extraction on root resources (#76)
Browse files Browse the repository at this point in the history
* fix: sensitive extraction on root resources
  • Loading branch information
idoavrah authored May 29, 2024
1 parent 8a2d9fc commit cf23cdd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ With its latest version you can easily visualize the complete state tree, gainin

## Changelog (latest versions)

### Version 0.13.2
### Version 0.13

- [x] Added support for workspace switching
- [x] Added plan summary in the screen title
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "tftui"
version = "0.13.2"
version = "0.13.3"
description = "Terraform Textual User Interface"
authors = ["Ido Avraham"]
license = "Apache-2.0"
Expand Down
20 changes: 13 additions & 7 deletions tftui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ async def manipulate_resources(self, what_to_do: str) -> None:
await execute_async(
ApplicationGlobals.executable,
(what_to_do if what_to_do != "delete" else "state rm"),
".".join([node.data.submodule, node.data.name])
if node.data.submodule
else node.data.name,
(
".".join([node.data.submodule, node.data.name])
if node.data.submodule
else node.data.name
),
)

async def perform_action(self) -> None:
Expand Down Expand Up @@ -627,9 +629,11 @@ def action_fullscreen(self) -> None:
return
self.push_screen(
FullTextModal(
self.tree.current_node.data.contents
if self.switcher.current == "resource"
else self.plan.fulltext,
(
self.tree.current_node.data.contents
if self.switcher.current == "resource"
else self.plan.fulltext
),
self.switcher.current == "resource",
)
)
Expand All @@ -638,7 +642,9 @@ def action_fullscreen(self) -> None:
def action_sensitive(self) -> None:
if self.switcher.current != "resource":
return
fullname = f"{self.tree.current_node.data.submodule}.{self.tree.current_node.data.name}"
fullname = f"{self.tree.current_node.data.submodule}.{self.tree.current_node.data.name}".strip(
"."
)
if self.tree.current_node.data.contents is None:
self.notify("Unable to display sensitive contents", severity="warning")
else:
Expand Down

0 comments on commit cf23cdd

Please sign in to comment.