SealSkin
Server Referencerouters

shares

Public file shares: management for owners and anonymous download pages.

attributelogger
= logging.getLogger(__name__)
attributerouter
= APIRouter(prefix='/api/files', dependencies=[Depends(verify_public_sharing_enabled)], route_class=EncryptedRoute)
attributepublic_router
= APIRouter()
attributeDOWNLOAD_TOKEN_TTL
= 60
func_share_info(share_id, meta) -> PublicShareInfo

Build the owner-facing view of a share.

paramshare_idstr
parammetaPublicShareMetadata

Returns

app.models.PublicShareInfo
funccreate_public_share(decrypted_body=Depends(get_decrypted_request_body), user=Depends(verify_public_sharing_enabled)) -> PublicShareInfo

Copy a file into public storage and register a share for it.

paramdecrypted_bodydict[str, Any]
= Depends(get_decrypted_request_body)
paramuserdict[str, Any]
= Depends(verify_public_sharing_enabled)

Returns

app.models.PublicShareInfo
funclist_public_shares(user=Depends(verify_public_sharing_enabled)) -> list[PublicShareInfo]

List the caller's shares, newest first.

paramuserdict[str, Any]
= Depends(verify_public_sharing_enabled)

Returns

list[app.models.PublicShareInfo]
funcdelete_public_share(share_id, user=Depends(verify_public_sharing_enabled)) -> Response

Delete one of the caller's shares.

paramshare_idstr
paramuserdict[str, Any]
= Depends(verify_public_sharing_enabled)

Returns

fastapi.Response
func_remove_share_file(share_id) -> None

Delete the public copy of a shared file, logging failures.

paramshare_idstr

Returns

None
funccleanup_expired_shares() -> None

Remove expired shares and stale download tokens.

Returns

None
func_password_page(share_id, error='') -> HTMLResponse | None

Render the password prompt page, or None if the template is missing.

paramshare_idstr
paramerrorstr
= ''

Returns

fastapi.responses.HTMLResponse | None
func_share_or_404(share_id) -> PublicShareMetadata

Return share metadata or raise 404.

paramshare_idstr

Returns

app.models.PublicShareMetadata
func_file_response(share_id, metadata) -> FileResponse

Stream the shared file with its original name.

paramshare_idstr
parammetadataPublicShareMetadata

Returns

fastapi.responses.FileResponse
funcdownload_shared_file(token) -> FileResponse

Download a password-protected share with a one-time token.

paramtokenstr

Returns

fastapi.responses.FileResponse
funcaccess_public_share_get(share_id) -> Response

Serve a share, or the password prompt when it is protected.

paramshare_idstr

Returns

fastapi.Response
funcaccess_public_share_post(share_id, password=Form(...)) -> Response

Check a share password and redirect to a one-time download URL.

paramshare_idstr
parampasswordstr
= Form(...)

Returns

fastapi.Response