Skip to content

Commit

Permalink
fixup! tuf: Create a new API to encapsulate TUF operations
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Detsch <[email protected]>
  • Loading branch information
detsch committed Nov 28, 2023
1 parent 5feda1d commit 4fb5d0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tuf/akrepo.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace aklite::tuf {
// TufRepo implementation that uses libaktualizr to provide TUF metadata handling and storage
class AkRepo : public TufRepo {
public:
AkRepo(const boost::filesystem::path& storage_path);
AkRepo(const Config& config);
explicit AkRepo(const boost::filesystem::path& storage_path);
explicit AkRepo(const Config& config);
std::vector<TufTarget> GetTargets() override;
void updateMeta(std::shared_ptr<RepoSource> repo_src) override;
void checkMeta() override;
Expand All @@ -29,10 +29,10 @@ class AkRepo : public TufRepo {
public:
explicit FetcherWrapper(std::shared_ptr<RepoSource> src);
void fetchRole(std::string* result, int64_t maxsize, Uptane::RepositoryType repo, const Uptane::Role& role,
Uptane::Version version) const;
Uptane::Version version) const override;

void fetchLatestRole(std::string* result, int64_t maxsize, Uptane::RepositoryType repo,
const Uptane::Role& role) const;
const Uptane::Role& role) const override;

private:
std::shared_ptr<RepoSource> repo_src;
Expand Down
3 changes: 2 additions & 1 deletion src/tuf/localreposource.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class LocalRepoSource : public RepoSource {
public:
class NotFoundException : public std::runtime_error {
public:
NotFoundException(const std::string &path) : std::runtime_error("Metadata hasn't been found; file path: " + path) {}
explicit NotFoundException(const std::string &path)
: std::runtime_error("Metadata hasn't been found; file path: " + path) {}
};

LocalRepoSource(const std::string &name_in, const std::string &local_path);
Expand Down

0 comments on commit 4fb5d0e

Please sign in to comment.