Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes unused and TUF-specific content from securesystemslib #165

Merged
merged 10 commits into from
Sep 6, 2019
2 changes: 1 addition & 1 deletion securesystemslib/ed25519_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
except (ImportError, IOError): # pragma: no cover
pass

# The optimized pure Python implementation of Ed25519 provided by TUF. If
# The optimized pure Python implementation of Ed25519. If
# PyNaCl cannot be imported and an attempt to use is made in this module, a
# 'securesystemslib.exceptions.UnsupportedLibraryError' exception is raised.
import securesystemslib._vendor.ed25519.ed25519
Expand Down
57 changes: 2 additions & 55 deletions securesystemslib/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,47 +75,18 @@ def __str__(self):
') != expected hash (' + repr(self.expected_hash)+')'


class BadVersionNumberError(Error):
"""Indicate an error for metadata that contains an invalid version number."""


class BadPasswordError(Error):
"""Indicate an error after encountering an invalid password."""
pass


class UnknownKeyError(Error):
"""Indicate an error while verifying key-like objects (e.g., keyids)."""
pass


class RepositoryError(Error):
"""Indicate an error with a repository's state, such as a missing file."""
pass


class InsufficientKeysError(Error):
"""Indicate that metadata role lacks a threshold of pubic or private keys."""
pass


class ForbiddenTargetError(RepositoryError):
"""Indicate that a role signed for a target that it was not delegated to."""
pass


class ExpiredMetadataError(Error):
"""Indicate that a Metadata file has expired."""
pass


class CryptoError(Error):
"""Indicate any cryptography-related errors."""
pass


class BadSignatureError(CryptoError):
"""Indicate that some metadata file has a bad signature."""
"""Indicate that some metadata has a bad signature."""

def __init__(self, metadata_role_name):
self.metadata_role_name = metadata_role_name
Expand All @@ -134,6 +105,7 @@ class UnsupportedLibraryError(Error):
pass


# TODO: Consider removal alongside the compression functions.
class DecompressionError(Error):
"""Indicate that some error happened while decompressing a file."""

Expand All @@ -146,31 +118,6 @@ def __str__(self):
return repr(self.exception)


class DownloadError(Error):
"""Indicate an error occurred while attempting to download a file."""
pass


class KeyAlreadyExistsError(Error):
"""Indicate that a key already exists and cannot be added."""
pass


class RoleAlreadyExistsError(Error):
"""Indicate that a role already exists and cannot be added."""
pass


class UnknownRoleError(Error):
"""Indicate an error trying to locate or identify a specified role."""
pass


class UnknownTargetError(Error):
"""Indicate an error trying to locate or identify a specified target."""
pass


class InvalidNameError(Error):
"""Indicate an error while trying to validate any type of named object."""
pass
Expand Down
Loading