readium-lcp-server icon indicating copy to clipboard operation
readium-lcp-server copied to clipboard

A new endpoint for easing subscription management

Open llemeurfr opened this issue 8 months ago • 0 comments

When content providers use a subscription model, they have to periodically extend the end date of a license. Client reading applications must be aware of this extension and update their copy of the license as soon as the app opens the corresponding ebook.

When a user selects an ebook, a first end date is set at the time the license is generated; this date corresponds to the end of the subscription period. This first activation period can be short in the case of a trial period. Each time the user extends his subscription, the platform has to extend the end date of each license the user possesses, and the new end date corresponds to the subscription period.

The renting_days configuration parameter sets a limit on the possible extension of the license end date. If a user has returned a license or if a license has been cancelled or revoked, the extension of the license should not be possible.

The codebase is split between the License Server (LCP) and the Status Server (LSD). We implement the extension feature in a way similar to the loan renewal feature; the provider platform calls the Status Server using a /extend enpoint. The Status Server checks the validity of the request, updates the license by calling the License Server, and sets the date of last update of the license and status document (so that the client app is aware that it must download a new version of the license).

The main differences are that the new endpoint is private (it can only be called by an authorized system) and that the extension is possible even if the license has previously expired (because the user may subscribe after the trial period has ended).

llemeurfr avatar Jun 18 '24 15:06 llemeurfr