Skip to content
Open
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
131 changes: 129 additions & 2 deletions Tooling-Landscape/CapabilityMap/ocToolingAPI_work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tags:
Precise scanning of sources to determine exact situation for proper compliance declarations
- name: snippetScanner
description: >-
Identify pieces of original code (source, object, binary) by comparing against known codebase
Identify pieces of original code (source, object, binary) by comparing against known codebase (Steve Kilbane promises to work on this one)
- name: packageArchive
description: >-
Store binaries or sources used in Software releases, so that they are available for later analysis / proof
Expand Down Expand Up @@ -101,7 +101,7 @@ paths:
$ref: '#/components/schemas/sbom'
responses:
'200':
description: Successful oepeartion
description: Successful operation
content:
application/json:
schema:
Expand Down Expand Up @@ -180,6 +180,85 @@ paths:
- casedatastore_auth:
- write:scan
- ''
/snippet-scan/:
get:
tags:
- snippetScanner
summary: Provide URL from which to pull sources for scanning.
operationId: uploadSources
parameters:
- name: purl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have a location instead of purl?
we might allow a file:// or s3:// or all sorts of locations

in: query
required: true
explode: true
schema:
type: string
example: type/namespace/name@version?qualifiers#subpath
description: >-
Passes location from which to retrieve sources to be scanned
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/scanRequestId'
'403':
description: Not authorized
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probaly we should add a code for "not accessible" concerning the location

'405':
description: Validation exception, invalid document
post:
tags:
- snippetScanner
summary: Push a single file or bundle of files (tarball, zip) for scanning. Receive an ID for claiming results later
operationId: uploadSources
requestBody:
description: A collection of sources for scanning.
content:
application/json:
schema:
$ref: '#/components/schemas/sourceBundle'
application/xml:
schema:
$ref: '#/components/schemas/sourceBundle'
responses:
'200':
description: Successful operation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cocnering the receipt of the code and the request has been queued

content:
application/json:
schema:
$ref: '#/components/schemas/scanRequestId'
'403':
description: Not authorized
'405':
description: Validation exception, invalid document
/snippet-scan-results/:
get:
tags:
- snippetScanner
summary: Retrieve results of previous request
operationId: getResults
parameters:
- name: scanId
in: query
required: true
explode: true
schema:
$ref: '#/components/schemas/scanRequestId'
description: >-
Provides Id received from a previous snippet-scan request
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/scanRequestId'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return scanResult. We should add a status in the result so that it could be still "in progress" or "failed"

'403':
description: Not authorized
'405':
description: Validation exception, invalid document
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid ID


components:
schemas:
sbom:
Expand Down Expand Up @@ -214,3 +293,51 @@ components:
something:
type: string
example: ''
scanRequestId:
type: object
properties:
RequestId:
type: integer
example: 1234
sourceFile:
type: object
properties:
filename:
type: string
example: /some/directory/path/file.java
content:
type: string
example: Hello-World example goes here
sourceBundle:
type: object
properties:
packagingType: string
files:
type: array
type: sourceFile
snippetMatch:
type: object
properties:
scannedSource:
type: object
properties:
filename:
type: string
example: /some/path/to/file.py
matches:
type: array
type: object
properties:
scannedSourceLineStart:
type: integer
scannedSourceLineEnd:
type: integer
matchedSourceLineStart:
type: integer
matchedSOurceLineEnd:
type: integer
matchedSourceFilename:
type: string
matchedComponent:
schema:
$ref: '#/components/schema/purl'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add scanResult:
type: array
properties:
snippetMatch