Skip to content

Commit dd58b7a

Browse files
committed
chore(nhi): add vault_path and vault_path_count attributes to PoliyBreak model
1 parent b1c4bef commit dd58b7a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pygitguardian/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ class PolicyBreakSchema(BaseSchema):
234234
DiffKind, by_value=True, required=False, load_default=None, dump_default=None
235235
)
236236
is_vaulted = fields.Boolean(required=False, load_default=False, dump_default=False)
237+
vault_path = fields.String(required=False, load_default=None, dump_default=None)
238+
vault_path_count = fields.Int(required=False, load_default=None, dump_default=None)
237239

238240
@post_load
239241
def make_policy_break(self, data: Dict[str, Any], **kwargs: Any) -> "PolicyBreak":
@@ -265,6 +267,8 @@ def __init__(
265267
exclude_reason: Optional[str] = None,
266268
diff_kind: Optional[DiffKind] = None,
267269
is_vaulted: bool = False,
270+
vault_path: Optional[str] = None,
271+
vault_path_count: Optional[int] = None,
268272
**kwargs: Any,
269273
) -> None:
270274
super().__init__()
@@ -281,6 +285,8 @@ def __init__(
281285
self.exclude_reason = exclude_reason
282286
self.diff_kind = diff_kind
283287
self.is_vaulted = is_vaulted
288+
self.vault_path = vault_path
289+
self.vault_path_count = vault_path_count
284290

285291
@property
286292
def is_secret(self) -> bool:

tests/test_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ def test_document_handle_surrogates(self):
171171
"exclude_reason": None,
172172
"diff_kind": None,
173173
"is_vaulted": False,
174+
"vault_path": None,
175+
"vault_path_count": None,
174176
},
175177
),
176178
(
@@ -190,6 +192,8 @@ def test_document_handle_surrogates(self):
190192
"exclude_reason": None,
191193
"diff_kind": "addition",
192194
"is_vaulted": True,
195+
"vault_path": "hashicorpvault:my-vault:my-secret",
196+
"vault_path_count": 3,
193197
},
194198
),
195199
(

0 commit comments

Comments
 (0)