Skip to content

Commit

Permalink
docs(osv): Add documentation to all top-level classes
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 6, 2024
1 parent 8836de6 commit 15bf4fc
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions clients/osv/src/main/kotlin/Model.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ data class Vulnerability(
val credits: Set<Credit> = emptySet()
)

/**
* The affected package and versions, meaning those that contain the vulnerability.
* See https://ossf.github.io/osv-schema/#affected-fields.
*/
@Serializable
data class Affected(
@SerialName("package")
Expand All @@ -78,6 +82,10 @@ data class Affected(
val databaseSpecific: JsonObject? = null
)

/**
* A way to give credit for the discovery, confirmation, patch, or other events in the life cycle of a vulnerability.
* See https://ossf.github.io/osv-schema/#credits-fields.
*/
@Serializable
data class Credit(
val name: String,
Expand Down Expand Up @@ -122,6 +130,10 @@ object Ecosystem {
const val SWIFT_URL = "SwiftURL"
}

/**
* A representation of a status change for an affected package.
* See https://ossf.github.io/osv-schema/#affectedrangesevents-fields.
*/
@Serializable(EventSerializer::class)
data class Event(
val type: Type,
Expand All @@ -135,6 +147,10 @@ data class Event(
}
}

/**
* A class to identify the the affected code library or command provided by the package.
* See https://ossf.github.io/osv-schema/#affectedpackage-field.
*/
@Serializable
data class Package(
/** See also [Ecosystem]. */
Expand All @@ -143,6 +159,11 @@ data class Package(
val purl: String? = null
)

/**
* A class to store information about the affected version range of the given [type] and optional [repo] URL. Each of
* [events] describes the event that occurred in a single version.
* See https://ossf.github.io/osv-schema/#affectedranges-field.
*/
@Serializable
data class Range(
val type: Type,
Expand All @@ -167,6 +188,10 @@ data class Range(
}
}

/**
* A class to specify the [type] of reference, and the fully-qualified URL (including the scheme, typically “https://”)
* linking to additional information. See https://ossf.github.io/osv-schema/#references-field.
*/
@Serializable
data class Reference(
val type: Type,
Expand All @@ -187,6 +212,10 @@ data class Reference(
}
}

/**
* A class to escribe the quantitative [type] method used to calculate the associated [score].
* See https://ossf.github.io/osv-schema/#severitytype-field.
*/
@Serializable
data class Severity(
val type: Type,
Expand Down

0 comments on commit 15bf4fc

Please sign in to comment.