Skip to content

Commit 4a28307

Browse files
Fix typos
Signed-off-by: Dimitri Papadopoulos <[email protected]>
1 parent b1d9021 commit 4a28307

16 files changed

+32
-32
lines changed

docs/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This release is API compatible but contains a major internal change in the HTTP
1313
the fetcher at Updater initialization and explicitly depending on requests
1414
* ngclient: TLS certificate source was changed. Certificates now come from operating
1515
system certificate store instead of `certifi` (#2762)
16-
* Test infrastucture has improved and should now be more usable externally, e.g. in
16+
* Test infrastructure has improved and should now be more usable externally, e.g. in
1717
distro test suites (#2749)
1818

1919
## v5.1.0
@@ -789,7 +789,7 @@ Note: This is a backwards-incompatible pre-release.
789789
* Minor bug fixes, such as catching correct type and number of exceptions,
790790
detection of slow retrieval attack, etc.
791791

792-
* Do not list Root's hash and lenth in Snapshot (only its version number).
792+
* Do not list Root's hash and length in Snapshot (only its version number).
793793

794794
* Allow user to configure hashing algorithm used to generate hashed bin delegations.
795795

docs/_posts/2022-05-04-ngclient-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We recently released a new TUF client implementation, `ngclient`, in Python-TUF.
77

88
# Simpler implementation, "correct" abstractions
99

10-
The legacy code had a few problems that could be summarized as non-optimal abstractions: Significant effort had been put to code re-use, but not enough attention had been paid to ensure the expectations and promises of that shared code were the same in all cases of re-use. This combined with Pythons type ambiguity, use of dictionaries as "blob"-like data structures and extensive use of global state meant touching the shared functions was a gamble: there was no way to be sure something wouldn't break.
10+
The legacy code had a few problems that could be summarized as non-optimal abstractions: Significant effort had been put to code reuse, but not enough attention had been paid to ensure the expectations and promises of that shared code were the same in all cases of reuse. This combined with Pythons type ambiguity, use of dictionaries as "blob"-like data structures and extensive use of global state meant touching the shared functions was a gamble: there was no way to be sure something wouldn't break.
1111

1212
During the redesign, we really concentrated on finding abstractions that fit the processes we wanted to implement. It may be worth mentioning that in some cases this meant abstractions that have no equivalent in the TUF specification: some of the issues in the legacy implementation look like the result of mapping the TUF specifications [_Detailed client workflow_](https://theupdateframework.github.io/specification/latest/#detailed-client-workflow) directly into code.
1313

examples/manual_repo/hashed_bin_delegation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'repository_lib'. (see ADR-0010 for details about repository library design)
88
99
Contents:
10-
- Re-usable hash bin delegation helpers
10+
- Reusable hash bin delegation helpers
1111
- Basic hash bin delegation example
1212
1313
See 'basic_repo.py' for a more comprehensive TUF metadata API example.
@@ -133,7 +133,7 @@ def find_hash_bin(path: str) -> str:
133133
# Keys
134134
# ----
135135
# Given that the primary concern of hash bin delegation is to reduce network
136-
# overhead, it is acceptable to re-use one signing key for all delegated
136+
# overhead, it is acceptable to reuse one signing key for all delegated
137137
# targets roles (bin-n). However, we do use a different key for the delegating
138138
# targets role (bins). Considering the high responsibility but also low
139139
# volatility of the bins role, it is recommended to require signature

tests/simple_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import socketserver
99
from http.server import SimpleHTTPRequestHandler
1010

11-
# Allow re-use so you can re-run tests as often as you want even if the
12-
# tests re-use ports. Otherwise TCP TIME-WAIT prevents reuse for ~1 minute
11+
# Allow reuse so you can re-run tests as often as you want even if the
12+
# tests reuse ports. Otherwise TCP TIME-WAIT prevents reuse for ~1 minute
1313
socketserver.TCPServer.allow_reuse_address = True
1414

1515
httpd = socketserver.TCPServer(("localhost", 0), SimpleHTTPRequestHandler)

tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_generic_read(self) -> None:
105105
(Timestamp.type, Timestamp),
106106
(Targets.type, Targets),
107107
]:
108-
# Load JSON-formatted metdata of each supported type from file
108+
# Load JSON-formatted metadata of each supported type from file
109109
# and from out-of-band read JSON string
110110
path = os.path.join(self.repo_dir, "metadata", metadata + ".json")
111111
md_obj = Metadata.from_file(path)
@@ -181,7 +181,7 @@ def test_to_from_bytes(self) -> None:
181181
with open(path, "rb") as f:
182182
metadata_bytes = f.read()
183183
md_obj = Metadata.from_bytes(metadata_bytes)
184-
# Comparate that from_bytes/to_bytes doesn't change the content
184+
# Compare that from_bytes/to_bytes doesn't change the content
185185
# for two cases for the serializer: noncompact and compact.
186186

187187
# Case 1: test noncompact by overriding the default serializer.

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def tearDown(self) -> None:
4848
def _run_script_and_assert_files(
4949
self, script_name: str, filenames_created: list[str]
5050
) -> None:
51-
"""Run script in exmple dir and assert that it created the
51+
"""Run script in example dir and assert that it created the
5252
files corresponding to the passed filenames inside a 'tmp*' test dir at
5353
CWD."""
5454
script_path = str(self.repo_examples_dir / script_name)

tests/test_metadata_eq_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828

2929

30-
class TestMetadataComparisions(unittest.TestCase):
30+
class TestMetadataComparisons(unittest.TestCase):
3131
"""Test __eq__ for all classes inside tuf/api/metadata.py."""
3232

3333
metadata: ClassVar[dict[str, bytes]]

tests/test_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def test_do_snapshot_after_snapshot_key_change(self) -> None:
209209
self.assertEqual(2, snapshot_versions[-1].signed.version)
210210

211211
def test_do_timestamp(self) -> None:
212-
# Expect no-op because snpashot has not changed and timestamp is still valid
212+
# Expect no-op because snapshot has not changed and timestamp is still valid
213213
created, _ = self.repo.do_timestamp()
214214

215215
self.assertFalse(created)

tests/test_trusted_metadata_set.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ def test_update_metadata_output(self) -> None:
152152
)
153153
snapshot = self.trusted_set.update_snapshot(self.metadata["snapshot"])
154154
targets = self.trusted_set.update_targets(self.metadata["targets"])
155-
delegeted_targets_1 = self.trusted_set.update_delegated_targets(
155+
delegated_targets_1 = self.trusted_set.update_delegated_targets(
156156
self.metadata["role1"], "role1", "targets"
157157
)
158-
delegeted_targets_2 = self.trusted_set.update_delegated_targets(
158+
delegated_targets_2 = self.trusted_set.update_delegated_targets(
159159
self.metadata["role2"], "role2", "role1"
160160
)
161161
self.assertIsInstance(timestamp, Timestamp)
162162
self.assertIsInstance(snapshot, Snapshot)
163163
self.assertIsInstance(targets, Targets)
164-
self.assertIsInstance(delegeted_targets_1, Targets)
165-
self.assertIsInstance(delegeted_targets_2, Targets)
164+
self.assertIsInstance(delegated_targets_1, Targets)
165+
self.assertIsInstance(delegated_targets_2, Targets)
166166

167167
def test_out_of_order_ops(self) -> None:
168168
# Update snapshot before timestamp
@@ -193,7 +193,7 @@ def test_out_of_order_ops(self) -> None:
193193

194194
self.trusted_set.update_targets(self.metadata[Targets.type])
195195

196-
# Update snapshot after sucessful targets update
196+
# Update snapshot after successful targets update
197197
with self.assertRaises(RuntimeError):
198198
self.trusted_set.update_snapshot(self.metadata[Snapshot.type])
199199

tests/test_updater_delegation_graphs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def test_hash_bins_graph_traversal(
399399
) -> None:
400400
"""Test that delegated roles are traversed in the order of appearance
401401
in the delegator's metadata, using pre-order depth-first search and that
402-
they correctly reffer to the corresponding hash bin prefixes"""
402+
they correctly refer to the corresponding hash bin prefixes"""
403403

404404
try:
405405
exp_files = [*TOP_LEVEL_ROLE_NAMES, *test_data.visited_order]
@@ -440,37 +440,37 @@ class SuccinctRolesTestCase:
440440
# In each test case target_path is a path to a random target we want to
441441
# fetch and expected_target_bin is the bin we are expecting to visit.
442442
succinct_bins_graph = {
443-
"bin amount = 2, taget bin index 0": SuccinctRolesTestCase(
443+
"bin amount = 2, target bin index 0": SuccinctRolesTestCase(
444444
bit_length=1,
445445
target_path="boo",
446446
expected_target_bin="bin-0",
447447
),
448-
"bin amount = 2, taget bin index 1": SuccinctRolesTestCase(
448+
"bin amount = 2, target bin index 1": SuccinctRolesTestCase(
449449
bit_length=1,
450450
target_path="too",
451451
expected_target_bin="bin-1",
452452
),
453-
"bin amount = 4, taget bin index 0": SuccinctRolesTestCase(
453+
"bin amount = 4, target bin index 0": SuccinctRolesTestCase(
454454
bit_length=2,
455455
target_path="foo",
456456
expected_target_bin="bin-0",
457457
),
458-
"bin amount = 4, taget bin index 1": SuccinctRolesTestCase(
458+
"bin amount = 4, target bin index 1": SuccinctRolesTestCase(
459459
bit_length=2,
460460
target_path="doo",
461461
expected_target_bin="bin-1",
462462
),
463-
"bin amount = 4, taget bin index 2": SuccinctRolesTestCase(
463+
"bin amount = 4, target bin index 2": SuccinctRolesTestCase(
464464
bit_length=2,
465465
target_path="too",
466466
expected_target_bin="bin-2",
467467
),
468-
"bin amount = 4, taget bin index 3": SuccinctRolesTestCase(
468+
"bin amount = 4, target bin index 3": SuccinctRolesTestCase(
469469
bit_length=2,
470470
target_path="bar",
471471
expected_target_bin="bin-3",
472472
),
473-
"bin amount = 256, taget bin index fc": SuccinctRolesTestCase(
473+
"bin amount = 256, target bin index fc": SuccinctRolesTestCase(
474474
bit_length=8,
475475
target_path="bar",
476476
expected_target_bin="bin-fc",

0 commit comments

Comments
 (0)