Check input schema (#33)

This commit is contained in:
Jonas Plum
2022-02-27 12:25:41 +01:00
committed by GitHub
parent 54312893a2
commit 338aba8342
38 changed files with 3221 additions and 1676 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
// Code generated from CAQLLexer.g4 by ANTLR 4.9.2. DO NOT EDIT.
// Code generated from CAQLLexer.g4 by ANTLR 4.9.3. DO NOT EDIT.
package parser

View File

@@ -1,4 +1,4 @@
// Code generated from CAQLParser.g4 by ANTLR 4.9.2. DO NOT EDIT.
// Code generated from CAQLParser.g4 by ANTLR 4.9.3. DO NOT EDIT.
package parser // CAQLParser
@@ -332,6 +332,9 @@ func (s *ParseContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Parse() (localctx IParseContext) {
this := p
_ = this
localctx = NewParseContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 0, CAQLParserRULE_parse)
@@ -587,6 +590,9 @@ func (p *CAQLParser) Expression() (localctx IExpressionContext) {
}
func (p *CAQLParser) expression(_p int) (localctx IExpressionContext) {
this := p
_ = this
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
_parentState := p.GetState()
localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState)
@@ -1076,6 +1082,9 @@ func (s *Operator_unaryContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Operator_unary() (localctx IOperator_unaryContext) {
this := p
_ = this
localctx = NewOperator_unaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 4, CAQLParserRULE_operator_unary)
@@ -1264,6 +1273,9 @@ func (p *CAQLParser) Reference() (localctx IReferenceContext) {
}
func (p *CAQLParser) reference(_p int) (localctx IReferenceContext) {
this := p
_ = this
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
_parentState := p.GetState()
localctx = NewReferenceContext(p, p.GetParserRuleContext(), _parentState)
@@ -1469,6 +1481,9 @@ func (s *Compound_valueContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Compound_value() (localctx ICompound_valueContext) {
this := p
_ = this
localctx = NewCompound_valueContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 8, CAQLParserRULE_compound_value)
@@ -1614,6 +1629,9 @@ func (s *Function_callContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Function_call() (localctx IFunction_callContext) {
this := p
_ = this
localctx = NewFunction_callContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 10, CAQLParserRULE_function_call)
var _la int
@@ -1778,6 +1796,9 @@ func (s *Value_literalContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Value_literal() (localctx IValue_literalContext) {
this := p
_ = this
localctx = NewValue_literalContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 12, CAQLParserRULE_value_literal)
var _la int
@@ -1912,6 +1933,9 @@ func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Array() (localctx IArrayContext) {
this := p
_ = this
localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 14, CAQLParserRULE_array)
var _la int
@@ -2087,6 +2111,9 @@ func (s *ObjectContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Object() (localctx IObjectContext) {
this := p
_ = this
localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 16, CAQLParserRULE_object)
var _la int
@@ -2272,6 +2299,9 @@ func (s *Object_elementContext) ExitRule(listener antlr.ParseTreeListener) {
}
func (p *CAQLParser) Object_element() (localctx IObject_elementContext) {
this := p
_ = this
localctx = NewObject_elementContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, CAQLParserRULE_object_element)
@@ -2409,6 +2439,9 @@ func (s *Object_element_nameContext) ExitRule(listener antlr.ParseTreeListener)
}
func (p *CAQLParser) Object_element_name() (localctx IObject_element_nameContext) {
this := p
_ = this
localctx = NewObject_element_nameContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 20, CAQLParserRULE_object_element_name)
var _la int
@@ -2467,6 +2500,9 @@ func (p *CAQLParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex in
}
func (p *CAQLParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool {
this := p
_ = this
switch predIndex {
case 0:
return p.Precpred(p.GetParserRuleContext(), 13)
@@ -2513,6 +2549,9 @@ func (p *CAQLParser) Expression_Sempred(localctx antlr.RuleContext, predIndex in
}
func (p *CAQLParser) Reference_Sempred(localctx antlr.RuleContext, predIndex int) bool {
this := p
_ = this
switch predIndex {
case 13:
return p.Precpred(p.GetParserRuleContext(), 2)

View File

@@ -1,4 +1,4 @@
// Code generated from CAQLParser.g4 by ANTLR 4.9.2. DO NOT EDIT.
// Code generated from CAQLParser.g4 by ANTLR 4.9.3. DO NOT EDIT.
package parser // CAQLParser

View File

@@ -1,4 +1,4 @@
// Code generated from CAQLParser.g4 by ANTLR 4.9.2. DO NOT EDIT.
// Code generated from CAQLParser.g4 by ANTLR 4.9.3. DO NOT EDIT.
package parser // CAQLParser

View File

@@ -659,7 +659,7 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Job"
"$ref" : "#/components/schemas/JobUpdate"
}
}
},
@@ -3404,7 +3404,7 @@
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}" : {
"put" : {
"operationId" : "setTask",
"operationId" : "setTaskData",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
@@ -3438,11 +3438,11 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Task"
"type" : "object"
}
}
},
"description" : "Task",
"description" : "Task data",
"required" : true
},
"responses" : {
@@ -3628,9 +3628,9 @@
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task",
"summary" : "Set a ticket playbook task data",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "task"
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete" : {
@@ -3865,6 +3865,235 @@
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner" : {
"put" : {
"operationId" : "setTaskOwner",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
"in" : "path",
"name" : "id",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
}
}, {
"description" : "Playbook ID",
"example" : "phishing",
"in" : "path",
"name" : "playbookID",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"description" : "Task ID",
"example" : "board",
"in" : "path",
"name" : "taskID",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "string"
}
}
},
"description" : "Task owner",
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/TicketWithTickets"
}
},
"test" : {
"example" : {
"artifacts" : [ {
"name" : "94d5cab6f5fe3422a447ab15436e7a672bc0c09a",
"status" : "unknown"
}, {
"name" : "http://www.customerviral.io/scalable/vertical/killer",
"status" : "clean"
}, {
"name" : "leadreintermediate.io",
"status" : "malicious"
} ],
"created" : "2021-10-02T16:04:59.078+0000",
"id" : 8123,
"modified" : "2021-12-12T12:12:12.000+0000",
"name" : "live zebra",
"owner" : "demo",
"playbooks" : {
"phishing" : {
"name" : "Phishing",
"tasks" : {
"block-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block IOCs",
"order" : 6,
"type" : "task"
},
"block-sender" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block sender",
"next" : {
"extract-iocs" : ""
},
"order" : 3,
"type" : "task"
},
"board" : {
"active" : true,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Board Involvement?",
"next" : {
"escalate" : "boardInvolved == true",
"mail-available" : "boardInvolved == false"
},
"order" : 0,
"owner" : "eve",
"schema" : {
"properties" : {
"boardInvolved" : {
"default" : false,
"title" : "A board member is involved.",
"type" : "boolean"
}
},
"required" : [ "boardInvolved" ],
"title" : "Board Involvement?",
"type" : "object"
},
"type" : "input"
},
"escalate" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Escalate to CISO",
"order" : 1,
"type" : "task"
},
"extract-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Extract IOCs",
"next" : {
"block-iocs" : ""
},
"order" : 5,
"schema" : {
"properties" : {
"iocs" : {
"items" : {
"type" : "string"
},
"title" : "IOCs",
"type" : "array"
}
},
"title" : "Extract IOCs",
"type" : "object"
},
"type" : "input"
},
"mail-available" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Mail available",
"next" : {
"block-sender" : "schemaKey == 'yes'",
"extract-iocs" : "schemaKey == 'yes'",
"search-email-gateway" : "schemaKey == 'no'"
},
"order" : 2,
"schema" : {
"oneOf" : [ {
"properties" : {
"mail" : {
"title" : "Mail",
"type" : "string",
"x-display" : "textarea"
},
"schemaKey" : {
"const" : "yes",
"type" : "string"
}
},
"required" : [ "mail" ],
"title" : "Yes"
}, {
"properties" : {
"schemaKey" : {
"const" : "no",
"type" : "string"
}
},
"title" : "No"
} ],
"title" : "Mail available",
"type" : "object"
},
"type" : "input"
},
"search-email-gateway" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Search email gateway",
"next" : {
"extract-iocs" : ""
},
"order" : 4,
"type" : "task"
}
}
}
},
"references" : [ {
"href" : "https://www.leadmaximize.net/e-services/back-end",
"name" : "performance"
}, {
"href" : "http://www.corporateinteractive.name/rich",
"name" : "autumn"
}, {
"href" : "https://www.corporateintuitive.org/intuitive/platforms/integrate",
"name" : "suggest"
} ],
"schema" : "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n",
"status" : "closed",
"type" : "incident"
}
}
},
"description" : "successful operation"
}
},
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task owner",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "owner"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run" : {
"post" : {
"operationId" : "runTask",
@@ -3928,10 +4157,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
"$ref" : "#/components/schemas/ReferenceArray"
}
}
},
@@ -4390,10 +4616,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
"$ref" : "#/components/schemas/TicketFormArray"
}
}
},
@@ -5295,6 +5518,28 @@
"required" : [ "automation", "id", "status" ],
"type" : "object"
},
"JobUpdate" : {
"properties" : {
"container" : {
"type" : "string"
},
"log" : {
"type" : "string"
},
"output" : {
"properties" : { },
"type" : "object"
},
"running" : {
"type" : "boolean"
},
"status" : {
"type" : "string"
}
},
"required" : [ "running", "status" ],
"type" : "object"
},
"Link" : {
"properties" : {
"id" : {
@@ -5478,6 +5723,12 @@
"required" : [ "href", "name" ],
"type" : "object"
},
"ReferenceArray" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
},
"Rule" : {
"properties" : {
"condition" : {
@@ -5655,62 +5906,6 @@
"required" : [ "created", "done", "name", "type" ],
"type" : "object"
},
"TaskForm" : {
"properties" : {
"automation" : {
"type" : "string"
},
"closed" : {
"format" : "date-time",
"type" : "string"
},
"created" : {
"format" : "date-time",
"type" : "string"
},
"data" : {
"properties" : { },
"type" : "object"
},
"done" : {
"type" : "boolean"
},
"join" : {
"example" : false,
"type" : "boolean"
},
"name" : {
"example" : "Inform user",
"type" : "string"
},
"next" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"owner" : {
"type" : "string"
},
"payload" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"schema" : {
"properties" : { },
"type" : "object"
},
"type" : {
"enum" : [ "task", "input", "automation" ],
"example" : "task",
"type" : "string"
}
},
"required" : [ "name", "type" ],
"type" : "object"
},
"TaskOrigin" : {
"properties" : {
"playbook_id" : {
@@ -5992,6 +6187,12 @@
"required" : [ "name", "status", "type" ],
"type" : "object"
},
"TicketFormArray" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
},
"TicketList" : {
"properties" : {
"count" : {

View File

@@ -288,6 +288,22 @@ definitions:
- automation
- status
type: object
JobUpdate:
properties:
container:
type: string
log:
type: string
output:
type: object
running:
type: boolean
status:
type: string
required:
- running
- status
type: object
Link:
properties:
id:
@@ -435,6 +451,10 @@ definitions:
- name
- href
type: object
ReferenceArray:
items:
$ref: '#/definitions/Reference'
type: array
Rule:
properties:
condition:
@@ -584,51 +604,6 @@ definitions:
- done
- created
type: object
TaskForm:
properties:
automation:
type: string
closed:
example: 1985-04-12T23:20:50.52Z
format: date-time
type: string
created:
example: 1985-04-12T23:20:50.52Z
format: date-time
type: string
data:
type: object
done:
type: boolean
join:
example: false
type: boolean
name:
example: Inform user
type: string
next:
additionalProperties:
type: string
type: object
owner:
type: string
payload:
additionalProperties:
type: string
type: object
schema:
type: object
type:
enum:
- task
- input
- automation
example: task
type: string
required:
- name
- type
type: object
TaskOrigin:
properties:
playbook_id:
@@ -861,6 +836,10 @@ definitions:
- type
- status
type: object
TicketFormArray:
items:
$ref: '#/definitions/TicketForm'
type: array
TicketList:
properties:
count:
@@ -1899,11 +1878,9 @@ paths:
name: job
required: true
schema:
$ref: '#/definitions/Job'
$ref: '#/definitions/JobUpdate'
x-example:
automation: hash.sha1
id: 99cd67131b48
payload: test
running: false
status: failed
responses:
"200":
@@ -5465,7 +5442,7 @@ paths:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}:
put:
operationId: setTask
operationId: setTaskData
parameters:
- description: Ticket ID
format: int64
@@ -5486,33 +5463,14 @@ paths:
required: true
type: string
x-example: board
- description: Task
- description: Task data
in: body
name: task
name: data
required: true
schema:
$ref: '#/definitions/Task'
type: object
x-example:
active: true
data:
boardInvolved: true
done: false
name: Board Involvement?
next:
escalate: boardInvolved == true
mail-available: boardInvolved == false
order: 0
schema:
properties:
boardInvolved:
default: false
title: A board member is involved.
type: boolean
required:
- boardInvolved
title: Board Involvement?
type: object
type: input
boardInvolved: true
responses:
"200":
description: successful operation
@@ -5742,7 +5700,7 @@ paths:
security:
- roles:
- ticket:write
summary: Set a ticket playbook task
summary: Set a ticket playbook task data
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete:
@@ -6009,6 +5967,267 @@ paths:
summary: Complete ticket playbook task
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner:
put:
operationId: setTaskOwner
parameters:
- description: Ticket ID
format: int64
in: path
name: id
required: true
type: integer
x-example: 8123
- description: Playbook ID
in: path
name: playbookID
required: true
type: string
x-example: phishing
- description: Task ID
in: path
name: taskID
required: true
type: string
x-example: board
- description: Task owner
in: body
name: owner
required: true
schema:
type: string
x-example: eve
responses:
"200":
description: successful operation
examples:
test:
artifacts:
- name: 94d5cab6f5fe3422a447ab15436e7a672bc0c09a
status: unknown
- name: http://www.customerviral.io/scalable/vertical/killer
status: clean
- name: leadreintermediate.io
status: malicious
created: 2021-10-02T16:04:59.078206Z
id: 8123
modified: 2021-12-12T12:12:12.000000012Z
name: live zebra
owner: demo
playbooks:
phishing:
name: Phishing
tasks:
block-iocs:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Block IOCs
order: 6
type: task
block-sender:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Block sender
next:
extract-iocs: ""
order: 3
type: task
board:
active: true
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Board Involvement?
next:
escalate: boardInvolved == true
mail-available: boardInvolved == false
order: 0
owner: eve
schema:
properties:
boardInvolved:
default: false
title: A board member is involved.
type: boolean
required:
- boardInvolved
title: Board Involvement?
type: object
type: input
escalate:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Escalate to CISO
order: 1
type: task
extract-iocs:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Extract IOCs
next:
block-iocs: ""
order: 5
schema:
properties:
iocs:
items:
type: string
title: IOCs
type: array
title: Extract IOCs
type: object
type: input
mail-available:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Mail available
next:
block-sender: schemaKey == 'yes'
extract-iocs: schemaKey == 'yes'
search-email-gateway: schemaKey == 'no'
order: 2
schema:
oneOf:
- properties:
mail:
title: Mail
type: string
x-display: textarea
schemaKey:
const: "yes"
type: string
required:
- mail
title: "Yes"
- properties:
schemaKey:
const: "no"
type: string
title: "No"
title: Mail available
type: object
type: input
search-email-gateway:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Search email gateway
next:
extract-iocs: ""
order: 4
type: task
references:
- href: https://www.leadmaximize.net/e-services/back-end
name: performance
- href: http://www.corporateinteractive.name/rich
name: autumn
- href: https://www.corporateintuitive.org/intuitive/platforms/integrate
name: suggest
schema: |
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1618746510.json",
"title": "Event",
"type": "object",
"required": [
"severity",
"description",
"tlp"
],
"properties": {
"severity": {
"$id": "#root/severity",
"title": "Severity",
"type": "string",
"default": "Medium",
"nx-enum": [
"Low",
"Medium",
"High"
],
"x-cols": 6,
"x-class": "pr-2",
"x-display": "icon",
"x-itemIcon": "icon",
"oneOf": [
{
"const": "Low",
"title": "Low",
"icon": "mdi-chevron-up"
},
{
"const": "Medium",
"title": "Medium",
"icon": "mdi-chevron-double-up"
},
{
"const": "High",
"title": "High",
"icon": "mdi-chevron-triple-up"
}
]
},
"tlp": {
"$id": "#root/tlp",
"title": "TLP",
"type": "string",
"nx-enum": [
"White",
"Green",
"Amber",
"Red"
],
"x-cols": 6,
"x-class": "pr-2",
"x-display": "icon",
"x-itemIcon": "icon",
"oneOf": [
{
"const": "White",
"title": "White",
"icon": "mdi-alpha-w"
},
{
"const": "Green",
"title": "Green",
"icon": "mdi-alpha-g"
},
{
"const": "Amber",
"title": "Amber",
"icon": "mdi-alpha-a"
},
{
"const": "Red",
"title": "Red",
"icon": "mdi-alpha-r"
}
]
},
"description": {
"$id": "#root/description",
"title": "Description",
"type": "string",
"x-display": "textarea",
"x-class": "pr-2"
}
}
}
status: closed
type: incident
schema:
$ref: '#/definitions/TicketWithTickets'
security:
- roles:
- ticket:write
summary: Set a ticket playbook task owner
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run:
post:
operationId: runTask
@@ -6057,9 +6276,7 @@ paths:
name: references
required: true
schema:
items:
$ref: '#/definitions/Reference'
type: array
$ref: '#/definitions/ReferenceArray'
x-example:
- href: http://www.leadscalable.biz/envisioneer
name: fund
@@ -6486,9 +6703,7 @@ paths:
name: ticket
required: true
schema:
items:
$ref: '#/definitions/TicketForm'
type: array
$ref: '#/definitions/TicketFormArray'
x-example:
- id: 123
name: Wannacry infection
@@ -6825,6 +7040,8 @@ paths:
schema:
$ref: '#/definitions/UserForm'
x-example:
apikey: true
blocked: false
id: syncscript
roles:
- analyst
@@ -6939,6 +7156,9 @@ paths:
schema:
$ref: '#/definitions/UserForm'
x-example:
apikey: false
blocked: false
id: syncscript
roles:
- analyst
- admin

View File

@@ -427,7 +427,7 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Job"
"$ref" : "#/components/schemas/JobUpdate"
}
}
},
@@ -2974,7 +2974,7 @@
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}" : {
"put" : {
"operationId" : "setTask",
"operationId" : "setTaskData",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
@@ -3008,11 +3008,11 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Task"
"type" : "object"
}
}
},
"description" : "Task",
"description" : "Task data",
"required" : true
},
"responses" : {
@@ -3198,9 +3198,9 @@
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task",
"summary" : "Set a ticket playbook task data",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "task"
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete" : {
@@ -3435,6 +3435,235 @@
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner" : {
"put" : {
"operationId" : "setTaskOwner",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
"in" : "path",
"name" : "id",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
}
}, {
"description" : "Playbook ID",
"example" : "phishing",
"in" : "path",
"name" : "playbookID",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"description" : "Task ID",
"example" : "board",
"in" : "path",
"name" : "taskID",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "string"
}
}
},
"description" : "Task owner",
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/TicketWithTickets"
}
},
"test" : {
"example" : {
"artifacts" : [ {
"name" : "94d5cab6f5fe3422a447ab15436e7a672bc0c09a",
"status" : "unknown"
}, {
"name" : "http://www.customerviral.io/scalable/vertical/killer",
"status" : "clean"
}, {
"name" : "leadreintermediate.io",
"status" : "malicious"
} ],
"created" : "2021-10-02T16:04:59.078+0000",
"id" : 8123,
"modified" : "2021-12-12T12:12:12.000+0000",
"name" : "live zebra",
"owner" : "demo",
"playbooks" : {
"phishing" : {
"name" : "Phishing",
"tasks" : {
"block-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block IOCs",
"order" : 6,
"type" : "task"
},
"block-sender" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block sender",
"next" : {
"extract-iocs" : ""
},
"order" : 3,
"type" : "task"
},
"board" : {
"active" : true,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Board Involvement?",
"next" : {
"escalate" : "boardInvolved == true",
"mail-available" : "boardInvolved == false"
},
"order" : 0,
"owner" : "eve",
"schema" : {
"properties" : {
"boardInvolved" : {
"default" : false,
"title" : "A board member is involved.",
"type" : "boolean"
}
},
"required" : [ "boardInvolved" ],
"title" : "Board Involvement?",
"type" : "object"
},
"type" : "input"
},
"escalate" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Escalate to CISO",
"order" : 1,
"type" : "task"
},
"extract-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Extract IOCs",
"next" : {
"block-iocs" : ""
},
"order" : 5,
"schema" : {
"properties" : {
"iocs" : {
"items" : {
"type" : "string"
},
"title" : "IOCs",
"type" : "array"
}
},
"title" : "Extract IOCs",
"type" : "object"
},
"type" : "input"
},
"mail-available" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Mail available",
"next" : {
"block-sender" : "schemaKey == 'yes'",
"extract-iocs" : "schemaKey == 'yes'",
"search-email-gateway" : "schemaKey == 'no'"
},
"order" : 2,
"schema" : {
"oneOf" : [ {
"properties" : {
"mail" : {
"title" : "Mail",
"type" : "string",
"x-display" : "textarea"
},
"schemaKey" : {
"const" : "yes",
"type" : "string"
}
},
"required" : [ "mail" ],
"title" : "Yes"
}, {
"properties" : {
"schemaKey" : {
"const" : "no",
"type" : "string"
}
},
"title" : "No"
} ],
"title" : "Mail available",
"type" : "object"
},
"type" : "input"
},
"search-email-gateway" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Search email gateway",
"next" : {
"extract-iocs" : ""
},
"order" : 4,
"type" : "task"
}
}
}
},
"references" : [ {
"href" : "https://www.leadmaximize.net/e-services/back-end",
"name" : "performance"
}, {
"href" : "http://www.corporateinteractive.name/rich",
"name" : "autumn"
}, {
"href" : "https://www.corporateintuitive.org/intuitive/platforms/integrate",
"name" : "suggest"
} ],
"schema" : "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n",
"status" : "closed",
"type" : "incident"
}
}
},
"description" : "successful operation"
}
},
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task owner",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "owner"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run" : {
"post" : {
"operationId" : "runTask",
@@ -3498,10 +3727,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
"$ref" : "#/components/schemas/ReferenceArray"
}
}
},
@@ -3960,10 +4186,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
"$ref" : "#/components/schemas/TicketFormArray"
}
}
},
@@ -4797,6 +5020,28 @@
"required" : [ "automation", "id", "status" ],
"type" : "object"
},
"JobUpdate" : {
"properties" : {
"container" : {
"type" : "string"
},
"log" : {
"type" : "string"
},
"output" : {
"properties" : { },
"type" : "object"
},
"running" : {
"type" : "boolean"
},
"status" : {
"type" : "string"
}
},
"required" : [ "running", "status" ],
"type" : "object"
},
"LogEntry" : {
"properties" : {
"created" : {
@@ -4953,6 +5198,12 @@
"required" : [ "href", "name" ],
"type" : "object"
},
"ReferenceArray" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
},
"Settings" : {
"properties" : {
"artifactStates" : {
@@ -5076,62 +5327,6 @@
"required" : [ "created", "done", "name", "type" ],
"type" : "object"
},
"TaskForm" : {
"properties" : {
"automation" : {
"type" : "string"
},
"closed" : {
"format" : "date-time",
"type" : "string"
},
"created" : {
"format" : "date-time",
"type" : "string"
},
"data" : {
"properties" : { },
"type" : "object"
},
"done" : {
"type" : "boolean"
},
"join" : {
"example" : false,
"type" : "boolean"
},
"name" : {
"example" : "Inform user",
"type" : "string"
},
"next" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"owner" : {
"type" : "string"
},
"payload" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"schema" : {
"properties" : { },
"type" : "object"
},
"type" : {
"enum" : [ "task", "input", "automation" ],
"example" : "task",
"type" : "string"
}
},
"required" : [ "name", "type" ],
"type" : "object"
},
"TaskOrigin" : {
"properties" : {
"playbook_id" : {
@@ -5413,6 +5608,12 @@
"required" : [ "name", "status", "type" ],
"type" : "object"
},
"TicketFormArray" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
},
"TicketList" : {
"properties" : {
"count" : {

View File

@@ -236,6 +236,22 @@ definitions:
- automation
- status
type: object
JobUpdate:
properties:
container:
type: string
log:
type: string
output:
type: object
running:
type: boolean
status:
type: string
required:
- running
- status
type: object
LogEntry:
properties:
created:
@@ -360,6 +376,10 @@ definitions:
- name
- href
type: object
ReferenceArray:
items:
$ref: '#/definitions/Reference'
type: array
Settings:
properties:
artifactStates:
@@ -465,51 +485,6 @@ definitions:
- done
- created
type: object
TaskForm:
properties:
automation:
type: string
closed:
example: 1985-04-12T23:20:50.52Z
format: date-time
type: string
created:
example: 1985-04-12T23:20:50.52Z
format: date-time
type: string
data:
type: object
done:
type: boolean
join:
example: false
type: boolean
name:
example: Inform user
type: string
next:
additionalProperties:
type: string
type: object
owner:
type: string
payload:
additionalProperties:
type: string
type: object
schema:
type: object
type:
enum:
- task
- input
- automation
example: task
type: string
required:
- name
- type
type: object
TaskOrigin:
properties:
playbook_id:
@@ -742,6 +717,10 @@ definitions:
- type
- status
type: object
TicketFormArray:
items:
$ref: '#/definitions/TicketForm'
type: array
TicketList:
properties:
count:
@@ -1628,11 +1607,9 @@ paths:
name: job
required: true
schema:
$ref: '#/definitions/Job'
$ref: '#/definitions/JobUpdate'
x-example:
automation: hash.sha1
id: 99cd67131b48
payload: test
running: false
status: failed
responses:
"200":
@@ -5053,7 +5030,7 @@ paths:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}:
put:
operationId: setTask
operationId: setTaskData
parameters:
- description: Ticket ID
format: int64
@@ -5074,33 +5051,14 @@ paths:
required: true
type: string
x-example: board
- description: Task
- description: Task data
in: body
name: task
name: data
required: true
schema:
$ref: '#/definitions/Task'
type: object
x-example:
active: true
data:
boardInvolved: true
done: false
name: Board Involvement?
next:
escalate: boardInvolved == true
mail-available: boardInvolved == false
order: 0
schema:
properties:
boardInvolved:
default: false
title: A board member is involved.
type: boolean
required:
- boardInvolved
title: Board Involvement?
type: object
type: input
boardInvolved: true
responses:
"200":
description: successful operation
@@ -5330,7 +5288,7 @@ paths:
security:
- roles:
- ticket:write
summary: Set a ticket playbook task
summary: Set a ticket playbook task data
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete:
@@ -5597,6 +5555,267 @@ paths:
summary: Complete ticket playbook task
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner:
put:
operationId: setTaskOwner
parameters:
- description: Ticket ID
format: int64
in: path
name: id
required: true
type: integer
x-example: 8123
- description: Playbook ID
in: path
name: playbookID
required: true
type: string
x-example: phishing
- description: Task ID
in: path
name: taskID
required: true
type: string
x-example: board
- description: Task owner
in: body
name: owner
required: true
schema:
type: string
x-example: eve
responses:
"200":
description: successful operation
examples:
test:
artifacts:
- name: 94d5cab6f5fe3422a447ab15436e7a672bc0c09a
status: unknown
- name: http://www.customerviral.io/scalable/vertical/killer
status: clean
- name: leadreintermediate.io
status: malicious
created: 2021-10-02T16:04:59.078206Z
id: 8123
modified: 2021-12-12T12:12:12.000000012Z
name: live zebra
owner: demo
playbooks:
phishing:
name: Phishing
tasks:
block-iocs:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Block IOCs
order: 6
type: task
block-sender:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Block sender
next:
extract-iocs: ""
order: 3
type: task
board:
active: true
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Board Involvement?
next:
escalate: boardInvolved == true
mail-available: boardInvolved == false
order: 0
owner: eve
schema:
properties:
boardInvolved:
default: false
title: A board member is involved.
type: boolean
required:
- boardInvolved
title: Board Involvement?
type: object
type: input
escalate:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Escalate to CISO
order: 1
type: task
extract-iocs:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Extract IOCs
next:
block-iocs: ""
order: 5
schema:
properties:
iocs:
items:
type: string
title: IOCs
type: array
title: Extract IOCs
type: object
type: input
mail-available:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Mail available
next:
block-sender: schemaKey == 'yes'
extract-iocs: schemaKey == 'yes'
search-email-gateway: schemaKey == 'no'
order: 2
schema:
oneOf:
- properties:
mail:
title: Mail
type: string
x-display: textarea
schemaKey:
const: "yes"
type: string
required:
- mail
title: "Yes"
- properties:
schemaKey:
const: "no"
type: string
title: "No"
title: Mail available
type: object
type: input
search-email-gateway:
active: false
created: 2021-12-12T12:12:12.000000012Z
done: false
name: Search email gateway
next:
extract-iocs: ""
order: 4
type: task
references:
- href: https://www.leadmaximize.net/e-services/back-end
name: performance
- href: http://www.corporateinteractive.name/rich
name: autumn
- href: https://www.corporateintuitive.org/intuitive/platforms/integrate
name: suggest
schema: |
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1618746510.json",
"title": "Event",
"type": "object",
"required": [
"severity",
"description",
"tlp"
],
"properties": {
"severity": {
"$id": "#root/severity",
"title": "Severity",
"type": "string",
"default": "Medium",
"nx-enum": [
"Low",
"Medium",
"High"
],
"x-cols": 6,
"x-class": "pr-2",
"x-display": "icon",
"x-itemIcon": "icon",
"oneOf": [
{
"const": "Low",
"title": "Low",
"icon": "mdi-chevron-up"
},
{
"const": "Medium",
"title": "Medium",
"icon": "mdi-chevron-double-up"
},
{
"const": "High",
"title": "High",
"icon": "mdi-chevron-triple-up"
}
]
},
"tlp": {
"$id": "#root/tlp",
"title": "TLP",
"type": "string",
"nx-enum": [
"White",
"Green",
"Amber",
"Red"
],
"x-cols": 6,
"x-class": "pr-2",
"x-display": "icon",
"x-itemIcon": "icon",
"oneOf": [
{
"const": "White",
"title": "White",
"icon": "mdi-alpha-w"
},
{
"const": "Green",
"title": "Green",
"icon": "mdi-alpha-g"
},
{
"const": "Amber",
"title": "Amber",
"icon": "mdi-alpha-a"
},
{
"const": "Red",
"title": "Red",
"icon": "mdi-alpha-r"
}
]
},
"description": {
"$id": "#root/description",
"title": "Description",
"type": "string",
"x-display": "textarea",
"x-class": "pr-2"
}
}
}
status: closed
type: incident
schema:
$ref: '#/definitions/TicketWithTickets'
security:
- roles:
- ticket:write
summary: Set a ticket playbook task owner
tags:
- tickets
/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run:
post:
operationId: runTask
@@ -5645,9 +5864,7 @@ paths:
name: references
required: true
schema:
items:
$ref: '#/definitions/Reference'
type: array
$ref: '#/definitions/ReferenceArray'
x-example:
- href: http://www.leadscalable.biz/envisioneer
name: fund
@@ -6074,9 +6291,7 @@ paths:
name: ticket
required: true
schema:
items:
$ref: '#/definitions/TicketForm'
type: array
$ref: '#/definitions/TicketFormArray'
x-example:
- id: 123
name: Wannacry infection
@@ -6413,6 +6628,8 @@ paths:
schema:
$ref: '#/definitions/UserForm'
x-example:
apikey: true
blocked: false
id: syncscript
roles:
- analyst
@@ -6527,6 +6744,9 @@ paths:
schema:
$ref: '#/definitions/UserForm'
x-example:
apikey: false
blocked: false
id: syncscript
roles:
- analyst
- admin

View File

@@ -1,8 +1,6 @@
package model
import (
"fmt"
"strings"
"time"
"github.com/xeipuuv/gojsonschema"
@@ -24,6 +22,7 @@ var (
JobSchema = new(gojsonschema.Schema)
JobFormSchema = new(gojsonschema.Schema)
JobResponseSchema = new(gojsonschema.Schema)
JobUpdateSchema = new(gojsonschema.Schema)
LogEntrySchema = new(gojsonschema.Schema)
MessageSchema = new(gojsonschema.Schema)
NewUserResponseSchema = new(gojsonschema.Schema)
@@ -34,15 +33,16 @@ var (
PlaybookTemplateFormSchema = new(gojsonschema.Schema)
PlaybookTemplateResponseSchema = new(gojsonschema.Schema)
ReferenceSchema = new(gojsonschema.Schema)
ReferenceArraySchema = new(gojsonschema.Schema)
SettingsSchema = new(gojsonschema.Schema)
StatisticsSchema = new(gojsonschema.Schema)
TaskSchema = new(gojsonschema.Schema)
TaskFormSchema = new(gojsonschema.Schema)
TaskOriginSchema = new(gojsonschema.Schema)
TaskResponseSchema = new(gojsonschema.Schema)
TaskWithContextSchema = new(gojsonschema.Schema)
TicketSchema = new(gojsonschema.Schema)
TicketFormSchema = new(gojsonschema.Schema)
TicketFormArraySchema = new(gojsonschema.Schema)
TicketListSchema = new(gojsonschema.Schema)
TicketResponseSchema = new(gojsonschema.Schema)
TicketSimpleResponseSchema = new(gojsonschema.Schema)
@@ -63,55 +63,57 @@ var (
func init() {
err := schemaLoader.AddSchemas(
gojsonschema.NewStringLoader(`{"type":"object","required":["name"],"x-embed":"","properties":{"enrichments":{"type":"object","additionalProperties":{"$ref":"#/definitions/Enrichment"}},"name":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"$id":"#/definitions/Artifact"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["ticket_id","artifact"],"x-embed":"","properties":{"artifact":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"$id":"#/definitions/ArtifactOrigin"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["image","script","type"],"x-embed":"","properties":{"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"$id":"#/definitions/Automation"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","image","script","type"],"x-embed":"","properties":{"id":{"type":"string"},"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"$id":"#/definitions/AutomationForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","image","script","type"],"x-embed":"","properties":{"id":{"type":"string"},"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"$id":"#/definitions/AutomationResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["creator","created","message"],"x-embed":"","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"$id":"#/definitions/Comment"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["message"],"x-embed":"","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"$id":"#/definitions/CommentForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","x-embed":"","properties":{"artifact":{"$ref":"#/definitions/Artifact"},"playbook":{"$ref":"#/definitions/PlaybookResponse"},"task":{"$ref":"#/definitions/TaskResponse"},"ticket":{"$ref":"#/definitions/TicketResponse"}},"$id":"#/definitions/Context"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","data","created"],"x-embed":"","properties":{"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"name":{"type":"string"}},"$id":"#/definitions/Enrichment"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","data"],"x-embed":"","properties":{"data":{"type":"object"},"name":{"type":"string"}},"$id":"#/definitions/EnrichmentForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["key","name"],"x-embed":"","properties":{"key":{"type":"string"},"name":{"type":"string"}},"$id":"#/definitions/File"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["automation","running","status"],"x-embed":"","properties":{"automation":{"type":"string"},"container":{"type":"string"},"log":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"output":{"type":"object"},"payload":{},"running":{"type":"boolean"},"status":{"type":"string"}},"$id":"#/definitions/Job"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["automation"],"x-embed":"","properties":{"automation":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"payload":{}},"$id":"#/definitions/JobForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","automation","status"],"x-embed":"","properties":{"automation":{"type":"string"},"container":{"type":"string"},"id":{"type":"string"},"log":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"output":{"type":"object"},"payload":{},"status":{"type":"string"}},"$id":"#/definitions/JobResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["type","reference","creator","created","message"],"x-embed":"","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"},"reference":{"type":"string"},"type":{"type":"string"}},"$id":"#/definitions/LogEntry"}`),
gojsonschema.NewStringLoader(`{"type":"object","x-embed":"","properties":{"context":{"$ref":"#/definitions/Context"},"payload":{},"secrets":{"type":"object","additionalProperties":{"type":"string"}}},"$id":"#/definitions/Message"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","blocked","roles"],"x-embed":"","properties":{"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"},"secret":{"type":"string"}},"$id":"#/definitions/NewUserResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","x-embed":"","properties":{"artifact_origin":{"$ref":"#/definitions/ArtifactOrigin"},"task_origin":{"$ref":"#/definitions/TaskOrigin"}},"$id":"#/definitions/Origin"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","tasks"],"x-embed":"","properties":{"name":{"type":"string"},"tasks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Task"}}},"$id":"#/definitions/Playbook"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","tasks"],"x-embed":"","properties":{"name":{"type":"string"},"tasks":{"type":"object","additionalProperties":{"$ref":"#/definitions/TaskResponse"}}},"$id":"#/definitions/PlaybookResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","yaml"],"x-embed":"","properties":{"name":{"type":"string"},"yaml":{"type":"string"}},"$id":"#/definitions/PlaybookTemplate"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["yaml"],"x-embed":"","properties":{"id":{"type":"string"},"yaml":{"type":"string"}},"$id":"#/definitions/PlaybookTemplateForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","yaml"],"x-embed":"","properties":{"id":{"type":"string"},"name":{"type":"string"},"yaml":{"type":"string"}},"$id":"#/definitions/PlaybookTemplateResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","href"],"x-embed":"","properties":{"href":{"type":"string"},"name":{"type":"string"}},"$id":"#/definitions/Reference"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["version","tier","timeformat","ticketTypes","artifactStates"],"x-embed":"","properties":{"artifactStates":{"title":"Artifact States","items":{"$ref":"#/definitions/Type"},"type":"array"},"roles":{"title":"Roles","items":{"type":"string"},"type":"array"},"ticketTypes":{"title":"Ticket Types","items":{"$ref":"#/definitions/TicketTypeResponse"},"type":"array"},"tier":{"title":"Tier","type":"string","enum":["community","enterprise"]},"timeformat":{"title":"Time Format","type":"string"},"version":{"title":"Version","type":"string"}},"$id":"#/definitions/Settings"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["unassigned","open_tickets_per_user","tickets_per_week","tickets_per_type"],"x-embed":"","properties":{"open_tickets_per_user":{"type":"object","additionalProperties":{"type":"integer"}},"tickets_per_type":{"type":"object","additionalProperties":{"type":"integer"}},"tickets_per_week":{"type":"object","additionalProperties":{"type":"integer"}},"unassigned":{"type":"integer"}},"$id":"#/definitions/Statistics"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","type","done","created"],"x-embed":"","properties":{"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"done":{"type":"boolean"},"join":{"type":"boolean"},"name":{"type":"string"},"next":{"type":"object","additionalProperties":{"type":"string"}},"owner":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"string"}},"schema":{"type":"object"},"type":{"type":"string","enum":["task","input","automation"]}},"$id":"#/definitions/Task"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","type"],"x-embed":"","properties":{"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"done":{"type":"boolean"},"join":{"type":"boolean"},"name":{"type":"string"},"next":{"type":"object","additionalProperties":{"type":"string"}},"owner":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"string"}},"schema":{"type":"object"},"type":{"type":"string","enum":["task","input","automation"]}},"$id":"#/definitions/TaskForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["ticket_id","playbook_id","task_id"],"x-embed":"","properties":{"playbook_id":{"type":"string"},"task_id":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"$id":"#/definitions/TaskOrigin"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","type","done","created","order","active"],"x-embed":"","properties":{"active":{"type":"boolean"},"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"done":{"type":"boolean"},"join":{"type":"boolean"},"name":{"type":"string"},"next":{"type":"object","additionalProperties":{"type":"string"}},"order":{"format":"int64","type":"number"},"owner":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"string"}},"schema":{"type":"object"},"type":{"type":"string","enum":["task","input","automation"]}},"$id":"#/definitions/TaskResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["ticket_id","ticket_name","playbook_id","playbook_name","task_id","task"],"x-embed":"","properties":{"playbook_id":{"type":"string"},"playbook_name":{"type":"string"},"task":{"$ref":"#/definitions/TaskResponse"},"task_id":{"type":"string"},"ticket_id":{"format":"int64","type":"number"},"ticket_name":{"type":"string"}},"$id":"#/definitions/TaskWithContext"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","type","status","created","modified","schema"],"x-embed":"","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Playbook"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/Ticket"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","type","status"],"x-embed":"","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"items":{"$ref":"#/definitions/PlaybookTemplateForm"},"type":"array"},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/TicketForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["tickets","count"],"x-embed":"","properties":{"count":{"type":"number"},"tickets":{"items":{"$ref":"#/definitions/TicketSimpleResponse"},"type":"array"}},"$id":"#/definitions/TicketList"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","type","status","created","modified","schema"],"x-embed":"","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/PlaybookResponse"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/TicketResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","type","status","created","modified","schema"],"x-embed":"","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Playbook"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/TicketSimpleResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","schema"],"x-embed":"","properties":{"name":{"type":"string"},"schema":{"type":"string"}},"$id":"#/definitions/TicketTemplate"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","schema"],"x-embed":"","properties":{"id":{"type":"string"},"name":{"type":"string"},"schema":{"type":"string"}},"$id":"#/definitions/TicketTemplateForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","schema"],"x-embed":"","properties":{"id":{"type":"string"},"name":{"type":"string"},"schema":{"type":"string"}},"$id":"#/definitions/TicketTemplateResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","icon","default_template","default_playbooks"],"x-embed":"","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"}},"$id":"#/definitions/TicketType"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["name","icon","default_template","default_playbooks"],"x-embed":"","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"$id":"#/definitions/TicketTypeForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","icon","default_template","default_playbooks"],"x-embed":"","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"$id":"#/definitions/TicketTypeResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","type","status","created","modified","schema"],"x-embed":"","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"logs":{"items":{"$ref":"#/definitions/LogEntry"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/PlaybookResponse"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"tickets":{"items":{"$ref":"#/definitions/TicketSimpleResponse"},"type":"array"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/TicketWithTickets"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","name","icon"],"x-embed":"","properties":{"color":{"title":"Color","type":"string","enum":["error","info","success","warning"]},"icon":{"title":"Icon (https://materialdesignicons.com)","type":"string"},"id":{"title":"ID","type":"string"},"name":{"title":"Name","type":"string"}},"$id":"#/definitions/Type"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["blocked","apikey","roles"],"x-embed":"","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"roles":{"items":{"type":"string"},"type":"array"},"sha256":{"type":"string"}},"$id":"#/definitions/User"}`),
gojsonschema.NewStringLoader(`{"type":"object","x-embed":"","properties":{"email":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"timeformat":{"title":"Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)","type":"string"}},"$id":"#/definitions/UserData"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id"],"x-embed":"","properties":{"email":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"timeformat":{"title":"Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)","type":"string"}},"$id":"#/definitions/UserDataResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","blocked","roles","apikey"],"x-embed":"","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/UserForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","required":["id","blocked","roles","apikey"],"x-embed":"","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"}},"$id":"#/definitions/UserResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"enrichments":{"type":"object","additionalProperties":{"$ref":"#/definitions/Enrichment"}},"name":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"required":["name"],"$id":"#/definitions/Artifact"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifact":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"required":["ticket_id","artifact"],"$id":"#/definitions/ArtifactOrigin"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"required":["image","script","type"],"$id":"#/definitions/Automation"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"required":["id","image","script","type"],"$id":"#/definitions/AutomationForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"image":{"type":"string"},"schema":{"type":"string"},"script":{"type":"string"},"type":{"items":{"type":"string","enum":["artifact","playbook","global"]},"type":"array"}},"required":["id","image","script","type"],"$id":"#/definitions/AutomationResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"required":["creator","created","message"],"$id":"#/definitions/Comment"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"required":["message"],"$id":"#/definitions/CommentForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifact":{"$ref":"#/definitions/Artifact"},"playbook":{"$ref":"#/definitions/PlaybookResponse"},"task":{"$ref":"#/definitions/TaskResponse"},"ticket":{"$ref":"#/definitions/TicketResponse"}},"$id":"#/definitions/Context"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"name":{"type":"string"}},"required":["name","data","created"],"$id":"#/definitions/Enrichment"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"data":{"type":"object"},"name":{"type":"string"}},"required":["name","data"],"$id":"#/definitions/EnrichmentForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"$id":"#/definitions/File"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"automation":{"type":"string"},"container":{"type":"string"},"log":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"output":{"type":"object"},"payload":{},"running":{"type":"boolean"},"status":{"type":"string"}},"required":["automation","running","status"],"$id":"#/definitions/Job"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"automation":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"payload":{}},"required":["automation"],"$id":"#/definitions/JobForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"automation":{"type":"string"},"container":{"type":"string"},"id":{"type":"string"},"log":{"type":"string"},"origin":{"$ref":"#/definitions/Origin"},"output":{"type":"object"},"payload":{},"status":{"type":"string"}},"required":["id","automation","status"],"$id":"#/definitions/JobResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"container":{"type":"string"},"log":{"type":"string"},"output":{"type":"object"},"running":{"type":"boolean"},"status":{"type":"string"}},"required":["running","status"],"$id":"#/definitions/JobUpdate"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"},"reference":{"type":"string"},"type":{"type":"string"}},"required":["type","reference","creator","created","message"],"$id":"#/definitions/LogEntry"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"context":{"$ref":"#/definitions/Context"},"payload":{},"secrets":{"type":"object","additionalProperties":{"type":"string"}}},"$id":"#/definitions/Message"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"},"secret":{"type":"string"}},"required":["id","blocked","roles"],"$id":"#/definitions/NewUserResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifact_origin":{"$ref":"#/definitions/ArtifactOrigin"},"task_origin":{"$ref":"#/definitions/TaskOrigin"}},"$id":"#/definitions/Origin"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"name":{"type":"string"},"tasks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Task"}}},"required":["name","tasks"],"$id":"#/definitions/Playbook"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"name":{"type":"string"},"tasks":{"type":"object","additionalProperties":{"$ref":"#/definitions/TaskResponse"}}},"required":["name","tasks"],"$id":"#/definitions/PlaybookResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"name":{"type":"string"},"yaml":{"type":"string"}},"required":["name","yaml"],"$id":"#/definitions/PlaybookTemplate"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"yaml":{"type":"string"}},"required":["yaml"],"$id":"#/definitions/PlaybookTemplateForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yaml":{"type":"string"}},"required":["id","name","yaml"],"$id":"#/definitions/PlaybookTemplateResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"href":{"type":"string"},"name":{"type":"string"}},"required":["name","href"],"$id":"#/definitions/Reference"}`),
gojsonschema.NewStringLoader(`{"items":{"$ref":"#/definitions/Reference"},"type":"array","$id":"#/definitions/ReferenceArray"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifactStates":{"title":"Artifact States","items":{"$ref":"#/definitions/Type"},"type":"array"},"roles":{"title":"Roles","items":{"type":"string"},"type":"array"},"ticketTypes":{"title":"Ticket Types","items":{"$ref":"#/definitions/TicketTypeResponse"},"type":"array"},"tier":{"title":"Tier","type":"string","enum":["community","enterprise"]},"timeformat":{"title":"Time Format","type":"string"},"version":{"title":"Version","type":"string"}},"required":["version","tier","timeformat","ticketTypes","artifactStates"],"$id":"#/definitions/Settings"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"open_tickets_per_user":{"type":"object","additionalProperties":{"type":"integer"}},"tickets_per_type":{"type":"object","additionalProperties":{"type":"integer"}},"tickets_per_week":{"type":"object","additionalProperties":{"type":"integer"}},"unassigned":{"type":"integer"}},"required":["unassigned","open_tickets_per_user","tickets_per_week","tickets_per_type"],"$id":"#/definitions/Statistics"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"done":{"type":"boolean"},"join":{"type":"boolean"},"name":{"type":"string"},"next":{"type":"object","additionalProperties":{"type":"string"}},"owner":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"string"}},"schema":{"type":"object"},"type":{"type":"string","enum":["task","input","automation"]}},"required":["name","type","done","created"],"$id":"#/definitions/Task"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"playbook_id":{"type":"string"},"task_id":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"required":["ticket_id","playbook_id","task_id"],"$id":"#/definitions/TaskOrigin"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"active":{"type":"boolean"},"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"type":"object"},"done":{"type":"boolean"},"join":{"type":"boolean"},"name":{"type":"string"},"next":{"type":"object","additionalProperties":{"type":"string"}},"order":{"format":"int64","type":"number"},"owner":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"string"}},"schema":{"type":"object"},"type":{"type":"string","enum":["task","input","automation"]}},"required":["name","type","done","created","order","active"],"$id":"#/definitions/TaskResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"playbook_id":{"type":"string"},"playbook_name":{"type":"string"},"task":{"$ref":"#/definitions/TaskResponse"},"task_id":{"type":"string"},"ticket_id":{"format":"int64","type":"number"},"ticket_name":{"type":"string"}},"required":["ticket_id","ticket_name","playbook_id","playbook_name","task_id","task"],"$id":"#/definitions/TaskWithContext"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Playbook"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"required":["name","type","status","created","modified","schema"],"$id":"#/definitions/Ticket"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"items":{"$ref":"#/definitions/PlaybookTemplateForm"},"type":"array"},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"required":["name","type","status"],"$id":"#/definitions/TicketForm"}`),
gojsonschema.NewStringLoader(`{"items":{"$ref":"#/definitions/TicketForm"},"type":"array","$id":"#/definitions/TicketFormArray"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"count":{"type":"number"},"tickets":{"items":{"$ref":"#/definitions/TicketSimpleResponse"},"type":"array"}},"required":["tickets","count"],"$id":"#/definitions/TicketList"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/PlaybookResponse"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"required":["id","name","type","status","created","modified","schema"],"$id":"#/definitions/TicketResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/Playbook"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"required":["id","name","type","status","created","modified","schema"],"$id":"#/definitions/TicketSimpleResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"string"}},"required":["name","schema"],"$id":"#/definitions/TicketTemplate"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"schema":{"type":"string"}},"required":["name","schema"],"$id":"#/definitions/TicketTemplateForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"schema":{"type":"string"}},"required":["id","name","schema"],"$id":"#/definitions/TicketTemplateResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"}},"required":["name","icon","default_template","default_playbooks"],"$id":"#/definitions/TicketType"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["name","icon","default_template","default_playbooks"],"$id":"#/definitions/TicketTypeForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name","icon","default_template","default_playbooks"],"$id":"#/definitions/TicketTypeResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"},"comments":{"items":{"$ref":"#/definitions/Comment"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"type":"object"},"files":{"items":{"$ref":"#/definitions/File"},"type":"array"},"id":{"format":"int64","type":"integer"},"logs":{"items":{"$ref":"#/definitions/LogEntry"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"type":"string"},"owner":{"type":"string"},"playbooks":{"type":"object","additionalProperties":{"$ref":"#/definitions/PlaybookResponse"}},"read":{"items":{"type":"string"},"type":"array"},"references":{"items":{"$ref":"#/definitions/Reference"},"type":"array"},"schema":{"type":"string"},"status":{"type":"string"},"tickets":{"items":{"$ref":"#/definitions/TicketSimpleResponse"},"type":"array"},"type":{"type":"string"},"write":{"items":{"type":"string"},"type":"array"}},"required":["id","name","type","status","created","modified","schema"],"$id":"#/definitions/TicketWithTickets"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"color":{"title":"Color","type":"string","enum":["error","info","success","warning"]},"icon":{"title":"Icon (https://materialdesignicons.com)","type":"string"},"id":{"title":"ID","type":"string"},"name":{"title":"Name","type":"string"}},"required":["id","name","icon"],"$id":"#/definitions/Type"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"roles":{"items":{"type":"string"},"type":"array"},"sha256":{"type":"string"}},"required":["blocked","apikey","roles"],"$id":"#/definitions/User"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"email":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"timeformat":{"title":"Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)","type":"string"}},"$id":"#/definitions/UserData"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"timeformat":{"title":"Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)","type":"string"}},"required":["id"],"$id":"#/definitions/UserDataResponse"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"}},"required":["id","blocked","roles","apikey"],"$id":"#/definitions/UserForm"}`),
gojsonschema.NewStringLoader(`{"type":"object","properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"id":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"}},"required":["id","blocked","roles","apikey"],"$id":"#/definitions/UserResponse"}`),
)
if err != nil {
panic(err)
@@ -131,6 +133,7 @@ func init() {
JobSchema = mustCompile(`#/definitions/Job`)
JobFormSchema = mustCompile(`#/definitions/JobForm`)
JobResponseSchema = mustCompile(`#/definitions/JobResponse`)
JobUpdateSchema = mustCompile(`#/definitions/JobUpdate`)
LogEntrySchema = mustCompile(`#/definitions/LogEntry`)
MessageSchema = mustCompile(`#/definitions/Message`)
NewUserResponseSchema = mustCompile(`#/definitions/NewUserResponse`)
@@ -141,15 +144,16 @@ func init() {
PlaybookTemplateFormSchema = mustCompile(`#/definitions/PlaybookTemplateForm`)
PlaybookTemplateResponseSchema = mustCompile(`#/definitions/PlaybookTemplateResponse`)
ReferenceSchema = mustCompile(`#/definitions/Reference`)
ReferenceArraySchema = mustCompile(`#/definitions/ReferenceArray`)
SettingsSchema = mustCompile(`#/definitions/Settings`)
StatisticsSchema = mustCompile(`#/definitions/Statistics`)
TaskSchema = mustCompile(`#/definitions/Task`)
TaskFormSchema = mustCompile(`#/definitions/TaskForm`)
TaskOriginSchema = mustCompile(`#/definitions/TaskOrigin`)
TaskResponseSchema = mustCompile(`#/definitions/TaskResponse`)
TaskWithContextSchema = mustCompile(`#/definitions/TaskWithContext`)
TicketSchema = mustCompile(`#/definitions/Ticket`)
TicketFormSchema = mustCompile(`#/definitions/TicketForm`)
TicketFormArraySchema = mustCompile(`#/definitions/TicketFormArray`)
TicketListSchema = mustCompile(`#/definitions/TicketList`)
TicketResponseSchema = mustCompile(`#/definitions/TicketResponse`)
TicketSimpleResponseSchema = mustCompile(`#/definitions/TicketSimpleResponse`)
@@ -266,6 +270,14 @@ type JobResponse struct {
Status string `json:"status"`
}
type JobUpdate struct {
Container *string `json:"container,omitempty"`
Log *string `json:"log,omitempty"`
Output map[string]interface{} `json:"output,omitempty"`
Running bool `json:"running"`
Status string `json:"status"`
}
type LogEntry struct {
Created time.Time `json:"created"`
Creator string `json:"creator"`
@@ -323,6 +335,8 @@ type Reference struct {
Name string `json:"name"`
}
type ReferenceArray []*Reference
type Settings struct {
ArtifactStates []*Type `json:"artifactStates"`
Roles []string `json:"roles,omitempty"`
@@ -354,21 +368,6 @@ type Task struct {
Type string `json:"type"`
}
type TaskForm struct {
Automation *string `json:"automation,omitempty"`
Closed *time.Time `json:"closed,omitempty"`
Created *time.Time `json:"created,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
Done *bool `json:"done,omitempty"`
Join *bool `json:"join,omitempty"`
Name string `json:"name"`
Next map[string]string `json:"next,omitempty"`
Owner *string `json:"owner,omitempty"`
Payload map[string]string `json:"payload,omitempty"`
Schema map[string]interface{} `json:"schema,omitempty"`
Type string `json:"type"`
}
type TaskOrigin struct {
PlaybookId string `json:"playbook_id"`
TaskId string `json:"task_id"`
@@ -438,6 +437,8 @@ type TicketForm struct {
Write []string `json:"write,omitempty"`
}
type TicketFormArray []*TicketForm
type TicketList struct {
Count int `json:"count"`
Tickets []*TicketSimpleResponse `json:"tickets"`
@@ -596,22 +597,6 @@ func mustCompile(uri string) *gojsonschema.Schema {
return s
}
func validate(s *gojsonschema.Schema, b []byte) error {
res, err := s.Validate(gojsonschema.NewStringLoader(string(b)))
if err != nil {
return err
}
if len(res.Errors()) > 0 {
var l []string
for _, e := range res.Errors() {
l = append(l, e.String())
}
return fmt.Errorf("validation failed: %v", strings.Join(l, ", "))
}
return nil
}
const (
SettingsTierCommunity = "community"
@@ -623,12 +608,6 @@ const (
TaskTypeAutomation = "automation"
TaskFormTypeTask = "task"
TaskFormTypeInput = "input"
TaskFormTypeAutomation = "automation"
TaskResponseTypeTask = "task"
TaskResponseTypeInput = "input"