secureframe

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedType = errors.New("unsupported type")
)

Functions

func ResourceID

func ResourceID(r Resourceable) string

Types

type AssertionData

type AssertionData struct {
	Tag  string        `json:"tag"`
	Type StringOrArray `json:"type"`
}

type AssertionResult

type AssertionResult struct {
	AssertionKey          string        `json:"assertionKey"`
	CreatedAt             string        `json:"createdAt"`
	Data                  AssertionData `json:"data"`
	DisabledJustification string        `json:"disabledJustification"`
	Enabled               bool          `json:"enabled"`
	Pass                  bool          `json:"pass"`
	Optional              bool          `json:"optional"`
	Resourceable          *Resourceable `json:"resourceable"`

	FailMessage string `json:"failMessage"`
}

type AssertionResults

type AssertionResults struct {
	Collection []AssertionResult `json:"collection"`
}

type Control

type Control struct {
	ID          string `json:"id"`
	Key         string `json:"key"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Report      report `json:"report"`
}

type ControlV2 added in v1.0.3

type ControlV2 struct {
	ID         string      `json:"id"`
	Frameworks []Framework `json:"frameworks"`
}

type Error

type Error struct {
	Message string
}

type Framework added in v1.0.3

type Framework struct {
	Key   string `json:"key"`
	Label string `json:"label"`
}

type Resourceable

type Resourceable struct {
	ID                string `json:"id"`
	DeviceName        string `json:"deviceName"`
	Email             string `json:"email"`
	RepositoryName    string `json:"repositoryName"`
	CompanyUserName   string `json:"companyUserName"`
	VendorName        string `json:"vendorName"`
	Account           string `json:"account"`
	CloudResourceType string `json:"cloudResourceType"`
	Region            string `json:"region"`

	ThirdPartyID string `json:"thirdPartyId"`
	Description  string `json:"description"`
	Name         string `json:"name"`
}

type StringOrArray added in v1.0.2

type StringOrArray []string

StringOrArray handles cases where the API can return a string or array of strings

func (*StringOrArray) String added in v1.0.2

func (sa *StringOrArray) String() string

func (*StringOrArray) UnmarshalJSON added in v1.0.2

func (sa *StringOrArray) UnmarshalJSON(data []byte) error

type Test

type Test struct {
	ID                            string `json:"id"`
	Key                           string `json:"key"`
	Description                   string `json:"description"`
	Enabled                       bool   `json:"enabled"`
	Pass                          bool   `json:"pass"`
	DisabledJustification         string `json:"disabledJustification"`
	PassedWithUploadJustification string `json:"passedWithUploadJustification"`
	Optional                      bool   `json:"optional"`

	// The following fields are only returned if getTest is called?
	AssertionKeys    []string         `json:"assertionKeys"`
	AssertionResults AssertionResults `json:"assertionResults"`
	Title            string           `json:"title"`
	EvidenceType     string           `json:"evidenceType"`

	V2 TestV2 `json:"testV2"`
}

func GetTests

func GetTests(ctx context.Context, companyID string, token string, reportKey string) ([]Test, error)

type TestV2

type TestV2 struct {
	ID            string        `json:"id"`
	Key           string        `json:"key"`
	Title         string        `json:"title"`
	Description   string        `json:"description"`
	AssertionKey  string        `json:"assertion_key"`
	AssertionData AssertionData `json:"assertionData"`
	ConditionKey  string        `json:"conditionKey"`

	Controls   []Control   `json:"controls"`
	ControlV2s []ControlV2 `json:"controlV2s"`

	TestDomain       string `json:"testDomain"`
	TestFunction     string `json:"testFunction"`
	TestType         string `json:"testType"`
	ResourceCategory string `json:"resourceCategory"`

	DetailedRemediationSteps string `json:"detailedRemediationSteps"`
	RecommendedAction        string `json:"recommendedAction"`

	AssertionResults *AssertionResults `json:"assertionResults"`

	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL