Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/ctim/examples/incidents.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
:schema_version c/ctim-schema-version
:confidence "High"})

(def incident-maximal-nil-short-id
(assoc incident-maximal :short_id nil))

(def new-incident-maximal
incident-maximal)

Expand Down
9 changes: 9 additions & 0 deletions src/ctim/schemas/common.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@
:name "Markdown"
:description "Markdown string with at most 5000 characters."))

(cs/def ::nullable-short-string
(cs/or :string (cs/and string? (pred/max-len 1024))
:nil nil?))

(def NullableShortString
(f/anything :spec ::nullable-short-string
:description "String with at most 1024 characters, or null."
:name "NullableShortString"))

(def OpenVocab
(f/str :description (str "SHOULD be all lowercase (where lowercase is defined by the "
"locality conventions) and SHOULD use hyphens instead of "
Expand Down
4 changes: 2 additions & 2 deletions src/ctim/schemas/incident.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
(f/entry :techniques [c/ShortString]
:description (str "Represents the specific methods or actions used by an attacker "
"to carry out an offensive maneuver or achieve their goals."))
(f/entry :short_id c/ShortString
:description "A human-readable, short identifier for the incident, unique within an organization.")))
(f/entry :short_id c/NullableShortString
:description "A human-readable, short identifier for the incident, unique within an organization. Can be null.")))

(def-entity-type NewIncident
"For submitting a new Incident."
Expand Down
1 change: 1 addition & 0 deletions test/ctim/schemas/entities_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
(validate-entities
[ice/incident-maximal ics/Incident]
[ice/incident-minimal ics/Incident]
[ice/incident-maximal-nil-short-id ics/Incident]
[ice/incident-maximal (-> ics/Incident
fu/replace-either-with-any
fu/require-all)]
Expand Down
Loading