Skip to content

Commit dddfd5c

Browse files
authored
repo: Set user-agent in test client (#659)
1 parent 6cc2afb commit dddfd5c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

repo/tuf_on_ci/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
from tuf.api.metadata import Metadata
1818
from tuf.ngclient import Updater, UpdaterConfig
1919

20+
from tuf_on_ci import __version__
21+
2022

2123
def expiry_check(dir: str, role: str, timestamp: int):
2224
ref_time = datetime.fromtimestamp(timestamp, UTC)
@@ -63,7 +65,10 @@ def client(
6365

6466
# Allow for a large number of root rotations, as metadata is
6567
# not cached during testing
66-
config = UpdaterConfig(max_root_rotations=256)
68+
config = UpdaterConfig(
69+
max_root_rotations=256,
70+
app_user_agent=f"tuf-on-ci-test-client/{__version__}",
71+
)
6772

6873
# initialize client with --initial-root or from metadata_url
6974
if initial_root is not None:

0 commit comments

Comments
 (0)