-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
24,774 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
35 changes: 35 additions & 0 deletions
35
new-components/reporters/pdf/internal/reporter/reporter_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Package reporter of the pdf consumer implements a simple consumer for | ||
// applying a go-template to a smithy scan, converting the result to pdf and then | ||
// uploading the result to the S3 bucket passed as an argument | ||
// the consumer expects the environment variables | ||
// AWS_ACCESS_KEY_ID | ||
// AWS_SECRET_ACCESS_KEY | ||
// to be set along with the "bucket" and "region" arguments to be passed | ||
package reporter | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
v1 "github.com/smithy-security/smithy/api/proto/v1" | ||
|
||
playwright "github.com/smithy-security/smithy/pkg/playwright/mock" | ||
"github.com/smithy-security/smithy/pkg/testdata" | ||
) | ||
|
||
func Test_buildPdf(t *testing.T) { | ||
mockClient, err := playwright.NewMockClient() | ||
require.NoError(t, err) | ||
|
||
called := false | ||
expected := []byte("this is a pdf") | ||
mockClient.GetPDFOfPageCallBack = func(s1, s2 string) ([]byte, error) { | ||
called = true | ||
return expected, nil | ||
} | ||
_, result, err := buildPdf([]v1.EnrichedLaunchToolResponse{testdata.EnrichedLaunchToolResponse}, mockClient) | ||
require.NoError(t, err) | ||
require.Equal(t, called, true) | ||
require.Equal(t, result, expected) | ||
} |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
new-components/reporters/pdf/vendor/github.com/davecgh/go-spew/LICENSE
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
145 changes: 145 additions & 0 deletions
145
new-components/reporters/pdf/vendor/github.com/davecgh/go-spew/spew/bypass.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
new-components/reporters/pdf/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.