Skip to content

Commit 06ead93

Browse files
Remove system_dependencies (#105)
* remove system_dependencies from System model * Update tests for `system_dependencies` removal This also includes the additional validation of circular dependencies for ingress and egress. There was some previous discussion around the need for this and wanting these fields to be intentionally permissible so this commit may be reverted prior to merge. * remove validation of ingress/egress * changelog updates * Update src/fideslang/models.py Co-authored-by: Thomas <[email protected]> --------- Co-authored-by: Thomas <[email protected]>
1 parent 3c87969 commit 06ead93

File tree

6 files changed

+54
-130
lines changed

6 files changed

+54
-130
lines changed

CHANGELOG.md

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,99 +6,108 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/)
66

77
The types of changes are:
88

9-
* `Added` for new features.
10-
* `Changed` for changes in existing functionality.
11-
* `Developer Experience` for changes in developer workflow or tooling.
12-
* `Deprecated` for soon-to-be removed features.
13-
* `Removed` for now removed features.
14-
* `Fixed` for any bug fixes.
15-
* `Security` in case of vulnerabilities.
9+
- `Added` for new features.
10+
- `Changed` for changes in existing functionality.
11+
- `Developer Experience` for changes in developer workflow or tooling.
12+
- `Deprecated` for soon-to-be removed features.
13+
- `Removed` for now removed features.
14+
- `Fixed` for any bug fixes.
15+
- `Security` in case of vulnerabilities.
1616

1717
## [Unreleased](https://github.com/ethyca/fideslang/compare/1.3.2...main)
1818

