-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Send list of files through POST request #32
Comments
Hey @MonsieurV, I'm being slow to response - sorry about that, I'm on a vacation. And thank you for the detailed description! It's a pleasure to read and easy to understand. Indeed, today's API is supposed to be human-consumed. Having proper JSON api for other applications would be nice - I wanted it for a while, but could not justify its existence since no one was interested. Could you share your scenario so that we can account for it later? Implementation-wise, the API itself would be easy to add. However, we have no ways to track the server load for the API usage on the latexonline.cc, which I don't feel comfortable about: We might need to detect and restrict malicious clients of the API to keep service generally available. So one way to proceed would be to implement the API but forbid its usage on latexonline.cc until we come up with a sane way to identify API clients. This solution should satisfy your needs if you manage your own deployment of LatexOnline. What do you think? |
Speaking of being slow, I won't make any remark. :) My scenario is :
Returning to the implementation, it sure implies usage control. Bottom line is: if a method is public, the is no reason for it not to be abused. The fact it has not a very friendly JSON API makes it just a potential victim of sabotage only (and not of proper heavy usage, which you may want to happen at a stage anyway). To implement a fair-usage on this sort of API while preserving anonymous usage, you may need to implement a quota by IP. I'm not even sure that really efficient (and fair, for many people share the same public IP). Now for my usage, I've had already drafted an API of this kind when I discover your service. It is now working for my need. (But it is very rudimentary, naive and not optimized at all. It does not implement any usage control.) |
Yeah, the scenario is clear. Thanks for sharing!
That's fair! Though I have some of peace of mind: there's goaccess running to roughly estimate the
Right, I think we'll end up with some kind of tokens for the API access.
Nice one! |
@aslushnikov what is the status of this ticket? Would be great to have an ability to compile a package of documents, not just one. |
@yegor256 unfortunately no ETA for this |
@yegor256 if you'd like to try an API with multiple documents, you can look at Latex-On-HTTP There is an open alpha of the API you can use https://latex.ytotech.com. I use it myself as an alternative of latex-online when I need something more Rest API oriented than CLI-oriented (latex-online works really great for that!). Note the API may change and there may not be as much packages as you need. |
Hi again,
I have a use case that does not seem totally covered by the current API, but I'm pretty sure it could do it:
Basically this is #12 and #6.
Why not use
laton
?Well, this is fine to use on a terminal for compiling docs, but this is not so great when interfacing direcly in other programs. In this case, an HTTP interface is always better:
Ok, then, why not use the
tar
interface?Having our program that creates a
tar
for each compilation is not very convenient and makes the process heavy. Again this is well when done under the wood by thelaton
script while workin on the terminal.From an app that gather many files to be included (and manages itself to host them on public URLs), it is more straightforward to just construct the json payload describing these files and
POST
it to the service endpoint. For text files, we could even pass them directly in the payload.POST API
Actually I found the clsi-sharelatex API well done on this part.
Using a
POST
method with a json payload allow us to easily pass a list of files (would be a bit clumsy to do withGET
query string parameters) and may not be that hard to interpret server-side:POST /compile
It could then return a
taskId
as it does with anyGET
call.I think this is what the
/data
method do, but taking a tar instead of a json giving instructions on how to get the files.The main question is: do you intend the service to be mainly used by humans? Or are integration on other apps are also an use case you want to support?
The text was updated successfully, but these errors were encountered: