Skip to content

Commit 6095494

Browse files
committed
Improve API key request documentation
Reword the message in API key request form. Reference: #1002 Signed-off-by: Tushar Goel <[email protected]>
1 parent 1ed4080 commit 6095494

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

vulnerabilities/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ def __init__(self, *args, **kwargs):
5555
email_field.label = "Email"
5656
email_field.widget.attrs["class"] = "input"
5757
email_field.widget.attrs["style"] = "width: 50%"
58-
email_field.widget.attrs["placeholder"] = "e.g. [email protected]"
58+
email_field.widget.attrs["placeholder"] = "[email protected]"
5959
first_name_field.label = "First Name"
6060
first_name_field.widget.attrs["class"] = "input"
6161
first_name_field.widget.attrs["style"] = "width: 50%"
62-
first_name_field.widget.attrs["placeholder"] = "e.g. Jon"
62+
first_name_field.widget.attrs["placeholder"] = "Jon"
6363
last_name_field.label = "Last Name"
6464
last_name_field.widget.attrs["class"] = "input"
6565
last_name_field.widget.attrs["style"] = "width: 50%"
66-
last_name_field.widget.attrs["placeholder"] = "e.g. Doe"
66+
last_name_field.widget.attrs["placeholder"] = "Doe"
6767

6868
def save(self, commit=True):
6969
return ApiUser.objects.create_api_user(

vulnerabilities/templates/api_user_creation_form.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{% extends "base.html" %}
22
{%load crispy_forms_tags %}
3-
3+
{% block title %}
4+
VulnerableCode API key request
5+
{% endblock %}
46

57
{% block content %}
68
<section class="section pt-0">
@@ -23,7 +25,13 @@ <h2 class="subtitle mb-0 pt-2 mb-2">
2325
</h2>
2426

2527
<section class="ml-2 mt-3 pr-4 pt-4 pl-4 pb-4 has-background-light has-border-radius">
26-
Please provide your <b>email address</b> and we will email you the <b>API token</b>.
28+
<p class="pb-2">You need an <b>API key</b> to access the
29+
<a href="{% url 'api-root' %}">VulnerableCode JSON REST API</a>.
30+
Please check the live <a href="{% url 'api_docs' %}"> OpenAPI documentation </a>
31+
to learn how to use <a href="{% url 'api-root' %}">the API</a>.
32+
By using this API, you agree to the VulnerableCode.io <a href="/tos">Terms of Service</a>.
33+
This <b>API key</b> gives you a throttled access to the API and helps to prevent abuse of the API.
34+
</p>
2735
</section>
2836

2937
<br/>

vulnerabilities/templates/navbar.html

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,12 @@
1818
</div>
1919
</div>
2020
<div class="navbar-end mr-3">
21+
<a class="navbar-item" href="{% url 'api_user_request' %}" target="_blank">
22+
API
23+
</a>
2124
<div class="navbar-item navbar-item is-cursor-help">
2225
<div class="dropdown is-right is-hoverable ">
23-
<div class="dropdown-trigger has-text-grey-light">
24-
API
25-
</div>
26-
<div class="dropdown-menu navbar-hover-div" role="menu">
27-
<div class="dropdown-content">
28-
<div class="dropdown-item about-hover-div">
29-
If you want to try the JSON REST API for VulnerableCode.io,
30-
first <a href="{% url 'api_user_request' %}">request an API key</a>,
31-
then <a href="{% url 'api_docs' %}">visit the live OpenAPI documentation</a>,
32-
and <a href="{% url 'api_docs' %}">the API endpoint</a>.
33-
Note that API access may be throttled.
34-
</div>
35-
</div>
36-
</div>
37-
</div>
38-
</div>
39-
<div class="navbar-item navbar-item is-cursor-help">
40-
<div class="dropdown is-right is-hoverable ">
41-
<div class="dropdown-trigger has-text-grey-light">
42-
About
43-
</div>
26+
<div class="dropdown-trigger has-text-grey-light">About</div>
4427
<div class="dropdown-menu navbar-hover-div" role="menu">
4528
<div class="dropdown-content">
4629
<div class="dropdown-item about-hover-div">

0 commit comments

Comments
 (0)