Conversation
Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>
|
Thank you for this feature, @thepwagner Review will take a while, did a part of it already. Are you planning on implementing the JSON- and XML normalizer, too? |
jkowalleck
left a comment
There was a problem hiding this comment.
partial review.
please find critical remarks with an ❌ .
other remarks are discussion items.
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| export enum VulnerabilityAnalysisResponse { |
There was a problem hiding this comment.
rename to ImpactAnalysisResponsesType as the XML schema defines?
There was a problem hiding this comment.
I switched to ImpactAnalysisResponse as this was the most consistent with the JSON schema, even if the JSON schema doesn't give this enum a standalone definition.
Please advise if you'd prefer a different name.
Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>
Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>
Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>
|
@jkowalleck thank you for the quick initial feedback!
I was not intending to implement the normalizers. |
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| export enum AffectedStatus { |
There was a problem hiding this comment.
👍 lets keep it as enum AffectedStatus.
alternative enum ImpactAnalysisAffectedStatus might get in conflict with enum ImpactAnalysisState which already has a value NotAffected.
| compare (other: SortableSet<T>): number { | ||
| const thisSorted = this.sorted() | ||
| const otherSorted = other.sorted() | ||
| const lenDiff = thisSorted.length - otherSorted.length |
There was a problem hiding this comment.
❌ why sort upfront?
Could you add an in-code comment to explain?
| return lenDiff | ||
| } | ||
|
|
||
| for (let i = 0; i < thisSorted.length; i++) { |
There was a problem hiding this comment.
❌ better: for ( const i=0 ; i < thisSorted.length ; ++i ) {}
|
|
||
| /** | ||
| * Define the format for acceptable Common Weakness Enumeration (CWE) IDs. | ||
| * Refer to {@link https://cwe.mitre.org/index.html} for official specification. |
| */ | ||
| capitaliseFirstLetter: s => s.charAt(0).toUpperCase() + s.slice(1), | ||
| /** | ||
| * UpperCamelCase a string |
There was a problem hiding this comment.
i liked the old description better.
I understand the need for more description.
❌ better go with:
UpperCamelCase a string ("white space example", "snake_case_example" or "kebab-case-example" )
❌ when on it, lets replace not only _ but also -(kebab-case)
| } | ||
|
|
||
| export class VulnerabilityCredits implements Comparable { | ||
| organizations?: OrganizationalEntityRepository |
There was a problem hiding this comment.
❌ repositories must not be optiional, but they may be empty
|
|
||
| export class VulnerabilityCredits implements Comparable { | ||
| organizations?: OrganizationalEntityRepository | ||
| individuals?: OrganizationalContactRepository |
There was a problem hiding this comment.
❌ repositories must not be optiional, but they may be empty
| } | ||
|
|
||
| compare (other: VulnerabilityRating): number { | ||
| return (this.score ?? 0) - (other.score ?? 0) |
There was a problem hiding this comment.
this appears to be like an insufficient comparison.
if this is enough to properly compare, then please add a in-code comment that explains why.
| } | ||
|
|
||
| compare (other: VulnerabilityReference): number { | ||
| return (this.id ?? '').localeCompare(other.id ?? '') |
There was a problem hiding this comment.
❌ unnecessary null-comparisson
| import { Comparable, SortableSet } from '../helpers/sortableSet' | ||
|
|
||
| interface OptionalProperties { | ||
| url?: URL | string |
There was a problem hiding this comment.
❌ use type refenrences ala VulnerabilitySource['url']
|
The changes remaining on this PR are far removed from my initial use case: as you can tell I'm not a strong TypeScript developer, and all I wanted was the I appreciate the value that your normalization brings, but the added complexity means contributing to this library is outside of my ability. If anyone else wants to pick this up for the basis of the implementation, please do! @jkowalleck thank you for the reviews and sorry I couldn't see this through. |
|
thank you for all your work, @thepwagner could you open a pull request with your latest things and have it target the "feature/vulnerabilities" branch ? Then, in a later feature, the normalizers and serializers can be developed and be released separately. This way you (and others) will have the models for use soon, |
|
work continues in #419 |
Add Vulnerabilties to the Bom model, including enums as needed.
The implementation is styled after the existing
Componentimplementation and tests.this is part of #164