Skip to content

chore(nhi): rename is_secret_vaulted to is_vaulted #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed

- A bullet item for the Removed category.

-->

### Added

- Added `is_vaulted` field to `PolicyBreak`.

<!--
### Changed

- A bullet item for the Changed category.

-->
<!--
### Deprecated

- A bullet item for the Deprecated category.

-->
<!--
### Fixed

- A bullet item for the Fixed category.

-->
<!--
### Security

- A bullet item for the Security category.

-->
8 changes: 3 additions & 5 deletions pygitguardian/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ class PolicyBreakSchema(BaseSchema):
diff_kind = fields.Enum(
DiffKind, by_value=True, required=False, load_default=None, dump_default=None
)
is_secret_vaulted = fields.Boolean(
required=False, load_default=False, dump_default=False
)
is_vaulted = fields.Boolean(required=False, load_default=False, dump_default=False)

@post_load
def make_policy_break(self, data: Dict[str, Any], **kwargs: Any) -> "PolicyBreak":
Expand Down Expand Up @@ -264,7 +262,7 @@ def __init__(
is_excluded: bool = False,
exclude_reason: Optional[str] = None,
diff_kind: Optional[DiffKind] = None,
is_secret_vaulted: bool = False,
is_vaulted: bool = False,
**kwargs: Any,
) -> None:
super().__init__()
Expand All @@ -280,7 +278,7 @@ def __init__(
self.is_excluded = is_excluded
self.exclude_reason = exclude_reason
self.diff_kind = diff_kind
self.is_secret_vaulted = is_secret_vaulted
self.is_vaulted = is_vaulted

@property
def is_secret(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_document_handle_surrogates(self):
"is_excluded": False,
"exclude_reason": None,
"diff_kind": None,
"is_secret_vaulted": False,
"is_vaulted": False,
},
),
(
Expand All @@ -192,7 +192,7 @@ def test_document_handle_surrogates(self):
"is_excluded": False,
"exclude_reason": None,
"diff_kind": "addition",
"is_secret_vaulted": True,
"is_vaulted": True,
},
),
(
Expand Down
Loading