<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #2330: Make api read-actions GETable</title>
    <link>http://localhost/ticket/2330</link>
    <description>&lt;p&gt;
Whitelist any GETable api actions, and optionally construct the query from url params rather than body.
&lt;/p&gt;
</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/2330</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Tue, 01 May 2012 14:04:41 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/2330#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/2330#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-sprint-2012-04-30&lt;/em&gt; to &lt;em&gt;current-ckan-sprint-2012-05-15&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Tue, 01 May 2012 14:07:58 GMT</pubDate>
      <title>priority changed</title>
      <link>http://localhost/ticket/2330#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/2330#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;priority&lt;/strong&gt;
                changed from &lt;em&gt;awaiting triage&lt;/em&gt; to &lt;em&gt;major&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Fri, 04 May 2012 16:39:31 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/2330#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/2330#comment:3</guid>
      <description>
        &lt;p&gt;
Implemented, providing two methods of passing an action's parameters.  Either, each parameter is specified as a url parameter, eg
&lt;/p&gt;
&lt;pre class="wiki"&gt;curl http://127.0.0.1:5000/api/3/action/package_search?q=police
&lt;/pre&gt;&lt;p&gt;
or, for cases where a more complex data_dict is required, the data_dict can be parsed as a json-encoded dict in a single url-parameter called &lt;tt&gt;&lt;/tt&gt;data_dict&lt;tt&gt;&lt;/tt&gt;, ie:
&lt;/p&gt;
&lt;pre class="wiki"&gt;curl http://127.0.0.1:5000/api/3/action/package_search?data_dict={'q':'police'}
&lt;/pre&gt;&lt;p&gt;
As part of this ticket:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;I noticed that all module-public members of the action modules were being loaded as actions (including functions imported from other modules).  So I've cleared up the  action modules to prevent this.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;I've cleaned up the action modules to use &lt;tt&gt;&lt;/tt&gt;get_or_bust()&lt;tt&gt;&lt;/tt&gt; when accessing a passed in data_dict outside before it's been validated by a schema.  This provides better error messages for clients.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;provided a decorator, &lt;tt&gt;&lt;/tt&gt;@side_effect_free&lt;tt&gt;&lt;/tt&gt;, for users implementing their own actions through the IActions interface to be able to expose their custom/overridden actions as a GET request through the action API.
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Mon, 07 May 2012 10:42:08 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/2330#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/2330#comment:4</guid>
      <description>
        &lt;p&gt;
Replying to &lt;a href="http://localhost/ticket/2330#comment:3" title="Comment 3 for Ticket #2330"&gt;icmurray&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
or, for cases where a more complex data_dict is required, the data_dict can be parsed as a json-encoded dict in a single url-parameter called &lt;tt&gt;&lt;/tt&gt;data_dict&lt;tt&gt;&lt;/tt&gt;, ie:
&lt;/p&gt;
&lt;pre class="wiki"&gt;curl http://127.0.0.1:5000/api/3/action/package_search?data_dict={'q':'police'}
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;
Another option is to have the data_dict json-encoded in the GET request's body.  This is possible, but
&lt;/p&gt;
&lt;p&gt;
1) Although permissable, it's not, as I understand it, conventional to have a GET request's body form the options of the request.
&lt;/p&gt;
&lt;p&gt;
2) Caching proxies won't inspect the body of the request, only the URL.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Tue, 15 May 2012 09:15:14 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/2330#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/2330#comment:5</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;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>