mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-27 18:28:42 +00:00
key storage: type hints / cleanup
This commit is contained in:
parent
360cd8488f
commit
2705ccb59b
1 changed files with 3 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
import textwrap
|
import textwrap
|
||||||
from binascii import a2b_base64, b2a_base64, hexlify
|
from binascii import a2b_base64, b2a_base64, hexlify
|
||||||
from hashlib import sha256, pbkdf2_hmac
|
from hashlib import sha256, pbkdf2_hmac
|
||||||
from typing import Literal, Callable
|
from typing import Literal, Callable, ClassVar
|
||||||
|
|
||||||
from ..logger import create_logger
|
from ..logger import create_logger
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ class KeyBase:
|
||||||
ARG_NAME = "UNDEFINED"
|
ARG_NAME = "UNDEFINED"
|
||||||
|
|
||||||
# Storage type (no key blob storage / keyfile / repo)
|
# Storage type (no key blob storage / keyfile / repo)
|
||||||
STORAGE = KeyBlobStorage.NO_STORAGE
|
STORAGE: ClassVar[str] = KeyBlobStorage.NO_STORAGE
|
||||||
|
|
||||||
# Seed for the buzhash chunker (borg.algorithms.chunker.Chunker)
|
# Seed for the buzhash chunker (borg.algorithms.chunker.Chunker)
|
||||||
# type is int
|
# type is int
|
||||||
|
@ -279,7 +279,6 @@ class PlaintextKey(KeyBase):
|
||||||
TYPES_ACCEPTABLE = {TYPE}
|
TYPES_ACCEPTABLE = {TYPE}
|
||||||
NAME = "plaintext"
|
NAME = "plaintext"
|
||||||
ARG_NAME = "none"
|
ARG_NAME = "none"
|
||||||
STORAGE = KeyBlobStorage.NO_STORAGE
|
|
||||||
|
|
||||||
chunk_seed = 0
|
chunk_seed = 0
|
||||||
logically_encrypted = False
|
logically_encrypted = False
|
||||||
|
@ -417,7 +416,7 @@ def init_ciphers(self, manifest_data=None):
|
||||||
|
|
||||||
class FlexiKey:
|
class FlexiKey:
|
||||||
FILE_ID = "BORG_KEY"
|
FILE_ID = "BORG_KEY"
|
||||||
STORAGE = KeyBlobStorage.NO_STORAGE # override in subclass
|
STORAGE: ClassVar[str] = KeyBlobStorage.NO_STORAGE # override in subclass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(cls, repository, manifest_data):
|
def detect(cls, repository, manifest_data):
|
||||||
|
|
Loading…
Reference in a new issue