Skip to content

Commit

Permalink
Remove steampipe references from control templates. Closes #306 (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskrbasu authored Apr 5, 2024
1 parent 3eb3683 commit a6fb743
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions internal/controldisplay/formatter_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package controldisplay
import (
"context"
"fmt"
"github.com/turbot/pipe-fittings/app_specific"
"io"
"os"
"text/template"

"github.com/turbot/pipe-fittings/app_specific"

"github.com/spf13/viper"
"github.com/turbot/pipe-fittings/constants"
"github.com/turbot/pipe-fittings/utils"
Expand Down Expand Up @@ -51,7 +52,7 @@ func (tf TemplateFormatter) Format(ctx context.Context, tree *controlexecute.Exe
}
renderContext := TemplateRenderContext{
Constants: TemplateRenderConstants{
SteampipeVersion: app_specific.AppVersion.String(),
PowerpipeVersion: app_specific.AppVersion.String(),
WorkingDir: workingDirectory,
},
Config: TemplateRenderConfig{
Expand Down
2 changes: 1 addition & 1 deletion internal/controldisplay/template_render_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type TemplateRenderConfig struct {
}

type TemplateRenderConstants struct {
SteampipeVersion string
PowerpipeVersion string
WorkingDir string
}

Expand Down
8 changes: 4 additions & 4 deletions internal/controldisplay/templates/asff.json/output.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"Id": "{{ .Run.Control.FullName }}",
"ProductArn": "arn:aws:securityhub:{{ .GetDimensionValue "region" }}:{{ .GetDimensionValue "account_id" }}:product/{{ .GetDimensionValue "account_id" }}/default",
"ProductFields": {
"ProviderName": "Steampipe",
"ProviderVersion": "{{ render_context.Constants.SteampipeVersion }}"
"ProviderName": "Powerpipe",
"ProviderVersion": "{{ render_context.Constants.PowerpipeVersion }}"
},
"GeneratorId": "steampipe-{{ .Run.Control.ShortName }}",
"GeneratorId": "powerpipe-{{ .Run.Control.ShortName }}",
"AwsAccountId": "{{ .GetDimensionValue "account_id" }}",
"Types": [
"automated"
Expand All @@ -49,7 +49,7 @@
}
}{{ end -}}

{{/* mapping steampipe statuses with ASFF status values */}}
{{/* mapping powerpipe statuses with ASFF status values */}}
{{ define "statusmap" }}
{{- if eq . "ok" -}}
PASSED
Expand Down
2 changes: 1 addition & 1 deletion internal/controldisplay/templates/asff.json/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.1.0"
"version": "1.2.0"
}
6 changes: 3 additions & 3 deletions internal/controldisplay/templates/html/output.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">

<head>
<title>Steampipe Report</title>
<title>Powerpipe Report</title>
<style>
/**
{{- template "normalize_css" -}}
Expand All @@ -26,8 +26,8 @@
{{ range .Data.Root.Groups -}}
{{ template "root_group_template" . -}}
{{ end }}
<footer><em>Report run at <code>{{ .Data.StartTime.Format "2006-01-02 15:04:05" }}</code> using <a href="https://steampipe.io"
rel="nofollow"><code>Steampipe {{ .Constants.SteampipeVersion }}</code></a> in dir
<footer><em>Report run at <code>{{ .Data.StartTime.Format "2006-01-02 15:04:05" }}</code> using <a href="https://powerpipe.io"
rel="nofollow"><code>Steampipe {{ .Constants.PowerpipeVersion }}</code></a> in dir
<code>{{ .Constants.WorkingDir }}</code>.</em></footer>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion internal/controldisplay/templates/html/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.0.0"
"version": "1.1.0"
}
2 changes: 1 addition & 1 deletion internal/controldisplay/templates/md/output.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{ end }}

\
_Report run at `{{ .Data.StartTime.Format "2006-01-02 15:04:05" }}` using [`Steampipe {{ .Constants.SteampipeVersion }}`](https://steampipe.io) in dir `{{ .Constants.WorkingDir }}`._
_Report run at `{{ .Data.StartTime.Format "2006-01-02 15:04:05" }}` using [`Powerpipe {{ .Constants.PowerpipeVersion }}`](https://powerpipe.io) in dir `{{ .Constants.WorkingDir }}`._
{{ end }}

{{/* templates */}}
Expand Down
2 changes: 1 addition & 1 deletion internal/controldisplay/templates/md/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.0.0"
"version": "1.1.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">

<head>
<title>Steampipe Report</title>
<title>Powerpipe Report</title>
<style>
/**
/* */
Expand Down

0 comments on commit a6fb743

Please sign in to comment.