Skip to content

Commit

Permalink
Release 0.7.3 (#24)
Browse files Browse the repository at this point in the history
## [0.7.3] - 2023-11-09

- Fixed IDE autocompletion naming for the Software and Vulnerability
classes by modifying the underlying class names which previously did not
match the exported class name.
  • Loading branch information
treyburn authored Nov 9, 2023
1 parent d5ec208 commit 6e33c50
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.3] - 2023-11-09

- Fixed IDE autocompletion naming for the Software and Vulnerability classes by modifying the underlying class names which previously did not match the exported class name.

## [0.7.2] - 2023-11-06

- Patched `urllib3` dependency to latest version to resolve `CVE-2023-45803`.
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ codegen-models: _codegen-models fmt
.PHONY: _codegen-models
_codegen-models:
poetry run datamodel-codegen --input ./api/proposed-runzero-api.yml --field-constraints --collapse-root-models \
--use-schema-description --validation --use-field-description --allow-population-by-field-name --output ./runzero/types/_data_models_gen.py --target-python-version 3.8
--use-schema-description --validation --use-field-description --allow-population-by-field-name \
--use-title-as-name --snake-case-field --output ./runzero/types/_data_models_gen.py --target-python-version 3.8

# Syncs your local deps with the current lockfile and updates poetry
.PHONY: sync-deps
Expand Down
51 changes: 26 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 = "runzero-sdk"
version = "0.7.2"
version = "0.7.3"
description = "The runZero platform sdk"
license = "BSD-2-Clause"
authors = ["runZero <support@runzero.com>"]
Expand Down Expand Up @@ -57,7 +57,7 @@ mypy-extensions = "^1.0.0"
tox = "^4.4.7"

[tool.poetry.group.codegen.dependencies]
datamodel-code-generator = { version = ">=0.17.1,<0.23.0", extras = ["http"]}
datamodel-code-generator = { version = ">=0.17.1,<0.24.0", extras = ["http"]}

[tool.poetry.group.docs.dependencies]
sphinx = ">=6.1.3,<8.0.0"
Expand Down
1 change: 1 addition & 0 deletions runzero/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
if they are not useful outside of that package, but should inherit a base type here.
"""


class Error(Exception):
"""Error is a named Exception class representing bottom-level runZero Error type.
Expand Down
10 changes: 5 additions & 5 deletions runzero/types/_data_models_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: proposed-runzero-api.yml
# timestamp: 2023-10-12T20:58:44+00:00
# timestamp: 2023-11-09T18:03:35+00:00

from __future__ import annotations

Expand Down Expand Up @@ -198,7 +198,7 @@ class Config:
__root__: str = Field(..., example="host.domain.com", max_length=260)


class AssetSoftware(BaseModel):
class Software(BaseModel):
"""
A piece of installed software on an asset.
"""
Expand Down Expand Up @@ -294,7 +294,7 @@ class Config:
"""


class AssetVulnerability(BaseModel):
class Vulnerability(BaseModel):
"""
A vulnerability associated with an asset.
"""
Expand Down Expand Up @@ -1025,11 +1025,11 @@ class Config:
Arbitrary string tags applied to the asset.
"""
device_type: Optional[str] = Field(None, alias="deviceType", example="Desktop", max_length=1024)
software: Optional[List[AssetSoftware]] = Field(None, max_items=1000)
software: Optional[List[Software]] = Field(None, max_items=1000)
"""
The installed software on an asset.
"""
vulnerabilities: Optional[List[AssetVulnerability]] = Field(None, max_items=1000)
vulnerabilities: Optional[List[Vulnerability]] = Field(None, max_items=1000)
"""
The vulnerabilities associated with an asset.
"""
Expand Down
4 changes: 2 additions & 2 deletions runzero/types/_wrapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
# Note: `validator` has been replaced with `field_validator` in v2+
from pydantic import BaseModel, Field, ValidationError, validator

from ._data_models_gen import AssetSoftware as RESTSoftware
from ._data_models_gen import AssetVulnerability as RESTVulnerability
from ._data_models_gen import CustomIntegration as RESTCustomIntegration
from ._data_models_gen import Hostname as RESTHostname
from ._data_models_gen import ImportAsset as RESTImportAsset
from ._data_models_gen import NetworkInterface as RESTNetworkInterface
from ._data_models_gen import ScanOptions as RESTScanOptions
from ._data_models_gen import ScanTemplate as RESTScanTemplate
from ._data_models_gen import ScanTemplateOptions as RESTScanTemplateOptions
from ._data_models_gen import Software as RESTSoftware
from ._data_models_gen import Tag as RESTTag
from ._data_models_gen import Vulnerability as RESTVulnerability


class CustomIntegration(RESTCustomIntegration):
Expand Down

0 comments on commit 6e33c50

Please sign in to comment.