Skip to content

feat: Add support for custom guidance and appendices in HTML reports #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions cloudsplaining/output/dist/js/chunk-56fa57a3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cloudsplaining/output/dist/js/chunk-5e001255.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cloudsplaining/output/dist/js/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions cloudsplaining/output/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from jinja2 import Environment, FileSystemLoader

from cloudsplaining.bin.version import __version__
from cloudsplaining.shared.template_config import TemplateConfig

app_bundle_path = os.path.join(os.path.dirname(__file__), "dist", "js", "index.js")

Expand All @@ -30,6 +31,7 @@ def __init__(
self.report_generated_time = datetime.datetime.now().strftime("%Y-%m-%d")
self.minimize = minimize
self.results = f"var iam_data = {json.dumps(results, default=str)}"
self.template_config = TemplateConfig()

@property
def app_bundle(self) -> str:
Expand Down Expand Up @@ -73,6 +75,10 @@ def get_html_report(self) -> str:
account_name=self.account_name,
report_generated_time=str(self.report_generated_time),
cloudsplaining_version=__version__,
guidance_content=self.template_config.guidance_content,
appendices_content=self.template_config.appendices_content,
show_guidance_nav=self.template_config.show_guidance_nav,
show_appendices_nav=self.template_config.show_appendices_nav,
)
template_path = os.path.dirname(__file__)
env = Environment(loader=FileSystemLoader(template_path)) # noqa: S701
Expand Down
Loading