[#65] generate documentation

This commit is contained in:
Felipe Ripoll 2018-09-04 06:16:00 -06:00
parent 7f99b3173e
commit e9eb5bf315
25 changed files with 161 additions and 34 deletions

View File

@ -4,7 +4,7 @@ fonts/icomoon.eot
fonts/icomoon.svg
fonts/icomoon.ttf
fonts/icomoon.woff
dist/sidebar_items-3d14d8fe9b.js
dist/sidebar_items-b6949c5547.js
api-reference.html
initial_architecture.html
search.html

View File

@ -8,7 +8,7 @@
<title>404 poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Auth.Guardian.Plug poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Auth.Models.Token poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Auth.Models.User poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>
@ -120,6 +120,12 @@
<a href="#changeset/2">changeset(user, params \\ %{})</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#to_map/1">to_map(user)</a>
</div>
</div>
</div>
@ -202,6 +208,28 @@
</a>
<span class="signature">changeset(user, params \\ %{})</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth/models/user.ex#L33" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="to_map/1">
<div class="detail-header">
<a href="#to_map/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">to_map(user)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth/models/user.ex#L25" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>

View File

@ -8,7 +8,7 @@
<title>POABackend.Auth.REST poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>
@ -247,6 +247,67 @@ content-length: 53
cache-control: max-age=0, private, must-revalidate
{&quot;user-name&quot;:&quot;vhuevkMy&quot;,&quot;password&quot;:&quot;XkBCEJmuuEzPvy8&quot;}</code></pre>
<h2 id="module-list-user-endpoint" class="section-heading">
<a href="#module-list-user-endpoint" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
List User Endpoint
</h2>
<p>This Endpoint is needed in order to list the users in the system. Only Admin people can do that.</p>
<p><code class="inline">GET /user</code></p>
<table>
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th style="text-align: left">HTTP header</th><th style="text-align: left">Values</th>
</tr>
</thead>
<tr>
<td style="text-align: left">content-type</td><td style="text-align: left">application/json or application/msgpack</td>
</tr>
<tr>
<td style="text-align: left">authorization</td><td style="text-align: left">Basic encodeBase64(adminname + “:” + password)</td>
</tr>
</table>
<p>Response</p>
<table>
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th style="text-align: left">CODE</th><th style="text-align: left">Description</th>
</tr>
</thead>
<tr>
<td style="text-align: left">200</td><td style="text-align: left">Success: A list of users</td>
</tr>
<tr>
<td style="text-align: left">401</td><td style="text-align: left">Authentication failed</td>
</tr>
<tr>
<td style="text-align: left">415</td><td style="text-align: left">Unsupported Media Type (only application/json and application/msgpack allowed)</td>
</tr>
</table>
<p>Example:</p>
<pre><code class="elixir">curl -i -X GET -H &quot;Authorization: Basic YWRtaW4xOnBhc3N3b3JkMTIzNDU2Nzg=&quot; -H &quot;Content-Type: application/json&quot; https://localhost:4003/user --insecure
HTTP/1.1 200 OK
server: Cowboy
date: Mon, 03 Sep 2018 16:02:29 GMT
content-length: 153
cache-control: max-age=0, private, must-revalidate
[{&quot;user&quot;:&quot;HeeV-EmU&quot;,&quot;created_at&quot;:&quot;2018-09-03T16:02:25.210308&quot;,&quot;active&quot;:true},{&quot;user&quot;:&quot;W75AcY8Z&quot;,&quot;created_at&quot;:&quot;2018-09-03T16:02:13.763003&quot;,&quot;active&quot;:true}]</code></pre>
<p>The JSON format for a user is:</p>
<pre><code class="elixir">{
&quot;user&quot;:&quot;Username&quot;,
&quot;active&quot;:true, # active means it is not banned
&quot;created_at&quot;:&quot;2018-09-03T16:02:25.210308&quot;
}</code></pre>
<h2 id="module-blacklist-token-endpoint" class="section-heading">
<a href="#module-blacklist-token-endpoint" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Blacklist Token Endpoint

View File

@ -8,7 +8,7 @@
<title>POABackend.Auth poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>
@ -202,6 +202,15 @@ expiration time as Integer</p>
<div class="summary-synopsis"><p>Get a user from the database based in the user name</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#list_users/0">list_users()</a>
</div>
<div class="summary-synopsis"><p>This function returns all the users stored in the database</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
@ -318,7 +327,7 @@ with that name in the database already</p>
</a>
<span class="signature">authenticate_admin(admin_name, password)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L98" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L106" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -378,7 +387,7 @@ with that name in the database already</p>
</a>
<span class="signature">create_banned_token(jwt_token)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L158" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L166" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -409,7 +418,7 @@ This function will extract the expiration time from the claims and store them in
</a>
<span class="signature">create_banned_token(token, expires)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L172" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L180" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -504,7 +513,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">generate_password()</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L133" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L141" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -533,7 +542,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">generate_user_name()</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L112" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L120" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -562,7 +571,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">generate_user_name(user_name)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L122" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L130" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -610,6 +619,35 @@ expiration time as Integer.</p>
</section>
</div>
<div class="detail" id="list_users/0">
<div class="detail-header">
<a href="#list_users/0" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">list_users()</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L98" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>list_users() :: [<a href="POABackend.Auth.Models.User.html#t:t/0">POABackend.Auth.Models.User.t</a>()]</pre>
</div>
</div>
<section class="docstring">
<p>This function returns all the users stored in the database</p>
</section>
</div>
<div class="detail" id="purge_banned_tokens/0">
@ -620,7 +658,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">purge_banned_tokens()</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L204" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L212" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -678,7 +716,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">token_banned?(token)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L221" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L229" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -736,7 +774,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">valid_token?(jwt_token)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L186" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L194" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -765,7 +803,7 @@ expiration time as Integer.</p>
</a>
<span class="signature">valid_user_name?(user_name)</span>
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L142" class="view-source" rel="help" title="View Source">
<a href="https://github.com/poanetwork/poa-netstats-wharehouse/blob/v0.1.0/lib/poa_backend/auth.ex#L150" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>

View File

@ -8,7 +8,7 @@
<title>POABackend.CustomHandler.REST poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.CustomHandler poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Protocol.DataType poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Protocol.Message poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Protocol.MessageType poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Protocol poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receiver poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receivers.Dashboard poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receivers.DynamoDB poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receivers.Eth.Stats poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receivers.Repo poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend.Receivers.System.Stats poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>POABackend poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>API Reference poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

File diff suppressed because one or more lines are too long

1
doc/dist/sidebar_items-b6949c5547.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<title>Initial Architecture poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>

View File

@ -8,7 +8,7 @@
<title>Search poa_backend v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<script src="dist/sidebar_items-3d14d8fe9b.js"></script>
<script src="dist/sidebar_items-b6949c5547.js"></script>