Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 29 additions & 174 deletions client/openapi/trustd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
license:
name: Apache License, Version 2.0
identifier: Apache-2.0
version: 0.4.2
version: 0.4.4
paths:
/.well-known/trustify:
get:
Expand Down Expand Up @@ -33,8 +33,9 @@ paths:
parameters:
- name: q
in: query
description: |-
description: |
Query for advisories defined using the following EBNF grammar (ISO/IEC 14977):
```text
(* Query Grammar - EBNF Compliant *)
query = ( values | filter ) , { "&" , query } ;
values = value , { "|" , value } ;
Expand All @@ -46,13 +47,13 @@ paths:
escaped_char = "\" , special_char ;
normal_char = ? any character except '&', '|', '=', '!', '~', '>', '<', '\' ? ;
special_char = "&" | "|" | "=" | "!" | "~" | ">" | "<" | "\" ;
(* Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\&bar
*)
```
Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\\&bar
required: false
schema:
type: string
Expand Down Expand Up @@ -462,80 +463,6 @@ paths:
required: true
schema:
type: string
- name: q
in: path
description: |
EBNF grammar for the _q_ parameter:
```text
q = ( values | filter ) { '&' q }
values = value { '|', values }
filter = field, operator, values
operator = "=" | "!=" | "~" | "!~" | ">=" | ">" | "<=" | "<"
value = (* any text but escape special characters with '\' *)
field = (* must match an entity attribute name *)
```
Any values in a _q_ will result in a case-insensitive "full
text search", effectively producing an OR clause of LIKE
clauses for every string-ish field in the resource being
queried.

Examples:
- `foo` - any field containing 'foo'
- `foo|bar` - any field containing either 'foo' OR 'bar'
- `foo&bar` - some field contains 'foo' AND some field contains 'bar'

A _filter_ may also be used to constrain the results. The
filter's field name must correspond to one of the resource's
attributes. If it doesn't, an error will be returned
containing a list of the valid fields for that resource.

The value 'null' is treated specially for [Not]Equal filters:
it returns resources on which the field isn't set. Use the
LIKE operator, `~`, to match a literal "null" string. Omit the
value to match an empty string.

Examples:
- `name=foo` - entity's _name_ matches 'foo' exactly
- `name~foo` - entity's _name_ contains 'foo', case-insensitive
- `name~foo|bar` - entity's _name_ contains either 'foo' OR 'bar', case-insensitive
- `name=` - entity's _name_ is the empty string, ''
- `name=null` - entity's _name_ isn't set
- `published>3 days ago` - date values can be "human time"

Multiple full text searches and/or filters should be
'&'-delimited -- they are logically AND'd together.

- `red hat|fedora&labels:type=cve|osv&published>last wednesday 17:00`

Fields corresponding to JSON objects in the database may use a
':' to delimit the column name and the object key,
e.g. `purl:qualifiers:type=pom`

Any operator or special character, e.g. '|', '&', within a
value should be escaped by prefixing it with a backslash.
required: true
schema:
type: string
- name: sort
in: path
description: |
EBNF grammar for the _sort_ parameter:
```text
sort = field [ ':', order ] { ',' sort }
order = ( "asc" | "desc" )
field = (* must match the name of entity's attributes *)
```
The optional _order_ should be one of "asc" or "desc". If
omitted, the order defaults to "asc".

Each _field_ name must correspond to one of the columns of the
table holding the entities being queried. Those corresponding
to JSON objects in the database may use a ':' to delimit the
column name and the object key,
e.g. `purl:qualifiers:type:desc`
required: true
schema:
type: string
- name: offset
in: query
description: |-
Expand Down Expand Up @@ -751,7 +678,7 @@ paths:
get:
tags:
- analysis
summary: Retrieve SBOM components (packages) by name, Package URL, or CPE.
summary: Retrieve latest SBOM components (packages) by name, Package URL, or CPE.
operationId: getLatestComponent
parameters:
- name: key
Expand All @@ -760,80 +687,6 @@ paths:
required: true
schema:
type: string
- name: q
in: path
description: |
EBNF grammar for the _q_ parameter:
```text
q = ( values | filter ) { '&' q }
values = value { '|', values }
filter = field, operator, values
operator = "=" | "!=" | "~" | "!~" | ">=" | ">" | "<=" | "<"
value = (* any text but escape special characters with '\' *)
field = (* must match an entity attribute name *)
```
Any values in a _q_ will result in a case-insensitive "full
text search", effectively producing an OR clause of LIKE
clauses for every string-ish field in the resource being
queried.

