| TOC |
|
By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 16, 2008.
Copyright © The IETF Trust (2008).
The purpose of RESTTA is to help make consistent APIs for representational state transfer (REST) protocols where the REST requests are made through URIs that are in varying formats. This is done first by agreeing on a common set of named resources and named inputs. Applications then provide RESTTA documents that other independent applications can use to translate a named resource into a full URI that can be used to retrieve the resource.
1.
Introduction
1.1.
Requirements Language
2.
Terminology
3.
Full Example
4.
RESTTA files
5.
RESTTA delegation
6.
Elements
6.1.
restta Element
6.2.
appClass Element sub-element of restta Element
6.3.
resource Element sub-element of appClass Element
6.4.
uriPattern Element sub-element of resource Element
6.5.
input Element sub-element of resource Element
6.6.
patternItem Element sub-element of input Element
6.7.
defaultVal Element sub-element of input Element
6.8.
queryKey Element sub-element of input Element
7.
No IANA Considerations
8.
Security Considerations
9.
References
9.1.
Normative References
9.2.
Informative References
§
Author's Address
§
Intellectual Property and Copyright Statements
| TOC |
REST (Fielding, R., “Representational State Transfer (REST),” 2000.) [REST] based services are popular because they utilize the existing HTTP architecture inherent to the Internet. This architecture is well understood and REST provides a flexible method to make resource request through HTTP that output in a standard format, such as XML.
The APIs for retrieving resources are usually tied directly to the application layer. However, distributing such APIs among many different applications presents a challenge. Different application technologies can have limitations to the way URIs can be constructed.
RESTAA is a specified way to format an XML (Bray, T., Paoli, P., Sperberg-McQueen, C., and E. Maler, “Extensible Markup Language (XML) 1.0 (Second Edition),” Ocober 2000.) [XML] document in such a way that it would allow applications to map named resources to URIs in a simple and flexible manner.
| TOC |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [RFC2119].
| TOC |
RESTTA revolves around the following ideas
| Term | Desc |
|---|---|
| Application | An application is server-side logic designed to provide some kind of REST functionality. |
| Application Class | An application class is a classification that encapsulates specifically defined resources, as well as the necessary inputs needed to format URIs that will produce the resources. |
| Resource | A resource in context of REST is defined loosely as something that can be retrieved via a URI. It is the intended conceptual target of a hypertext reference. |
| Table 1: Terms |
| TOC |
The following is a sample RESTTA XML document:
<?xml version='1.0'?> <restta version="0.1"> <appClass name="sample" detail="http://www.app.com/sample"> <resource name="user_profile"> <input type="uriPattern" name="user_name"> <patternItem>user_name</patternItem> <defaultVal>anonymous<defaultVal> </input> <input type="uriPattern" name="domain_name"> <patternItem>domain</patternItem> <defaultVal>sitename.com<defaultVal> </input> <input type="get/post" name="profile_format"> <queryKey>format</queryKey> <defaultVal>XML</defaultVal> </input> <uriPattern> http://[domain]/index.php/[user_name]. </uriPattern> </resource> <resource name="rss_feed"> <uriPattern>/path/to/rss/feed.xml.</uriPattern> </resource> </appClass> </restta>
The example XML markup describes an application class "sample" with two resources. The first resource is named "user_profile", and its URI is defined as a pattern. The first resource can take three inputs, two of which must be present in the URI pattern. The other input can either be formatted in a GET query string or as a POST query, as described in [RFC3986] (Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.). Given the inputs as well as the URI pattern, an application can easily form a final URI to retrieve the resource.
The second resource is defined simply by the URI pattern. In this case it lacks a host name and must be interpreted as a path reletive to the RESTTA file.
| TOC |
The RESTTA XML file must have the filename "restta.xml" and it must be located inside the root of a provided URI. For example, given "http://domain.com", the RESTTA file would be found in "http://domain.com/restta.xml".
| TOC |
RESTTA application classes may be delegated to other sources by utilizing the RESTTA application class.
The following is a sample RESTTA delegation:
<?xml version='1.0'?> <restta version="0.1"> <appClass name="restta" detail="http://peopletab.com/draft-szewczyk-restta-01.html"> <resource name="restta_delegate"> <input name="app_class" type="uriPattern" > <patternItem>app_class</patternItem> <defaultVal>all<defaultVal> </input> <uriPattern> /[app_class]/restta.xml </uriPattern> <resource> </appClass> </restta>
| TOC |
This section outlines all the elements, or tags, as well as each element's respective properties. Some tags and properties are required, some are not. As a matter of convention, tags should be in camel case, and property values should avoid reserved characters, as well as characters that would be percent encoded as described in [RFC3986] (Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.).
| TOC |
The restta tag is the base restta tag used to encapsulate the application class elements. It is required.
| Property | Required | Detail |
|---|---|---|
| version | true | The version property defines the version of the RESTTA specification that the document adheres to. The version this document describes is "0.1". |
| Table 2: restta Element Properties |
| TOC |
The appClass tag is used to encapsulate defined resources. For each application class there must be a corresponding appClass tag with a unique name and detail-URI combination.
| Property | Required | Detail |
|---|---|---|
| name | true | The name property designates the namespace of the application class. Ideally, each application class should be unique. |
| type | true | The detail property designates a URI that provides a detailed specification for the resources. This includes the formatting guidelines for the resources, the naming of the resources, and details about recommended or required inputs. |
| Table 3: appClass Element Properties |
| TOC |
The resource tag is used to encapsulate a defined URI pattern as well as the optional inputs that will be used to form the final resource URI.
| Property | Required | Detail |
|---|---|---|
| name | true | The name property designates the name of the resource. The name must correspond to a defined name in the application class detail specification. |
| Table 4: resource Element Properties |
| TOC |
The uriPattern tag surrounds a string pattern that corresponds to either and absolute URI or a relative URI. If relative, the final URI will formulated as one relative to the RESTTA document. Also, "named inputs" may be part of the uriPattern value. Named inputs are formatted to be easily parsed and replaced by actual input values, and are in the format "[input_name]", where bracket a bracket characters opens and closes the name. Named inputs must match either a "name" property value of a sibling input element, or of a patternItem override element located as a child of a sibling input element.
The tag has no defined properties.
| TOC |
The input tag is used to to define the input that will go into forming the final resource URI for a named resource. This tag is optional, only to be used when there are variable inputs needed to define the final URI.
| Property | Required | Detail |
|---|---|---|
| name | true | The name property designates the name of the input. The name must correspond to a defined input in the application class detail specification. If the input element has the type property set to "post", "get", or "post/get", then the name value should be used as the key in the query request (unless there is a "queryKey" sub-element present as an override). |
| type | true | The type property defines how the input should be treated. Should it be treated as a GET and/or POST key? Or is it part of the URI pattern? Valid values for this property must be: "post", "get", "post/get", or "uriPattern". The "post/get" value implies that the input could be either a POST value to a GET value in the URI arguments. |
| Table 5: input Element Properties |
| TOC |
The patternItem tag specifies which named part of the uriPattern the input should be placed into. It is not a required element, its use depends on whether a named part exists in the uriPattern. It must only be used inside an input element that is of the type "uriPattern". If this element is missing, the named part is implied to be the name property value of the input element.
The tag has no defined properties.
| TOC |
The defaultVal tag specifies a default value to go into the final URI request if the application interpreting the document lacks an input value.
The tag has no defined properties.
| TOC |
The queryKey tag specifies a key when the parent input is of type "post", "get", or "post/get". This tag is optional. If this element is missing, the query key value is implied to be the name property value of the input element.
The tag has no defined properties.
| TOC |
| TOC |
Because the retrieval of the RESTTA file relies on DNS (Mockapetris, P., “Domain names - implementation and specification,” November 1987.) [RFC1035], it may be susceptible to poisoning attacks. It is recommended to disregard all final URIs generated from a RESTTA document that point to a different domain if security is of vital concern.
| TOC |
| TOC |
| [RFC2119] | Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997 (TXT, HTML, XML). |
| [RFC3986] | Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” STD 66, RFC 3986, January 2005 (TXT, HTML, XML). |
| [XML] | Bray, T., Paoli, P., Sperberg-McQueen, C., and E. Maler, “Extensible Markup Language (XML) 1.0 (Second Edition),” Ocober 2000. |
| TOC |
| [REST] | Fielding, R., “Representational State Transfer (REST),” 2000. |
| [RFC1035] | Mockapetris, P., “Domain names - implementation and specification,” STD 13, RFC 1035, November 1987. |
| [RFC2616] | Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1,” RFC 2616, June 1999 (TXT, PS, PDF, HTML, XML). |
| TOC |
| Ian Szewczyk (editor) | |
| USA | |
| Email: | roamzero@gmail.com |
| TOC |
Copyright © The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an “AS IS” basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA).