<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h2&gt;The origins&lt;/h2&gt;
&lt;p&gt;Please read the &lt;a href=&quot;http://www.opensourcery.co.za/2008/10/07/authentication-tokens-what-are-they-all-about/&quot;&gt;Authentication Tokens, what are they all about?&lt;/a&gt; blog post for another take on the topic when it was first introduced to PowerDNS on Rails.&lt;/p&gt;
&lt;h2&gt;Redux&lt;/h2&gt;
&lt;p&gt;PowerDNS on Rails has the aim to become a single interface for all aspects of managing &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; infrastructure powered by PowerDNS.This means providing access to domain owners, if required, and API&amp;#8217;s for easily integrating with your &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; network.&lt;/p&gt;
&lt;p&gt;Leveraging the growing PowerDNS on Rails &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; can really help you as developer forget about the low-level nastiness of &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; and use a (soon to be) beautiful &lt;span class=&quot;caps&quot;&gt;REST&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;. This works for a lot of cases, until you want to start exposing the management of the domains to people registered in &lt;i&gt;your&lt;/i&gt; system, without giving them users in PowerDNS on Rails.&lt;/p&gt;
&lt;p&gt;Authentication tokens allows you to overcome this issue by requesting PowerDNS on Rails to generate a token with very granular permissions for &lt;i&gt;a specific domain&lt;/i&gt; with an expiry time as well. So tokens don&amp;#8217;t last for ever either, preventing people from distributing tokens around.&lt;/p&gt;
&lt;h2&gt;Token Policies (and defaults)&lt;/h2&gt;
&lt;p&gt;Tokens contain a series of policies inside them, which are used to control the access level a token has. These policies can exists on &lt;i&gt;domain level&lt;/i&gt; or &lt;i&gt;RR level&lt;/i&gt;. The token has the following policy attributes:&lt;/p&gt;
&lt;table&gt;
	&lt;tr&gt;
		&lt;th&gt;Attribute&lt;/th&gt;
		&lt;th&gt;Possible Values&lt;/th&gt;
		&lt;th&gt;Usage&lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;policy&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;deny&lt;/strong&gt;, allow&lt;/td&gt;
		&lt;td&gt;Is the &lt;i&gt;last&lt;/i&gt; checked attribute when deciding whether a token is allowed to perform an action&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;new&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;false&lt;/strong&gt;, true&lt;/td&gt;
		&lt;td&gt;Is the token allowed to add new records&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;remove&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;false&lt;/strong&gt;,true&lt;/td&gt;
		&lt;td&gt;Is the token allowed to remove records&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;allowed&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;empty&lt;/strong&gt;, [ [], [] ]&lt;/td&gt;
		&lt;td&gt;An array of arrays used to indicate which records (by name &lt;i&gt;and&lt;/i&gt; type) can be changed&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;protected&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;empty&lt;/strong&gt;, [ [], [] ]&lt;/td&gt;
		&lt;td&gt;An array of arrays used to indicate which records (by name &lt;i&gt;and&lt;/i&gt; type) must be protected at all cost&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;protected_types&lt;/td&gt;
		&lt;td&gt;&lt;strong&gt;empty&lt;/strong&gt;, []&lt;/td&gt;
		&lt;td&gt;An array of record types (A,MX) which can&amp;#8217;t be changed, no matter what name they have&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&lt;em&gt;The above list exposes the internal workings of the authentication tokens, we recommend using the &lt;span class=&quot;caps&quot;&gt;REST&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; for generating these tokens.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Example Tokens&lt;/h2&gt;
&lt;p&gt;&lt;i&gt;Coming soon&lt;/i&gt;&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-26T20:26:04-08:00</created-at>
  <id type="integer">139518</id>
  <permalink>authentication-tokens-overview</permalink>
  <repository-id type="integer">37131</repository-id>
  <title>Authentication Tokens (Overview)</title>
  <updated-at type="datetime">2009-02-18T03:29:49-08:00</updated-at>
  <user-id type="integer">8756</user-id>
</wiki>