Examples:
- `foo` - any field containing 'foo'
- `foo|bar` - any field containing either 'foo' OR 'bar'
- `foo&bar` - some field contains 'foo' AND some field contains 'bar'

A _filter_ may also be used to constrain the results. The
filter's field name must correspond to one of the resource's
attributes. If it doesn't, an error will be returned
containing a list of the valid fields for that resource.

The value 'null' is treated specially for [Not]Equal filters:
it returns resources on which the field isn't set. Use the
LIKE operator, `~`, to match a literal "null" string. Omit the
value to match an empty string.

Examples:
- `name=foo` - entity's _name_ matches 'foo' exactly
- `name~foo` - entity's _name_ contains 'foo', case-insensitive
- `name~foo|bar` - entity's _name_ contains either 'foo' OR 'bar', case-insensitive
- `name=` - entity's _name_ is the empty string, ''
- `name=null` - entity's _name_ isn't set
- `published>3 days ago` - date values can be "human time"

Multiple full text searches and/or filters should be
'&'-delimited -- they are logically AND'd together.

- `red hat|fedora&labels:type=cve|osv&published>last wednesday 17:00`

Fields corresponding to JSON objects in the database may use a
':' to delimit the column name and the object key,
e.g. `purl:qualifiers:type=pom`

Any operator or special character, e.g. '|', '&', within a
value should be escaped by prefixing it with a backslash.
required: true
schema:
type: string
- name: sort
in: path
description: |
EBNF grammar for the _sort_ parameter:
```text
sort = field [ ':', order ] { ',' sort }
order = ( "asc" | "desc" )
field = (* must match the name of entity's attributes *)
```
The optional _order_ should be one of "asc" or "desc". If
omitted, the order defaults to "asc".

Each _field_ name must correspond to one of the columns of the
table holding the entities being queried. Those corresponding
to JSON objects in the database may use a ':' to delimit the
column name and the object key,
e.g. `purl:qualifiers:type:desc`
required: true
schema:
type: string
- name: offset
in: query
description: |-
Expand Down Expand Up @@ -1331,8 +1184,9 @@ paths:
parameters:
- name: q
in: query
description: |-
description: |
Query for advisories defined using the following EBNF grammar (ISO/IEC 14977):
```text
(* Query Grammar - EBNF Compliant *)
query = ( values | filter ) , { "&" , query } ;
values = value , { "|" , value } ;
Expand All @@ -1344,13 +1198,13 @@ paths:
escaped_char = "\" , special_char ;
normal_char = ? any character except '&', '|', '=', '!', '~', '>', '<', '\' ? ;
special_char = "&" | "|" | "=" | "!" | "~" | ">" | "<" | "\" ;
(* Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\&bar
*)
```
Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\\&bar
required: false
schema:
type: string
Expand Down Expand Up @@ -3047,8 +2901,9 @@ paths:
parameters:
- name: q
in: query
description: |-
description: |
Query for advisories defined using the following EBNF grammar (ISO/IEC 14977):
```text
(* Query Grammar - EBNF Compliant *)
query = ( values | filter ) , { "&" , query } ;
values = value , { "|" , value } ;
Expand All @@ -3060,13 +2915,13 @@ paths:
escaped_char = "\" , special_char ;
normal_char = ? any character except '&', '|', '=', '!', '~', '>', '<', '\' ? ;
special_char = "&" | "|" | "=" | "!" | "~" | ">" | "<" | "\" ;
(* Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\&bar
*)
```
Examples:
- Simple filter: title=example
- Multiple values filter: title=foo|bar|baz
- Complex filter: modified>2024-01-01
- Combined query: title=foo&average_severity=high
- Escaped characters: title=foo\\&bar
required: false
schema:
type: string
Expand Down