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

Create a simple API #18

Closed
driesvints opened this issue Mar 5, 2017 · 8 comments
Closed

Create a simple API #18

driesvints opened this issue Mar 5, 2017 · 8 comments

Comments

@driesvints
Copy link
Member

@RobinMalfait commented on Wed Sep 10 2014

That way we can create plugins for Sublime Text, Phpstorm, ... :)


@driesvints commented on Wed Sep 10 2014

Thanks for the suggestion :)

Also not a priority but feel free to offer some input on how you'd like to see the api implemented.

@driesvints driesvints changed the title [BIN]: Create a simple API for the bin Create a simple API for the bin Mar 5, 2017
@edcs
Copy link
Contributor

edcs commented Jun 20, 2017

Does it need any authentication? If not, a simple way of doing this would be to use post()
and check the Accept header in to see if it's set to JSON. If it is, a JSON response should be returned and if not the standard redirect would be used.

The rate limiting middleware should be implemented to prevent abuse to begin with, reCaptcha or similar could be a future addition if needed.

@RobinMalfait
Copy link

@edcs I think that reCaptcha would be hard if you write plugins for IDE's and editors. A simple JSON api where you post and receive a link would be perfect. If you really want to prevent the spam though, I don't mind registering an "application" to retrieve some tokens to use in the headers.

I made plugins for PhpStorm & Sublime & VSCode in the past, so I do want to help create plugins for those!

@driesvints
Copy link
Member Author

@edcs A simple POST & GET endpoint can be added to begin with. It should definitely be rate limited. It should always return JSON.

@RobinMalfait I'm not sure if we should start with whitelisting apps. Do you think that's necessary?

@RobinMalfait
Copy link

@driesvints whitelisting apps is not necessary. I was just thinking about preventing spam to use something like oauth. How would the rate limit work, do we need to register to get a token or do we need an /auth route first.

Or do we just use public POST & GET routes, and implement more security when needed?

@edcs
Copy link
Contributor

edcs commented Jun 24, 2017

@RobinMalfait: Rate limiting is already built into Laravel with the \Illuminate\Routing\Middleware\ThrottleRequests::class middleware. It's not the most sophisticated thing in the world, but I'd say this is more than adequate for a project like this. If there's an abuse issue, fix it when it arises 🙂

@RobinMalfait
Copy link

@edcs perfect! We use an older version of Laravel, so I don't know much about all the latest and greatest goodies. Good to know though!

@driesvints
Copy link
Member Author

@RobinMalfait yeah let's just go with the POST and GET route for now and see how it goes.

@driesvints driesvints changed the title Create a simple API for the bin Create a simple API Jun 30, 2017
@driesvints
Copy link
Member Author

I'm going to close this as I don't think this will ever land.

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

No branches or pull requests

3 participants