mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-17 20:01:44 +02:00
add salt args in more places
This commit is contained in:
@@ -36,6 +36,8 @@ class ABID(NamedTuple):
|
|||||||
uri: str # e.g. E4A5CCD9
|
uri: str # e.g. E4A5CCD9
|
||||||
subtype: str # e.g. 01
|
subtype: str # e.g. 01
|
||||||
rand: str # e.g. ZYEBQE
|
rand: str # e.g. ZYEBQE
|
||||||
|
|
||||||
|
# salt: str = DEFAULT_ABID_URI_SALT
|
||||||
|
|
||||||
def __getattr__(self, attr: str) -> Any:
|
def __getattr__(self, attr: str) -> Any:
|
||||||
return getattr(self.ulid, attr)
|
return getattr(self.ulid, attr)
|
||||||
|
@@ -26,6 +26,7 @@ from .abid import (
|
|||||||
ABID_RAND_LEN,
|
ABID_RAND_LEN,
|
||||||
ABID_SUFFIX_LEN,
|
ABID_SUFFIX_LEN,
|
||||||
DEFAULT_ABID_PREFIX,
|
DEFAULT_ABID_PREFIX,
|
||||||
|
DEFAULT_ABID_URI_SALT,
|
||||||
abid_part_from_prefix,
|
abid_part_from_prefix,
|
||||||
abid_from_values
|
abid_from_values
|
||||||
)
|
)
|
||||||
@@ -132,6 +133,7 @@ class ABIDModel(models.Model):
|
|||||||
uri=uri,
|
uri=uri,
|
||||||
subtype=subtype,
|
subtype=subtype,
|
||||||
rand=rand,
|
rand=rand,
|
||||||
|
salt=DEFAULT_ABID_URI_SALT,
|
||||||
)
|
)
|
||||||
assert abid.ulid and abid.uuid and abid.typeid, f'Failed to calculate {prefix}_ABID for {self.__class__.__name__}'
|
assert abid.ulid and abid.uuid and abid.typeid, f'Failed to calculate {prefix}_ABID for {self.__class__.__name__}'
|
||||||
return abid
|
return abid
|
||||||
|
Reference in New Issue
Block a user