Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cloudsplaining/scan/statement_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from __future__ import annotations

import logging
from functools import cached_property
from typing import Any

from cached_property import cached_property
from policy_sentry.analysis.expand import determine_actions_to_expand
from policy_sentry.querying.actions import (
get_actions_matching_arn,
Expand Down Expand Up @@ -166,15 +166,15 @@ def has_not_resource_with_allow(self) -> bool:
return False

@cached_property
def expanded_actions(self) -> list[str] | None:
def expanded_actions(self) -> list[str]:
"""Expands the full list of allowed actions from the Policy/"""

if self.actions:
expanded: list[str] = determine_actions_to_expand(self.actions)
expanded.sort()
return expanded
if self.not_action:
return self.not_action_effective_actions
return self.not_action_effective_actions or []

raise Exception( # pragma: no cover
"The Policy should include either NotAction or Action in the statement."
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ requires-python = ">=3.10"
dependencies = [
"boto3>=1.40.0,<2.0.0",
"botocore>=1.40.0,<2.0.0",
"cached-property>=2.0.0,<3.0.0",
"click>=8.1.0,<9.0.0",
"click_option_group>=0.5.9,<0.6.0",
"jinja2>=3.1.0,<4.0.0",
"markdown>=3.9,<4.0",
"policy_sentry>=0.14.0,<0.15",
"pyyaml>=6.0.0,<7.0.0",
"schema>=0.7.0,<0.8.0",
Expand Down Expand Up @@ -100,7 +98,6 @@ disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = [
"schema",
"cached_property",
]
ignore_missing_imports = true

Expand Down
Loading