Skip to content

Commit

Permalink
Add support for new metadata attributes: source and references (#34)
Browse files Browse the repository at this point in the history
* Add support for new metadata attributes: source and refeerences

* Bump version
  • Loading branch information
rmouritzen-splunk authored Oct 24, 2024
1 parent 8362af5 commit 0be349f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions ocsf_validator/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class OcsfDeprecationInfo(TypedDict):
since: Required[str]


class OcsfReference(TypedDict):
url: Required[str]
description: Required[str]


OcsfReferences = Sequence[OcsfReference]


OcsfAttr = TypedDict(
"OcsfAttr",
{
Expand All @@ -64,6 +72,8 @@ class OcsfDeprecationInfo(TypedDict):
"profile": NotRequired[Optional[Sequence[str]]],
"values": NotRequired[Sequence[Any]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"source": NotRequired[str],
"references": NotRequired[OcsfReferences],
},
)

Expand Down Expand Up @@ -135,6 +145,7 @@ class OcsfProfile(TypedDict):
"observables": NotRequired[Dict[str, int]],
"$include": NotRequired[Union[str, Sequence[str]]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"references": NotRequired[OcsfReferences],
},
)

Expand All @@ -155,6 +166,7 @@ class OcsfProfile(TypedDict):
"observables": NotRequired[Dict[str, int]],
"$include": NotRequired[Union[str, Sequence[str]]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"references": NotRequired[OcsfReferences],
},
)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ocsf-validator"
version = "0.2.1"
version = "0.2.2"
description = "OCSF Schema Validation"
authors = [
"Jeremy Fisher <[email protected]>",
Expand All @@ -26,4 +26,4 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"
profile = "black"

0 comments on commit 0be349f

Please sign in to comment.