Module restore_code

Module restore_code 

Source
Expand description

Restore codes: single-string encoding of everything needed to restore a library from cloud.

A restore code encodes the library ID, encryption key, cloud provider details, and credentials into a single base64url string prefixed with “bae:”.

The code contains secrets (encryption key, S3 credentials). OAuth tokens are NOT included because they expire – the user re-authenticates on restore.

Structs§

RestoreCode
Everything needed to restore a library from cloud storage.
RestoreCodeInfo
UI-ready info from a decoded restore code.

Enums§

RestoreCodeError
RestoreProvider
Cloud provider details. Each variant carries only the fields needed for that provider. OAuth tokens are NOT stored (they expire); the user re-authenticates during restore.

Functions§

decode_restore_code
Decode a restore code string back into a RestoreCode.
decode_restore_code_info
Decode a restore code and return UI-ready info.
encode_restore_code
Encode a RestoreCode into a prefixed base64url string.
provider_needs_oauth
Returns true if this provider requires an OAuth flow before restore.