Skip to Content
Creating Solid APIs with Lua
book

Creating Solid APIs with Lua

by Tyler Neylon
February 2017
Intermediate to advanced
133 pages
2h 43m
English
O'Reilly Media, Inc.
Content preview from Creating Solid APIs with Lua

Chapter 6. Sandboxing User Scripts

Until now, every morsel of wholesome API-making knowledge in this book has been aimed at the case of altruistic coders. I’ve assumed that the various programmer roles were all fundamentally benevolent or mostly harmless. I’ve told you how to write interfaces without regard to the integrity of your system in the face of colossal ignorance or the whims of rapscallious ne’er-do-wells.

All of that is about to change.

What if I were to tell you that there is a language that can easily run scripts written by anyone, on any server, and do so with a surprising balance of utility and constraint? That this language includes the ability to limit its virtual machine’s memory use, down to the very byte; and to limit its instruction count down to the individual bytecode operation? What if I were to tell you that this language is Lua itself?

This final, spine-tingling chapter opens by describing how users can put the icing on EatyGuy’s cake by writing their own custom behaviors for baddies. We then move on to examine the many forms of abuse that can occur when you give power to strangers. Finally, we’ll examine sandboxing techniques that limit availability to Lua’s libraries, to system memory, and to system processor time.

EatyGuy Version 10: The Baddy Construction Kit

The ultimate version of EatyGuy—version 10—will act as an example of a minimalistic scripting interface exposed to users who can control baddy behavior. Although EatyGuy itself won’t provide ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Create a Vim Plugin

Create a Vim Plugin

Alfredo Deza, Noah Gift
Hands-On Enterprise Java Microservices with Eclipse MicroProfile

Hands-On Enterprise Java Microservices with Eclipse MicroProfile

Cesar Saavedra, Heiko W. Rupp, Jeff Mesnil, Pavol Loffay, Antoine Sabot-Durand, Scott Stark

Publisher Resources

ISBN: 9781491986301