1919
### Changed
20-
* Make `PrivacyDeclaration` use pydantic `orm_mode` [#101](https://github.com/ethyca/fideslang/pull/101)
20+
21+
- Make `PrivacyDeclaration` use pydantic `orm_mode` [#101](https://github.com/ethyca/fideslang/pull/101)
22+
23+
### Remove
24+
25+
- The `system_dependencies` field of `System` resources [#105](https://github.com/ethyca/fideslang/pull/105)
2126

2227
## [1.3.3](https://github.com/ethyca/fideslang/compare/1.3.2...1.3.3)
2328

2429
### Changed
25-
* Make `PrivacyDeclation.name` optional [#97](https://github.com/ethyca/fideslang/pull/97)
30+
31+
- Make `PrivacyDeclation.name` optional [#97](https://github.com/ethyca/fideslang/pull/97)
2632

2733
## [1.3.2](https://github.com/ethyca/fideslang/compare/1.3.1...1.3.2)
2834

2935
### Changed
30-
* Update css to brand colors, edit footer [#87](https://github.com/ethyca/fideslang/pull/87)
31-
* Moved over DSR concepts into Fideslang. Expanded allowable characters for FideKey and added additional Dataset validation. [#95](https://github.com/ethyca/fideslang/pull/95)
32-
* Docs css and link updates [#93](https://github.com/ethyca/fideslang/pull/93)
36+
37+
- Update css to brand colors, edit footer [#87](https://github.com/ethyca/fideslang/pull/87)
38+
- Moved over DSR concepts into Fideslang. Expanded allowable characters for FideKey and added additional Dataset validation. [#95](https://github.com/ethyca/fideslang/pull/95)
39+
- Docs css and link updates [#93](https://github.com/ethyca/fideslang/pull/93)
3340

3441
## [1.3.1](https://github.com/ethyca/fideslang/compare/1.3.0...1.3.1)
3542

3643
### Fixed
3744

38-
* `DataFlow` resource models included in `System` resource models are now exported to valid YAML [#89](https://github.com/ethyca/fideslang/pull/89)
45+
- `DataFlow` resource models included in `System` resource models are now exported to valid YAML [#89](https://github.com/ethyca/fideslang/pull/89)
3946

4047
## [1.3.0](https://github.com/ethyca/fideslang/compare/1.2.0...1.3.0)
4148

4249
### Added
4350

44-
* The `DataFlow` resource model defines a resource with which a `System` resource may communicate [#85](https://github.com/ethyca/fideslang/pull/85)
45-
* `PrivacyDeclaration`s may define `egress` and `ingress`, to contextualize communications with other resources [#85](https://github.com/ethyca/fideslang/pull/85)
51+
- The `DataFlow` resource model defines a resource with which a `System` resource may communicate [#85](https://github.com/ethyca/fideslang/pull/85)
52+
- `PrivacyDeclaration`s may define `egress` and `ingress`, to contextualize communications with other resources [#85](https://github.com/ethyca/fideslang/pull/85)
4653

4754
### Deprecated
4855

49-
* The `dataset_references` field of `PrivacyDeclaration` resources [#85](https://github.com/ethyca/fideslang/pull/85)
50-
* The `system_dependencies` field of `System` resources [#85](https://github.com/ethyca/fideslang/pull/85)
56+
- The `dataset_references` field of `PrivacyDeclaration` resources [#85](https://github.com/ethyca/fideslang/pull/85)
57+
- The `system_dependencies` field of `System` resources [#85](https://github.com/ethyca/fideslang/pull/85)
5158

5259
### Developer Experience
5360

54-
* The `DataFlow` resource model is exposed when importing `fideslang` [#85](https://github.com/ethyca/fideslang/pull/85)
61+
- The `DataFlow` resource model is exposed when importing `fideslang` [#85](https://github.com/ethyca/fideslang/pull/85)
5562

5663
### Docs
57-
* Updated the brand colors and footer on the docs site [#87](https://github.com/ethyca/fideslang/pull/87)
64+
65+
- Updated the brand colors and footer on the docs site [#87](https://github.com/ethyca/fideslang/pull/87)
66+
5867
### Fixed
5968

60-
* Fixed broken links in docs [#74](https://github.com/ethyca/fideslang/pull/74)
61-
* Pydantic 1.10.0 was causing issues so specified the pydantic version needs to be less than 1.10.0 [#79](https://github.com/ethyca/fideslang/pull/79)
62-
* Resolved a circular import in `default_taxonomy.py` [#85](https://github.com/ethyca/fideslang/pull/85)
69+
- Fixed broken links in docs [#74](https://github.com/ethyca/fideslang/pull/74)
70+
- Pydantic 1.10.0 was causing issues so specified the pydantic version needs to be less than 1.10.0 [#79](https://github.com/ethyca/fideslang/pull/79)
71+
- Resolved a circular import in `default_taxonomy.py` [#85](https://github.com/ethyca/fideslang/pull/85)
6372

6473
## [1.2.0](https://github.com/ethyca/fideslang/compare/1.1.0...1.2.0)
6574

6675
### Added
6776

68-
* New field `is_default` added to DataCategory, DataUse, DataSubject, and DataQualifier [#68](https://github.com/ethyca/fideslang/pull/68)
69-
* Return invalid key values as part of the stack trace for easier debugging [#55](https://github.com/ethyca/fideslang/pull/55)
77+
- New field `is_default` added to DataCategory, DataUse, DataSubject, and DataQualifier [#68](https://github.com/ethyca/fideslang/pull/68)
78+
- Return invalid key values as part of the stack trace for easier debugging [#55](https://github.com/ethyca/fideslang/pull/55)
7079

7180
### Docs
7281

73-
* Updated documentation for new Data Category and Use taxonomy [#69](https://github.com/ethyca/fideslang/pull/69)
82+
- Updated documentation for new Data Category and Use taxonomy [#69](https://github.com/ethyca/fideslang/pull/69)
7483

7584
### Changed
7685

77-
* Docker images now use Debian `bullseye` instead of `buster`
86+
- Docker images now use Debian `bullseye` instead of `buster`
7887

7988
### Fixed
8089

81-
* Add setuptools to dev-requirements to fix versioneer error [#72](https://github.com/ethyca/fideslang/pull/72)
90+
- Add setuptools to dev-requirements to fix versioneer error [#72](https://github.com/ethyca/fideslang/pull/72)
8291

8392
## 1.1.0
8493

8594
### Changed
8695

87-
* Simplification of Data Categories and Data Uses [#62](https://github.com/ethyca/fideslang/pull/62)
96+
- Simplification of Data Categories and Data Uses [#62](https://github.com/ethyca/fideslang/pull/62)
8897

8998
## 1.0.0
9099

91100
### Added
92101

93-
* There is now a `tags` field on the `FidesModel` model [#45](https://github.com/ethyca/fideslang/pull/45)
94-
* Add DatasetFieldBase model [#49](https://github.com/ethyca/fideslang/pull/49)
102+
- There is now a `tags` field on the `FidesModel` model [#45](https://github.com/ethyca/fideslang/pull/45)
103+
- Add DatasetFieldBase model [#49](https://github.com/ethyca/fideslang/pull/49)
95104

96105
## 0.9.0
97106

98107
### Added
99108

100-
* Created the fideslang standalone python module
109+
- Created the fideslang standalone python module
101110

102111
### Developer Experience
103112

104-
* Added a py.typed file
113+
- Added a py.typed file

src/fideslang/models.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,6 @@ class System(FidesModel):
937937
privacy_declarations: List[PrivacyDeclaration] = Field(
938938
description=PrivacyDeclaration.__doc__,
939939
)
940-
system_dependencies: Optional[List[FidesKey]] = Field(
941-
description="A list of fides keys to model dependencies."
942-
)
943940
joint_controller: Optional[ContactDetails] = Field(
944941
description=ContactDetails.__doc__,
945942
)
@@ -959,10 +956,6 @@ class System(FidesModel):
959956
"privacy_declarations", allow_reuse=True
960957
)(sort_list_objects_by_name)
961958

962-
_no_self_reference: classmethod = validator(
963-
"system_dependencies", allow_reuse=True, each_item=True
964-
)(no_self_reference)
965-
966959
_check_valid_country_code: classmethod = country_code_validator
967960

968961
@validator("privacy_declarations", each_item=True)
@@ -993,21 +986,6 @@ def privacy_declarations_reference_data_flows(
993986

994987
return value
995988

996-
@validator("system_dependencies")
997-
@classmethod
998-
def deprecate_system_dependencies(cls, value: List[FidesKey]) -> List[FidesKey]:
999-
"""
1000-
Warn that the `system_dependencies` field is deprecated, if set.
1001-
"""
1002-
1003-
if value is not None:
1004-
warn(
1005-
"The system_dependencies field is deprecated, and will be removed in a future version of fideslang. Use the 'egress' and 'ingress` fields instead.",
1006-
DeprecationWarning,
1007-
)
1008-
1009-
return value
1010-
1011989
class Config:
1012990
"""Class for the System config"""
1013991

src/fideslang/validation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def no_self_reference(value: FidesKey, values: Dict) -> FidesKey:
5151
5252
i.e. DataCategory.parent_key != DataCategory.fides_key
5353
"""
54-
5554
fides_key = FidesKey.validate(values.get("fides_key", ""))
5655
if value == fides_key:
5756
raise FidesValidationError("FidesKey can not self-reference!")

tests/fideslang/test_models.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -91,45 +91,6 @@ def test_system_valid(self) -> None:
9191
tags=["some", "tags"],
9292
)
9393

94-
def test_system_dependencies_deprecation(self) -> None:
95-
with deprecated_call(match="system_dependencies"):
96-
assert System(
97-
description="Test Policy",
98-
egress=[
99-
DataFlow(
100-
fides_key="test_system_2",
101-
type="system",
102-
data_categories=[],
103-
)
104-
],
105-
fides_key="test_system",
106-
ingress=[
107-
DataFlow(
108-
fides_key="test_system_3",
109-
type="system",
110-
data_categories=[],
111-
)
112-
],
113-
meta={"some": "meta stuff"},
114-
name="Test System",
115-
organization_fides_key=1,
116-
privacy_declarations=[
117-
PrivacyDeclaration(
118-
data_categories=[],
119-
data_qualifier="aggregated_data",
120-
data_subjects=[],
121-
data_use="provide",
122-
egress=["test_system_2"],
123-
ingress=["test_system_3"],
124-
name="declaration-name",
125-
)
126-
],
127-
registry_id=1,
128-
system_dependencies=[],
129-
system_type="SYSTEM",
130-
tags=["some", "tags"],
131-
)
132-
13394
def test_system_valid_no_egress_or_ingress(self) -> None:
13495
assert System(
13596
description="Test Policy",

tests/fideslang/test_relationships.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from fideslang import relationships
44
from fideslang.models import (
55
DataCategory,
6+
DataFlow,
67
Dataset,
78
DatasetCollection,
89
DatasetField,
@@ -34,7 +35,7 @@ def test_find_referenced_fides_keys_2():
3435
name="test_dc",
3536
fides_key="test_dc",
3637
description="test description",
37-
system_dependencies=["key_1", "key_2"],
38+
egress=[DataFlow(fides_key="key_1", type="system", data_categories=None), DataFlow(fides_key="key_2", type="system", data_categories=None)],
3839
system_type="test",
3940
privacy_declarations=None,
4041
)
@@ -65,7 +66,7 @@ def test_get_referenced_missing_keys():
6566
name="test_system",
6667
fides_key="test_system",
6768
description="test description",
68-
system_dependencies=["key_3", "key_4"],
69+
egress=[DataFlow(fides_key="key_3", type="system", data_categories=None), DataFlow(fides_key="key_4", type="system", data_categories=None)],
6970
system_type="test",
7071
privacy_declarations=None,
7172
)

tests/fideslang/test_validation.py

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
from pydantic import ValidationError
33

44
from fideslang.models import (
5+
CollectionMeta,
56
DataCategory,
7+
DataFlow,
8+
Dataset,
9+
DatasetCollection,
10+
DatasetField,
11+
DatasetMetadata,
612
DataUse,
13+
FidesCollectionKey,
14+
FidesDatasetReference,
15+
FidesMeta,
716
FidesModel,
817
Policy,
918
PolicyRule,
1019
PrivacyDeclaration,
1120
PrivacyRule,
1221
System,
13-
FidesDatasetReference,
14-
FidesMeta,
15-
Dataset,
16-
DatasetMetadata,
17-
DatasetCollection,
18-
CollectionMeta,
19-
DatasetField,
20-
FidesCollectionKey,
2122
)
2223
from fideslang.validation import FidesKey, FidesValidationError, valid_data_type
2324

@@ -225,36 +226,11 @@ def test_create_valid_system():
225226
dataset_references=[],
226227
)
227228
],
228-
system_dependencies=["another_system", "yet_another_system"],
229+
egress=[DataFlow(fides_key="another_system", type="system", data_categories=None), DataFlow(fides_key="yet_another_system", type="system", data_categories=None)],
229230
)
230231
assert True
231232

232233

233-
@pytest.mark.unit
234-
def test_circular_dependency_system():
235-
with pytest.raises(ValidationError):
236-
System(
237-
organization_fides_key=1,
238-
registryId=1,
239-
fides_key="test_system",
240-
system_type="SYSTEM",
241-
name="Test System",
242-
description="Test Policy",
243-
privacy_declarations=[
244-
PrivacyDeclaration(
245-
name="declaration-name",
246-
data_categories=[],
247-
data_use="provide.service",
248-
data_subjects=[],
249-
data_qualifier="aggregated_data",
250-
dataset_references=["test_system"],
251-
)
252-
],
253-
system_dependencies=["test_system"],
254-
)
255-
assert True
256-
257-
258234
@pytest.mark.unit
259235
@pytest.mark.parametrize("country_code", ["United States", "US", "usa"])
260236
def test_invalid_country_identifier(country_code: str):

0 commit comments

Comments
 (0)