Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom LSD status endpoint to be specified via uri template #340

Open
judec opened this issue Nov 20, 2024 · 1 comment
Open

Allow custom LSD status endpoint to be specified via uri template #340

judec opened this issue Nov 20, 2024 · 1 comment

Comments

@judec
Copy link

judec commented Nov 20, 2024

If possible, it would be useful to allow an LCP implementer to define a custom endpoint for checking the status of a license, where additional logic could be implemented before serving the status document.

Similar functionality was previously implemented for renew_custom_url using a uri template:

RenewCustomUrl string `yaml:"renew_custom_url,omitempty"`

So in an example where we want our custom endpoint to be at 0.0.0.0:5050?action=lcp_status, we could provide a custom templated link like...

http://0.0.0.0:5050?action=lcp_status{&license_id}

... and LCP would use this link in the lcpl file and elsewhere.

In our particular use case, we would like to implement logic that would attempt to automatically renew the loan when status is checked, allowing us to issue short-term loans that auto-renew as long as they're being actively used (and as long as a renew is currently available).

@HadrienGardeur
Copy link

@llemeurfr this is something that we had in mind while working on the initial draft for the spec.

The idea being that the server that emits license doesn't have to be the same than the one that's serving the Status Document as long as they can interact with one another.

A typical use-case for that would be ODL. Let's say that I can borrow an ebook that's available:

  • protected by LCP
  • protected by ACS
  • and online through Web Reader

In ODL, a loan returns a License Status Document (LSD). In this specific case, this LSD would include links to:

  • an LCPL license
  • an ACSM license
  • and to the Web Reader itself

If the LCP server cannot point to that LSD and must serve its own instead, we'll end up with two separate documents:

  • the one returned in ODL
  • and the one referenced in the LCPL file

As you can imagine, that's not ideal.

I can give other use cases for that, there are plenty of good reasons to keep them separate when an implementer knows what it's doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants