论文标题
SaferestScript:静态检查REST API消费者
SafeRESTScript: Statically Checking REST API Consumers
论文作者
论文摘要
REST服务的消费已成为调用第三方提供的代码的一种流行手段,尤其是在Web应用程序中。如今,Web应用程序的程序员可以通过JavaScript选择Typescript,从而从静态检查中受益,该检查可以验证对本地功能或库提供的函数的验证调用。但是,需要在运行时发现休息服务的呼叫错误。在本文中,我们介绍了SaferestScript(简称SRS)一种语言,将静态分析的支持扩展到需要静止服务的呼叫,并能够静态地查找常见错误,例如在REST呼叫中丢失或无效的数据以及滥用此类呼叫的结果。 SaferestScript具有类似于JavaScript的语法,并配备了(i)丰富的类型集合(包括对象,数组和细化类型),以及(ii)原始支持的原始支持的REST呼叫,这些呼叫对相应API的规格进行了静态验证。规格是用头枕编写的,该语言还具有改进类型并支持REST API的语义方面的描述,以一种让人联想到Hoare Triples的样式。我们根据通用验证工具(Boogie)提出SaferestScript及其验证系统。还讨论了以eclipse插件的形式获得其验证器的SaferestScript和原型实现的评估。
Consumption of REST services has become a popular means of invoking code provided by third parties, particularly in web applications. Nowadays programmers of web applications can choose TypeScript over JavaScript to benefit from static type checking that enables validating calls to local functions or to those provided by libraries. Errors in calls to REST services, however, can only be found at run-time. In this paper, we present SafeRESTScript (SRS, for short) a language that extends the support of static analysis to calls to REST services, with the ability to statically find common errors such as missing or invalid data in REST calls and misuse of the results from such calls. SafeRESTScript features a syntax similar to JavaScript and is equipped with (i) a rich collection of types (including objects, arrays and refinement types)and (ii) primitives to natively support REST calls that are statically validated against specifications of the corresponding APIs. Specifications are written in HeadREST, a language that also features refinement types and supports the description of semantic aspects of REST APIs in a style reminiscent of Hoare triples. We present SafeRESTScript and its validation system, based on a general-purpose verification tool (Boogie). The evaluation of SafeRESTScript and of the prototype implementations for its validator, available in the form of an Eclipse plugin, is also discussed.