mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-20 21:27:32 +00:00
rename KeyfileKeyBase -> FlexiKeyBase
it is used as direct base class for both: - RepoKey - KeyfileKey
This commit is contained in:
parent
d42e6f2c41
commit
ad405892ca
2 changed files with 5 additions and 5 deletions
|
@ -527,7 +527,7 @@ class PassphraseKey:
|
|||
NAME = 'passphrase'
|
||||
|
||||
|
||||
class KeyfileKeyBase(AESKeyBase):
|
||||
class FlexiKeyBase(AESKeyBase):
|
||||
@classmethod
|
||||
def detect(cls, repository, manifest_data):
|
||||
key = cls(repository)
|
||||
|
@ -640,7 +640,7 @@ def get_new_target(self, args):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
class KeyfileKey(ID_HMAC_SHA_256, KeyfileKeyBase):
|
||||
class KeyfileKey(ID_HMAC_SHA_256, FlexiKeyBase):
|
||||
TYPE = 0x00
|
||||
TYPES_ACCEPTABLE = {TYPE}
|
||||
NAME = 'key file'
|
||||
|
@ -731,7 +731,7 @@ def save(self, target, passphrase, create=False):
|
|||
self.target = target
|
||||
|
||||
|
||||
class RepoKey(ID_HMAC_SHA_256, KeyfileKeyBase):
|
||||
class RepoKey(ID_HMAC_SHA_256, FlexiKeyBase):
|
||||
TYPE = 0x03
|
||||
TYPES_ACCEPTABLE = {TYPE, PassphraseKey.TYPE}
|
||||
NAME = 'repokey'
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
from ..chunker import has_seek_hole
|
||||
from ..constants import * # NOQA
|
||||
from ..crypto.low_level import bytes_to_long, num_cipher_blocks
|
||||
from ..crypto.key import KeyfileKeyBase, RepoKey, KeyfileKey, Passphrase, TAMRequiredError
|
||||
from ..crypto.key import FlexiKeyBase, RepoKey, KeyfileKey, Passphrase, TAMRequiredError
|
||||
from ..crypto.keymanager import RepoIdMismatch, NotABorgKeyFile
|
||||
from ..crypto.file_integrity import FileIntegrityError
|
||||
from ..helpers import Location, get_security_dir
|
||||
|
@ -2850,7 +2850,7 @@ def test_init_interrupt(self):
|
|||
def raise_eof(*args):
|
||||
raise EOFError
|
||||
|
||||
with patch.object(KeyfileKeyBase, 'create', raise_eof):
|
||||
with patch.object(FlexiKeyBase, 'create', raise_eof):
|
||||
self.cmd('init', '--encryption=repokey', self.repository_location, exit_code=1)
|
||||
assert not os.path.exists(self.repository_location)
|
||||
|
||||
|
|
Loading…
Reference in a new issue