-
Notifications
You must be signed in to change notification settings - Fork 46
Steve promises to work on the snippet scanner #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -101,7 +101,7 @@ paths: | |
| $ref: '#/components/schemas/sbom' | ||
| responses: | ||
| '200': | ||
| description: Successful oepeartion | ||
| description: Successful operation | ||
| content: | ||
| application/json: | ||
| schema: | ||
|
|
@@ -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 | ||
| 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. invalid ID |
||
|
|
||
| components: | ||
| schemas: | ||
| sbom: | ||
|
|
@@ -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' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add scanResult: |
||
There was a problem hiding this comment.
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