Skip to content

Commit 33e7be3

Browse files
committed
Added more information about personal API keys to the API help page.
- Legacy-Id: 15031
1 parent a96c6c4 commit 33e7be3

2 files changed

Lines changed: 39 additions & 6 deletions

File tree

ietf/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def api_help(request):
4848
key = JWK()
4949
# import just public part here, for display in info page
5050
key.import_from_pem(settings.API_PUBLIC_KEY_PEM)
51-
return render(request, "api/index.html", {'key': key, })
51+
return render(request, "api/index.html", {'key': key, 'settings':settings, })
5252

ietf/templates/api/index.html

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,53 @@ <h3>Documents</h3>
164164
etc.
165165
</p>
166166

167-
<h3>API Keys</h3>
167+
<h3 id="personal-api-keys" class="anchor-target">Personal API Keys</h3>
168168

169169
<p>
170170

171171
The datatracker has some API endpoints that uses Personal API keys,
172172
rather than username/password login, see for example details for
173173
<code>{% url 'ietf.doc.views_ballot.api_set_position' %}</code> further
174174
down on this page. Personal API keys are available from your <a
175-
href="{% url 'ietf.ietfauth.views.apikey_index'%}"> Account API Key</a>
175+
href="{% url 'ietf.ietfauth.views.apikey_index'%}"> Account API Keys</a>
176176
page when you are logged in.
177177

178+
</p>
179+
<p>
180+
181+
Personal API keys have some characteristics you should be aware of:
182+
<ul>
183+
<li>
184+
185+
Each API key is valid only for a specific endpoint. If you try to use a key for
186+
a different API endpoint than it's created for, it will not work.
187+
188+
</li>
189+
<li>
190+
191+
The API keys will cause you to be given access with the datatracker
192+
roles you have, thus giving you appropriate access to the various
193+
API endpoints according to the role limitations indicated for each
194+
endpoint.
195+
196+
</li>
197+
<li>
198+
199+
An API key will only give you access to its related endpoint if you have logged
200+
in to the datatracker using your regular login and password during the last
201+
{{ settings.UTILS_APIKEY_GUI_LOGIN_LIMIT_DAYS }} days. If you receive the
202+
error message "<code>Too long since last regular login</code>" you should do
203+
a regular login in order to activate access.
204+
205+
</li>
206+
207+
</ul>
208+
209+
210+
178211
</p>
179212

180-
<h3>Signing</h3>
213+
<h3 id="signing-keys" class="anchor-target">Signing Keys</h3>
181214
<p>
182215

183216
When sending notifications to other APIs, the datatracker may sign
@@ -192,7 +225,7 @@ <h3>Signing</h3>
192225

193226
<pre>{{key.export_to_pem}}</pre>
194227

195-
<h3 id="iesg-position-api">IESG ballot position API</h3>
228+
<h3 id="iesg-position-api" class="anchor-target">IESG ballot position API</h3>
196229

197230
<p>
198231

@@ -228,7 +261,7 @@ <h3 id="iesg-position-api">IESG ballot position API</h3>
228261

229262

230263

231-
<h3 id="session-video-url-api">Set session video URL</h3>
264+
<h3 id="session-video-url-api" class="anchor-target">Set session video URL</h3>
232265

233266
<p>
234267

0 commit comments

Comments
 (0)