<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #27: Register/Update a package via a web-api</title>
    <link>http://localhost/ticket/27</link>
    <description></description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/27</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Tue, 08 Jan 2008 10:32:01 GMT</pubDate>
      <title>description changed; milestone set</title>
      <link>http://localhost/ticket/27#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/27?action=diff&amp;amp;version=1"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                set to &lt;em&gt;v0.6&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
In many ways everything that is needed is already in place in that the package update and create controller just require raw posts to do their work. However should implement some kind of authentication/authorization to prevent automated spamming.
&lt;/p&gt;
&lt;p&gt;
This would also require some way of distinguishing posts from our own WUI and those coming from outside (at present no checking is performed and the 'post' to these controllers is freely allowed by anyone out there!
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Thu, 07 Feb 2008 16:00:48 GMT</pubDate>
      <title>owner changed</title>
      <link>http://localhost/ticket/27#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;somebody&lt;/em&gt; to &lt;em&gt;johnbywater&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Methods potentially in need of access control at present (on controllers/package.py)
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;update (_update)
&lt;/li&gt;&lt;li&gt;create
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Frankly, for time being we can probably leave these unsecured but with monitoring. Should they be abused we can add access control fairly easily. So decision: no work on access control/auth for time being here.
&lt;/p&gt;
&lt;p&gt;
Focus instead should be on:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;documentation of post parameters (rgrp)
&lt;/li&gt;&lt;li&gt;returning restful status values (201 Created, 204 Updated, etc)
&lt;/li&gt;&lt;li&gt;returning machine readable output from read and list (json)
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnbywater</dc:creator>

      <pubDate>Thu, 14 Feb 2008 13:40:41 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/27#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:3</guid>
      <description>
        &lt;p&gt;
So, after reading all about REST interfaces, I've written a functional requirement for a RESTfull interface to a web application domain model:
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="http://desire.appropriatesoftware.net/requirements/60/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://desire.appropriatesoftware.net/requirements/60/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Basically, the 'fit criteria' require answers to these questions:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;What are the URIs?
&lt;/li&gt;&lt;li&gt;What's the format?
&lt;/li&gt;&lt;li&gt;What methods are supported at each URI?
&lt;/li&gt;&lt;li&gt;What status codes could be returned?
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I think we can hope to make a clean rest interface at (something like) ckan.net/api/rest. Having such a distinct location is fairly common (cf. flickr.com) and prevents any clutering the web browser client interface with aspects of machine client support.
&lt;/p&gt;
&lt;p&gt;
To make this point clearer, as RESTfullness claims to describe the web as it is, then the existing web browser interface must already be RESTfull. Hence, the main distinction with CKAN development is between CKAN's RESTfull machine interface and CKAN's RESTfull web browser client interface.
&lt;/p&gt;
&lt;p&gt;
Hence, if a CKAN machine client will follow the client-server interaction of a CKAN web browser client, the main requirement is to make sure the format of the responses is client-appropriate. Whilst machine clients can make POST and GET requests in the same way as a web browsers, clearly machine clients don't need lots of decorative HTML when accessing domain objects.
&lt;/p&gt;
&lt;p&gt;
Therefore, CKAN needs first to make user of a data format for rendering domain objects, and it needs to detect when it is required to return data in this format.
&lt;/p&gt;
&lt;p&gt;
Options for data format are bascially XML or JSON. It looks like JSON is preferable.
&lt;/p&gt;
&lt;p&gt;
Options for detecting client type are to prefix normal resource path with /api/rest/ or for the machine clients to pass a format=json parameter with each request.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnbywater</dc:creator>

      <pubDate>Thu, 14 Feb 2008 14:03:01 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/27#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:4</guid>
      <description>
        &lt;p&gt;
So for this ticket, a REST interface for packages would involve:
&lt;/p&gt;
&lt;p&gt;
See &lt;a class="wiki" href="http://localhost/wiki/RestfulAPI"&gt;this wiki page&lt;/a&gt; for more information.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Tue, 08 Apr 2008 19:44:23 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/27#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:5</guid>
      <description>
        &lt;p&gt;
The remaining issue is authentication. Initially was hopeful that we could use openid (perhaps with oauth) but this does not seem possible (despite much talk of openid and oauth being complementary) ... Thus we shall adopt this old-fashioned approach.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;A user who wishes to use the web api must obtain a web api key. They do this by:
&lt;ul&gt;&lt;li&gt;Going to ckan.net and signing in using their open id.
&lt;/li&gt;&lt;li&gt;Visit /account/apikey/: this should generate them a unique uuid key (or show their existing key if they already have one). This key should then be stored in the db along with their openid.
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Once a user has an api key they must include in the request when making changes. This may necessitate an update to the restful api to start having a more generic message format (this also makes it more extensible for the future):
&lt;ul&gt;&lt;li&gt;auth: auth key
&lt;/li&gt;&lt;li&gt;data: data body (what we currently send)
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Tue, 08 Jul 2008 19:05:33 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/27#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/27#comment:6</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Massive ticket now thoroughly addressed (early start in &lt;a class="missing changeset" title="No default repository defined"&gt;r242&lt;/a&gt; and ff. then later in &lt;a class="missing changeset" title="No default repository defined"&gt;r275&lt;/a&gt;, &lt;a class="missing changeset" title="No default repository defined"&gt;r276&lt;/a&gt; etc). Also now have start of demo ckan REST client at &lt;a class="source" href="http://localhost/browser/ckanclient"&gt;browser:ckanclient&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>