Add listing clients

Rename route to be more consistive (ie: prefixed with developer_)
This commit is contained in:
Jeremy Benoist
2016-03-05 21:44:39 +01:00
parent 2c2308b783
commit 9bf15f0269
8 changed files with 162 additions and 16 deletions

View File

@ -8,14 +8,13 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}Here are your client parameters.{% endtrans %}</p>
<p><strong>{% trans %}Make sure to copy these parameters now. You wont be able to see them again!{% endtrans %}</strong></p>
<ul>
<li>{% trans %}Client ID:{% endtrans %} <strong><pre>{{ client_id }}</pre></strong></li>
<li>{% trans %}Client secret:{% endtrans %} <strong><pre>{{ client_secret }}</pre></strong></li>
</ul>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
</div>
</div>
</div>

View File

@ -15,7 +15,7 @@
<div class="row">
<p>The following commands make use of the <a href="https://github.com/jkbrzt/httpie">HTTPie library</a>. Make sure it is installed on your system before using it.</p>
<p>You need a token to communicate between your 3rd application and wallabag API.</p>
<p>To create this token, you need <a href="{{ path('create_client') }}">to create a new client</a>.</p>
<p>To create this token, you need <a href="{{ path('developer_create_client') }}">to create a new client</a>.</p>
<p>Now, create your token (replace client_id, client_secret, username and password with the good values):</p>
<p>
<pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \

View File

@ -13,15 +13,52 @@
<h4>{% trans %}Documentation{% endtrans %}</h4>
<ul>
<li><a href="{{ path('howto-firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li>
</ul>
<h4>{% trans %}Clients{% endtrans %}</h4>
<ul>
<li><a href="{{ path('create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
<li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
</ul>
<h4>{% trans %}Existing clients{% endtrans %}</h4>
{% if clients %}
<ul class="collapsible" data-collapsible="expandable">
{% for client in clients %}
<li>
<div class="collapsible-header">#{{ client.id }}</div>
<div class="collapsible-body">
<table class="striped">
<tr>
<td>{% trans %}Client ID:{% endtrans %}</td>
<td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Client secret:{% endtrans %}</td>
<td><strong><code>{{ client.secret }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Redirect URIs:{% endtrans %}</td>
<td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Grant type allowed:{% endtrans %}</td>
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
</tr>
</table>
<p>
{% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/>
{% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a>
</p>
</div>
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}No client yet.{% endtrans %}
{% endif %}
</div>
</div>

View File

@ -8,14 +8,13 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}Here are your client parameters.{% endtrans %}</p>
<p><strong>{% trans %}Make sure to copy these parameters now. You wont be able to see them again!{% endtrans %}</strong></p>
<ul>
<li>{% trans %}Client ID:{% endtrans %} <strong><pre>{{ client_id }}</pre></strong></li>
<li>{% trans %}Client secret:{% endtrans %} <strong><pre>{{ client_secret }}</pre></strong></li>
</ul>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
</div>
</div>
</div>

View File

@ -15,7 +15,7 @@
<div class="row">
<p>The following commands make use of the <a href="https://github.com/jkbrzt/httpie">HTTPie library</a>. Make sure it is installed on your system before using it.</p>
<p>You need a token to communicate between your 3rd application and wallabag API.</p>
<p>To create this token, you need <a href="{{ path('create_client') }}">to create a new client</a>.</p>
<p>To create this token, you need <a href="{{ path('developer_create_client') }}">to create a new client</a>.</p>
<p>Now, create your token (replace client_id, client_secret, username and password with the good values):</p>
<p>
<pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \

View File

@ -13,15 +13,52 @@
<h4>{% trans %}Documentation{% endtrans %}</h4>
<ul>
<li><a href="{{ path('howto-firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li>
</ul>
<h4>{% trans %}Clients{% endtrans %}</h4>
<ul>
<li><a href="{{ path('create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
<li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
</ul>
<h4>{% trans %}Existing clients{% endtrans %}</h4>
{% if clients %}
<ul class="collapsible" data-collapsible="expandable">
{% for client in clients %}
<li>
<div class="collapsible-header">#{{ client.id }}</div>
<div class="collapsible-body">
<table class="striped">
<tr>
<td>{% trans %}Client ID:{% endtrans %}</td>
<td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Client secret:{% endtrans %}</td>
<td><strong><code>{{ client.secret }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Redirect URIs:{% endtrans %}</td>
<td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Grant type allowed:{% endtrans %}</td>
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
</tr>
</table>
<p>
{% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/>
{% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a>
</p>
</div>
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}No client yet.{% endtrans %}
{% endif %}
</div>
</div>