design

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AssettypeMedia = MediaType("application/vnd.assettype+json", func() {
	Reference(AssettypeType)
	Attributes(func() {
		Attribute("assettype")
		Attribute("name")
	})
	View("default", func() {
		Attribute("assettype")
		Attribute("name")
	})
})
View Source
var AssettypeMediaCollection = CollectionOf(AssettypeMedia)
View Source
var AssettypeType = Type("AssettypeType", func() {
	Attribute("assettype", String, func() {
		Example("DomainName")
	})
	Attribute("name", ArrayOf(String))
})
View Source
var CheckMediaData = MediaType("application/vnd.checkdata+json", func() {
	Attributes(func() {
		Attribute("id", UUID)
		Attribute("status", String)
		Attribute("target", String)
		Attribute("checktype_name", String)
		Attribute("image", String)
		Attribute("options", String)
		Attribute("report", String)
		Attribute("raw", String)
		Attribute("tag", String)
		Attribute("assettype", String)
		Required("id", "checktype_name", "target", "status")
	})

	View("default", func() {
		Attribute("id")
		Attribute("status")
		Attribute("target")
		Attribute("checktype_name")
		Attribute("image")
		Attribute("options")
		Attribute("report")
		Attribute("raw")
		Attribute("tag")
		Attribute("assettype")
	})
})
View Source
var ChecksMediaCollection = MediaType("application/vnd.checks+json", func() {
	Attributes(func() {
		Attribute("checks", ArrayOf(CheckMediaData))
		Required("checks")
	})

	View("default", func() {
		Attribute("checks")
	})
})
View Source
var ChecktypeMedia = MediaType("application/vnd.checktype+json", func() {
	Attributes(func() {
		Attribute("checktype", ChecktypeType)
		Required("checktype")
	})

	View("default", func() {
		Attribute("checktype")
	})
})

BUG: the type was "application/adevinta.vulcan.api.checktype+json" but we had to change it because Gorma was not correctly generating some function calls. We should investigate more about it.

View Source
var ChecktypeMediaCollection = MediaType("application/vnd.checktypes+json", func() {
	Attributes(func() {
		Attribute("checktypes", ArrayOf(ChecktypeType))
		Required("checktypes")
	})

	View("default", func() {
		Attribute("checktypes")
	})
})

BUG: the type was "application/adevinta.vulcan.api.checktypes+json" but we had to change it because Gorma was not correctly generating some function calls. We should investigate more about it.

View Source
var ChecktypeType = Type("ChecktypeType", func() {
	Attribute("id", UUID)
	Attribute("name", String, func() {
		MinLength(1)
		Example("nmap")
		Pattern("^[[:word:]]+")
	})
	Attribute("description", String, func() {
		MaxLength(255)
		Pattern("^[[:print:]]+")
	})
	Attribute("options", String, "Default configuration options for the Checktype. It should be in JSON format")
	Attribute("enabled", Boolean)
	Attribute("queue_name", String, "The queue name to be used by a check of this type")
	Attribute("timeout", Integer, "Specifies the maximum amount of time that the check should be running before it's killed")
	Attribute("image", String, "Image that needs to be pulled to run the Check of this type")
	Attribute("assets", ArrayOf(String), "List of the asset types that this checktype allows to be used against to")
	Attribute("required_vars", ArrayOf(String), "List of required vars that the agent must inject to a check using this checktype")
	Required("id", "name", "image")
})
View Source
var ChecktypesGroup = Type("ChecktypesGroup", func() {
	Attribute("name", String)
	Attribute("checktypes", ArrayOf(ScanChecktype))
})
View Source
var CreateScanMediaData = MediaType("application/vnd.createscandata+json", func() {
	Attribute("scan_id", UUID)
	View("default", func() {
		Attribute("scan_id")
	})
})
View Source
var ScanChecktype = Type("ScanChecktype", func() {
	Attribute("name", String)
	Attribute("options", String)
})
View Source
var ScanMediaCollection = MediaType("application/vnd.scans+json", func() {
	Attributes(func() {
		Attribute("scans", ArrayOf(ScanMediaData))
		Required("scans")
	})

	View("default", func() {
		Attribute("scans")
	})
})
View Source
var ScanMediaData = MediaType("application/vnd.scandata+json", func() {
	Attributes(func() {
		Attribute("id", UUID)
		Attribute("external_id", UUID)
		Attribute("status", String)
		Attribute("trigger", String)
		Attribute("scheduled_time", DateTime)
		Attribute("start_time", DateTime)
		Attribute("end_time", DateTime)
		Attribute("aborted_at", DateTime)
		Attribute("progress", Number)
		Attribute("check_count", Integer)
		Attribute("checks_created", Integer)
		Required("id", "status")
	})

	View("default", func() {
		Attribute("id")
		Attribute("status")
		Attribute("check_count", Integer)
	})
})
View Source
var ScanPayload = Type("ScanPayload", func() {
	Attribute("external_id", UUID)
	Attribute("scheduled_time", DateTime)
	Attribute("trigger", String)
	Attribute("tag", String)
	Attribute("target_groups", ArrayOf(ScanTargetsGroup))
})
View Source
var ScanTargetsGroup = Type("ScanTargetsGroup", func() {
	Attribute("target_group", TargetGroup)
	Attribute("checktypes_group", ChecktypesGroup)
})
View Source
var Stat = MediaType("application/vnd.stat+json", func() {
	Attributes(func() {
		Attribute("status", String)
		Attribute("total", Integer)
		Required("status", "total")
	})

	View("default", func() {
		Attribute("status")
		Attribute("total")
	})
})
View Source
var StatsMediaCollection = MediaType("application/vnd.stats+json", func() {
	Attributes(func() {
		Attribute("checks", ArrayOf(Stat))
		Required("checks")
	})

	View("default", func() {
		Attribute("checks")
	})
})
View Source
var Target = Type("Target", func() {
	Attribute("identifier", String)
	Attribute("type", String)
	Attribute("options", String)

})
View Source
var TargetGroup = Type("TargetGroup", func() {
	Attribute("name", String)
	Attribute("options", String)
	Attribute("targets", ArrayOf(Target))
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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