swh.alter.recovery_bundle module#
- swh.alter.recovery_bundle.check_call(command: Sequence[str], **kwargs) CompletedProcess [source]#
- class swh.alter.recovery_bundle.Manifest(version: int, removal_identifier: str, created: datetime, requested: List[Origin | ExtendedSWHID], swhids: List[ExtendedSWHID], referencing: List[ExtendedSWHID], decryption_key_shares: Dict[str, str], reason: str | None = None, expire: datetime | None = None)[source]#
Bases:
object
Method generated by attrs for class Manifest.
- requested: List[Origin | ExtendedSWHID]#
- swhids: List[ExtendedSWHID]#
- referencing: List[ExtendedSWHID]#
- swh.alter.recovery_bundle.age_encrypt(public_key: str, cleartext: bytes, armored_output=False) bytes [source]#
- swh.alter.recovery_bundle.age_decrypt_from_identity(identity_file: str, ciphertext: bytes | str) bytes [source]#
- class swh.alter.recovery_bundle.SecretSharing(minimum_required_groups: int, groups: Dict[str, _SecretSharingGroup])[source]#
Bases:
object
Method generated by attrs for class SecretSharing.
- class swh.alter.recovery_bundle.RecoveryBundle(path: str, object_decryption_key_provider: Callable[[Manifest], str] | None = None)[source]#
Bases:
object
- property requested: List[Origin | ExtendedSWHID]#
- property swhids: List[ExtendedSWHID]#
- property referencing: List[ExtendedSWHID]#
- write_content_data(swhid: ExtendedSWHID, dest: BinaryIO)[source]#
- skipped_contents() Iterator[SkippedContent] [source]#
- origin_visits(origin: Origin) Iterator[OriginVisit] [source]#
- origin_visit_statuses(origin: Origin) Iterator[OriginVisitStatus] [source]#
- raw_extrinsic_metadata() Iterator[RawExtrinsicMetadata] [source]#
- get_missing_referenced_objects(storage: StorageInterface) Set[ExtendedSWHID] [source]#
- restore(storage: ~swh.storage.interface.StorageInterface, progressbar: ~swh.alter.progressbar.ProgressBarInit = <function no_progressbar>) Dict[str, int] [source]#
- rollover(secret_sharing: SecretSharing)[source]#
Update the recovery bundle encrypted shared secrets using the given configuration.
It is useful when a secret holder needs to be added or removed, or to switch to an entirely new scheme.
This method splits the decryption key into new encrypted shares. The decryption key stays the same. The mnemonics will be new.
A new recovery bundle file is created with an updated manifest which then atomically replaces the existing file.
- exception swh.alter.recovery_bundle.ContentDataNotFound(swhid: ExtendedSWHID)[source]#
Bases:
Exception
Raised when data for a given Content object cannot be retrieved.
- class swh.alter.recovery_bundle.RecoveryBundleCreator(path: str, storage: StorageInterface, removal_identifier: str, requested: List[Origin | ExtendedSWHID], referencing: List[ExtendedSWHID], object_public_key: str, decryption_key_shares: Dict[str, str], registration_callback: Callable[[BaseModel], None] | None = None, allow_empty_content_objects: bool = False)[source]#
Bases:
object