Making Ready for production
veritech opened this issue · 12 comments
I had just started working on a cake 1.3 REST api of my own, when i saw this. You note that it's not ready for production use.
What are the key things it needs?
I've forked the project already, and i'm happy to push some commits if you could identify the areas of focus.
Thanks
Cool, let's work together. These areas could use some help still:
- XML (now only JSON is supported)
- Tests
- Documentation
- The RestLog model that tracks usage should focus more on IP for rate-limiting than account info. This is mostly to defend against denial of server & brute force attempts
- Cake 1.3 support
- Maybe some Refactoring
But that being said, I already use it in my environment in conjunction with our API:
http://github.com/true/true-api/
that works like this:
$servers = $this->TrueApi->Servers->index();
$this->TrueApi->Servers->edit(2862, array('model' => 'Dell 2950'));
I've got basic XML support working, and i'll need to write some tests, and then push my fork
How cool is that! I'm looking forward to check it out!
I've updated my fork
http://github.com/veritech/cakephp-rest-plugin.
Some of the behaviour of the component confused me a little, so most of my "improvements" are more like hacks. However the major thing i did was to replace your approach of XML/JSON generation and using View Classes instead, much cleaner and more extensible, (Check out the views folder)
Very good. I like your approach with the View Class.
I think I'm keeping the die & headers though. For me it's crucial that the process dies immediately when abort is called as this is also used by authentication. I haven't found a better (failsafe) way yet.
Send me a pull request if you want, then I'll pull in your changes and take it from there
I removed the die in my attempt to find a better way to route the error information through the view classes. As you can see i never did. :(
I now make the encode() functions available to the component as a compromise. Made some other changes as well, hope you like them
Looking very nice, i could see from the commit msg you were quite proud of yourself! Huge thanks for mention also.
well sometimes you've got to be. otherwise what's the fun : )
and oh, I also updated my client so it can decode the xml we now talk. may be of interest to you: http://github.com/true/true-api/blob/master/Xml.php
btw are you on twitter as well?
right.. :)