Add additional PHP metadata (#753)

* add php related metadata

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* enable decoding of php metadata for syftjson format

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add php metadata to json schema

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2022-01-19 11:42:16 -05:00
committed by GitHub
parent 814f2bf8b9
commit 829e500aa9
10 changed files with 496 additions and 64 deletions
+1
View File
@@ -36,6 +36,7 @@ type artifactMetadataContainer struct {
Rpm pkg.RpmdbMetadata
Cargo pkg.CargoPackageMetadata
Go pkg.GolangBinMetadata
Php pkg.PhpComposerJSONMetadata
}
func main() {
+141
View File
@@ -662,6 +662,9 @@
{
"$ref": "#/definitions/NpmPackageJSONMetadata"
},
{
"$ref": "#/definitions/PhpComposerJSONMetadata"
},
{
"$ref": "#/definitions/PythonPackageMetadata"
},
@@ -674,6 +677,144 @@
"additionalProperties": true,
"type": "object"
},
"PhpComposerAuthors": {
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"homepage": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object"
},
"PhpComposerExternalReference": {
"required": [
"type",
"url",
"reference"
],
"properties": {
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"reference": {
"type": "string"
},
"shasum": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object"
},
"PhpComposerJSONMetadata": {
"required": [
"name",
"version",
"source",
"dist"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"source": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/PhpComposerExternalReference"
},
"dist": {
"$ref": "#/definitions/PhpComposerExternalReference"
},
"require": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"provide": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"require-dev": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"suggest": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
},
"notification-url": {
"type": "string"
},
"bin": {
"items": {
"type": "string"
},
"type": "array"
},
"license": {
"items": {
"type": "string"
},
"type": "array"
},
"authors": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/PhpComposerAuthors"
},
"type": "array"
},
"description": {
"type": "string"
},
"homepage": {
"type": "string"
},
"keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"time": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object"
},
"PomParent": {
"required": [
"groupId",