RestFS: Resources and Services are Filesystems, Too


Published on

WS-REST 2011.
Second International Workshop on RESTful Design.
Chairs: Cesare Pautasso, Erik Wilde, Rosa Alarcon.
Frameworks Session. Joseph Kaylor, Konstantin Laufer and George Thiruvathukal.

  • Be the first to comment

  • Be the first to like this

RestFS: Resources and Services are Filesystems, Too

  1. 1. RestFS: Resources andServices are Filesystems, Too Joe Kaylor, Konstantin Läufer, George K. Thiruvathukal
  2. 2. Presentation OutlineMotivationWeb service compositionLocal machine software compositionInter Process CommunicationBridging the Gap: RestFSThe Filesystem as a Connector LayerExamples and exploration
  3. 3. MotivationCurrently, web services can be accessed through HTTPclients and HTTP libraries over network socketsWhile some web services are accessible over filesysteminterfaces, there is no general support or uniform filesysteminterfaceRestFSs goal is to provide a general filesystem interface tomanage configuration, authentication, and interaction withRESTful web services
  4. 4. Service CompositionMashups / RemixesWS-BPEL - Web Services Business Process ExecutionLanguageCORBA - Common Object Request Broker Architecture
  5. 5. Local Software CompositionLibrariesShared filesPipesDomain SocketsShared memory pages / memory mapped files
  6. 6. Filesystems That Abstract a Web ServiceGmailFS - stores data in a GMail webmail accountFlickrFS - abstracts the Flickr photo service as a filesystem(available on Ubuntu)davfs2 - a WebDAV filesystem
  7. 7. Types of Web Service FilesystemsApplication Filesystems - filesystems that provideconvenient interfaces for programs to interact. A goodexample is FlickrFS presenting image filesObject or storage abstraction - Using a web service as astorage location for a filesystem. Two good examples areGMailFS and SSHFSConnector filesystems - Filesystems that abstract a methodof IPC or a network protocol. Two good examples are Plan9s netfs and RestFS
  8. 8. RestFSA connector filesystem that provides a filesystem abstractionfor RESTful web servicesRequests to and responses from web services are madethrough filesystem system callsConnections are initiated through manipulation ofconfiguration files in the filesystemOAuth authentication can be established by manipulatingauthentication files
  9. 9. RestFS - Configuration FilesConfiguration files specify the host, port, resource, andtriggering FS callTriggering FS call is the system call that triggers the webservice method <?xml version="1.0" encoding="UTF-8"?> <RestfulSetting> <FsMethod>utime</FsMethod> <WebMethod>GET</WebMethod> <FormName></FormName> <Resource>/1/users/show/joekaylor.json</Resource> <Host></Host> <Port>80</Port> <OAuthTokenPath>/auth/twitter</OAuthTokenPath> </RestfulSetting>
  10. 10. RestFS - Resource FilesPrograms can read and write to resource files in a normalwayWhen the triggering filesystem system call is issued on theresource file a HTTP method call will be issued.If the resource file contains data, it will be sent along withthe callThe response will be written back to the resource file
  11. 11. RestFS - Triggering Call Timeline
  12. 12. OAuth Authentication in RestFSA special /auth folder exists in every RestFS mount.When a user creates a folder in /auth, 4 files are created: config - contains Access Token, User Auth, and Request Token URLs status - contains the current progress or errors encountered during authentication. If a manual step is required (such as a CAPTCHA test), this file contains the URL to visit verifier - if a manual step is required, any PIN that needs to be associated with RestFS can be written to this file token - after successful authentication, this file contains the authentication tokenThe token file can then be referenced in configuration filesThe associated resource file will automatically work withOAuth
  13. 13. RestFS - Authentication Process
  14. 14. OAuth Files (config)<?xml version="1.0" encoding="UTF-8"?><OAuthConfigFile> <Key>asdf3244dsf</Key> <AccessTokenURL></AccessTokenURL> <UserAuthURL></UserAuthURL> <RequestTokenURL></RequestTokenURL> <Secret>147sdfkek</Secret></OAuthConfigFile>
  15. 15. OAuth Files (token)<OAuthTokenFile> <AccessToken>2534534asdf2348</AccessToken> <RequestToken>aql2343</RequestToken> <TokenSecret>adfjdsl24522</TokenSecret></OAuthTokenFile>
  16. 16. Software Composition with RestFSWith RestFS, it is possible to compose remote web serviceswith local softwareThis software can then be recomposed into new RESTfulweb services or other local software compositionsCan allow many computers to participate in local softwarecompositions of a RESTful service by mounting a RestFSvolume as a network filesystem over Samba or NFS
  17. 17. Software Composition with RestFS
  18. 18. DemonstrationsGoogle SearchYahoo! Place FinderTwitter