class keg_storage.backends.base.FileMode[source]

An enumeration.

class keg_storage.backends.base.ShareLinkOperation[source]

An enumeration.

class keg_storage.backends.base.InternalLinkTokenData(path, operations)[source]

Alias for field number 1


Alias for field number 0

class keg_storage.backends.base.InternalLinksStorageBackend(*, linked_endpoint: Optional[str], secret_key: Optional[bytes], name: str)[source]

Base class for storage backends that do not have their own direct method of creating download/upload/deletion URLs. To use the link_to feature for such backends, the app must provide it’s own endpoint to handle the requests. See plugin.LinkViewMixin for a base implementation of such an endpoint.

Create a signed JWT authorizing the user to perform the specified operations

Verify a JWT and extract the path and allowed operations

Create a URL pointing to the given linked_endpoint containing a JWT authorizing the user user to perform the given operations.

This is currently only implemented for flask based apps but you may override this method in your own subclass to support other frameworks.

To use this method you must provide secret_key and linked_endpoint to the constructor.