Commit graph

13 commits

Author SHA1 Message Date
Jussi Kukkonen
6ddc0838a2 Move fetchers around to make them public
RequestsFetcher should still be public (even if deprecated).

* We don't want to import RequestsFetcher in __init__
  (because that requires importing requests)
* but we do want RequestsFetcher to be importable publicly

Move both fetchers out of _internal: that was never the right place for
them anyway: they are public modules.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2025-02-14 17:42:45 +02:00
Jussi Kukkonen
140abd34dc Update requirements: drop requests
This also removes RequestsFetcher from tuf.ngclient.__init__.py:
Otherwise we can't drop the requests dependency.

This means RequestsFetcher is not currently public.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2025-02-14 17:42:43 +02:00
NicholasTanz
86cc7ad3ee clarify urllib3 as requirement in pyproject.toml and add back in requestsFetcher as option.
Signed-off-by: NicholasTanz <nicholastanzillo@gmail.com>
2025-01-30 21:29:08 -05:00
NicholasTanz
0675f0ce3a create urllib3 fetcher, replace requestsFetcher with urllibFetcher in ngclient, replace requestsFecther with urllibFetcher in requestsFetcher unit tests.
Signed-off-by: NicholasTanz <nicholastanzillo@gmail.com>
2025-01-06 02:17:09 -05:00
Jussi Kukkonen
884cae9660 lint: Update formatting for ruff 3.x
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2024-03-07 10:05:36 +02:00
E3E
da38b473bd add pylint ruleset to ruff
Signed-off-by: E3E <ntanzill@purdue.edu>
2024-02-20 16:04:06 -05:00
Lukas Pühringer
93b8fb6377
Merge pull request #2279 from fridex/export-targetfile-ngclient
Export TUF TargetFile in ngclient
2023-01-31 09:19:41 +01:00
Fridolin Pokorny
524a6b848f
Export TUF TargetFile in ngclient
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
2023-01-26 15:54:44 +01:00
Fridolin Pokorny
5d347b8707
Fix pydocstyle D400: first line should end with a period
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
2023-01-26 15:33:09 +01:00
Jussi Kukkonen
f8a7881c87 Make RequestsFetcher public
This is useful for those who want to use the default fetcher
but modify some attributes

The file itself could be moved to tuf/ngclient/ but this is not done yet
as sigstore-python is using this internal module. Move can be done once
sigstore-python 1.0 is no longer relevant.

Fixes #2268

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-01-25 15:55:11 +02:00
Fridolin Pokorny
9ffb4a4474
Provide __all__ for tuf.ngclient module
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
2022-12-20 00:17:31 +01:00
Teodora Sechkova
a50e76d815
Add client config module
Add a config module containing a dataclass
UpdaterConfig with all client settings.
Initialize updater with default settings
if no other condig is provided.

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
2021-07-05 18:35:32 +03:00
Jussi Kukkonen
765c6fe020 ngclient: Add new client code
This is a new client library implementation using the Metadata API
(the only "old" file used is exceptions.py)
* Functional but largely still untested
* Requires work before it can replace tuf.client but should be good
  enough to include in the repo

The major changes compared to current client so far are:
 * Use of Metadata API
 * Major simplification in the way downloads are handled due to removing
   mirrors support
 * Separating tracking of valid metadata into a separate component
 * There's no MultiRepoUpdater

We do not expect other major changes (in the sense of moving large
amounts of code) but do plan to possibly improve the client API. The
API has already changed so this is not going to be a 1:1 compatible
implementation, but porting should not be difficult.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-07-05 10:45:19 +03:00