Define request and response objects #362
Labels
2.1.0-CSD.1
Will be fixed in SARIF v2.1.0 CSD.1.
enhancement
impact-non-breaking-change
merged
Changes merged into provisional draft.
p1
Priority 1 issue to close
resolved-fixed
BACKGROUND
You may recall that #168 was originally filed to define a "web request" object to capture the headers from web requests. This is useful for web analysis tools. Ultimately, I proposed a design that I thought would avoid the need for a new object. I proposed to add an
immutableState
property to thethreadFlow
object. Please see §3.34.5, "threadFlowLocation.immutableState property", for an example. This proposal was approved in e-ballot-3.What I missed was that not every analysis rule in a web analysis tool uses code flows! We need a place to put the headers that does not rely on
result.codeFlows
being present. Furthermore, we really need more than just the headers. I'm writing a SARIF converter now for a web analyzer whose native output format includes not only the headers, but the request URL (well, that fits naturally asresult.location
), the method (e.g.,POST
), and the body.So we really do need a full-fledged
request
object (and aresponse
object) to capture what web analyzers emit.We will use the same caching and externalization mechanisms that we used for addresses and logical locations, to avoid duplicating information when a single request produces multiple issues, and to reduce file size.
PROPOSAL
Define a
request
object with the following properties:index
of typeinteger
, optional: an index intorun.requests
(see below)protocol
of typestring
, optional. Example:"HTTP"
version
of typestring
, optional. Example:"1.1"
target
of typestring
, optional. Example:"/tools/CodeScanner"
method
of typestring
, optional, with well-known valuesGET
,PUT
,POST
,DELETE
,PATCH
,HEAD
,OPTIONS
,TRACE
,CONNECT
.headers
of typeobject
withstring
-valued properties, optional.parameters
of typeobject
withstring
-valued properties, optional.body
of typeartifactContent
, optional.Define a
response
object with the following properties:index
of typeinteger
, optional: an index intorun.responses
(see below).protocol
of typestring
, optional. Example:"HTTP"
version
of typestring
, optional. Example:"1.1"
statusCode
of typeinteger
, optional. Example:404
reasonPhrase
of typestring
, optional. Example:Not found
headers
of typeobject
withstring
-valued properties, optional.body
of typeartifactContent
, optional.In the
result
object:request
of typerequest
, optional.response
of typeresponse
, optional.In the
threadFlowLocation
object:request
of typerequest
, optional.response
of typeresponse
, optional.In the
run
object:requests
of typerequest[]
, optional, unique, minItems: 0, default:[]
.responses
of typeresponse[]
, optional, unique, minItems, 0, default:[]
.In the object held by
run.externalPropertyFileReferences
(this object does not have a name):requests
of typeexternalPropertyFileReference[]
, optional, unique, minItems: 0, default:[]
.responses
of typeexternalPropertyFileReference[]
, optional, unique, minItems: 0, default:[]
.In the
externalProperties
object:requests
of typerequest[]
, optional, unique, minItems: 0, default:[]
responses
of typeresponse[]
, optional, unique, minItems: 0, default:[]
The text was updated successfully, but these errors were encountered: