export

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// UsersFileName name of the file with user info
	UsersFileName = "users.json"
	// RolesFileName name of the file with roles info
	RolesFileName = "roles.json"
	// LdapServersFileName name of the file with ldap servers
	LdapServersFileName = "ldap_servers.json"
	// LdapRoleMappingsFileName name of the file with ldap role mapping
	LdapRoleMappingsFileName = "ldap_role_mappings.json"
	// LdapTeamMappingsFileName name of the file with ldap team mappingj
	LdapTeamMappingsFileName = "ldap_team_mappings.json"
	// SamlIdpFileName name of the file about saml idp
	SamlIdpFileName = "saml_identity_providers.json"
	// SamlRoleMappingsFileName saml roles mapping file
	SamlRoleMappingsFileName = "saml_role_mappings.json"
	// SamlTeamMappingsFileName salm teams mapping file
	SamlTeamMappingsFileName = "saml_team_mappings.json"
	// TeamsFileName teams file
	TeamsFileName = "teams.json"
	// ProjectsFileName projects file
	ProjectsFileName = "projects.json"
	// QueriesFileName queries file
	QueriesFileName = "queries.xml"
	// PresetsDirName presets directory name
	PresetsDirName = "presets"
	// PresetsFileName presets file
	PresetsFileName = "presets.json"
	// InstallationFileName file
	InstallationFileName = "installation.json"
	// ResultsMappingFileName file
	ResultsMappingFileName = "results_mapping.csv"

	// DateTimeFormat the formal to use for DT
	DateTimeFormat = "2006-01-02-15-04-05"
)
View Source
const (
	// UsersOption represent users
	UsersOption = "users"
	// TeamsOption represent teams (groups)
	TeamsOption = "teams"
	// ResultsOption represent results (projects & data)
	ResultsOption = "triage"
	// ProjectsOption represent projects
	ProjectsOption = "projects"
	// QueriesOption represent custom queries
	QueriesOption = "queries"
	// PresetsOption represent presets
	PresetsOption = "presets"
)
View Source
const (
	InstallationEngineServiceName = "Checkmarx Engine Service"
)

Variables

This section is empty.

Functions

func ContainsEngine added in v1.2.0

func ContainsEngine(needle string, data []*common.InstallationMapping) bool

ContainsEngine returns true if already exists object filtered by name.

func CreateExportFileName

func CreateExportFileName(prefix, suffix, extension string, now time.Time) string

CreateExportFileName creates a file name with the format: {prefix}-yyyy-mm-dd-HH-MM-SS.{extension}

func GetOptions

func GetOptions() []string

func NewJSONDataSource added in v1.0.3

func NewJSONDataSource(obj interface{}) func() ([]byte, error)

func TransformEngineServers added in v1.2.0

func TransformEngineServers(servers []*rest.EngineServer) []*common.InstallationMapping

TransformEngineServers just for SAST distributed architecture just for 9.4 or higher.

func TransformSamlTeamMappings added in v1.0.3

func TransformSamlTeamMappings(samlTeamMappings []*rest.SamlTeamMapping, options TransformOptions) []*rest.SamlTeamMapping

TransformSamlTeamMappings updates team mapping in the context of flatten teams.

func TransformScanReport added in v1.0.3

func TransformScanReport(xml []byte, options TransformOptions) ([]byte, error)

TransformScanReport updates scan report in context of flatten teams.

func TransformTeams added in v1.0.3

func TransformTeams(teams []*rest.Team, options TransformOptions) []*rest.Team

TransformTeams flattens teams.

func TransformUsers added in v1.0.3

func TransformUsers(users []*rest.User, teams []*rest.Team, options TransformOptions) []*rest.User

TransformUsers reassigns users in the context of flatten teams. Note "teams" list passed must be the original, non-flattened, list

func TransformXMLInstallationMappings added in v1.2.0

func TransformXMLInstallationMappings(installationMappings *soap.GetInstallationSettingsResponse) []*common.InstallationMapping

TransformXMLInstallationMappings updates installation mapping.

Types

type Export

type Export struct {
	// contains filtered or unexported fields
}

func CreateExport

func CreateExport(prefix string, runTime time.Time) (Export, error)

CreateExport creates ExportProducer structure and temporary directory The caller is responsible for calling the Export.Clear function when it's done with the ExportProducer

func (*Export) AddFile

func (e *Export) AddFile(fileName string, data []byte) error

AddFile creates a file with the specified name and content in ExportProducer's temporary directory.

func (*Export) AddFileWithDataSource

func (e *Export) AddFileWithDataSource(fileName string, dataSource func() ([]byte, error)) error

AddFileWithDataSource creates the specified file with content provided by dataSource

func (*Export) Clean

func (e *Export) Clean() error

Clean removes ExportProducer's temporary directory and it's contents

func (*Export) CreateDir added in v1.0.4

func (e *Export) CreateDir(dirName string) error

CreateDir creates directory inside temp directory

func (*Export) CreateExportPackage

func (e *Export) CreateExportPackage(prefix, outputPath string) (string, string, error)

CreateExportPackage compresses and encrypts all files added so far

func (*Export) GetTmpDir

func (e *Export) GetTmpDir() string

type Exporter

type Exporter interface {
	AddFile(fileName string, data []byte) error
	AddFileWithDataSource(fileName string, dataSource func() ([]byte, error)) error
	CreateExportPackage(prefix, outputPath string) (string, string, error)
	Clean() error
	GetTmpDir() string
	CreateDir(dirName string) error
}

type TransformOptions added in v1.2.0

type TransformOptions struct {
	NestedTeams bool
}

Jump to

Keyboard shortcuts

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