Skip to content

Commit 4a919ef

Browse files
committed
Clarify API key registration fields
1 parent bad1499 commit 4a919ef

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

‎api/api/serializers/oauth2_serializers.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ class OAuth2RegistrationSerializer(serializers.ModelSerializer):
99
class Meta:
1010
model = OAuth2Registration
1111
fields = ("name", "description", "email")
12+
extra_kwargs = {
13+
"name": {
14+
"help_text": (
15+
"A unique human-readable name for your application or project. "
16+
"This name must be unique across all registered Openverse API "
17+
"applications."
18+
)
19+
},
20+
"description": {
21+
"help_text": (
22+
"A description of what you are trying to achieve with your "
23+
"project using the API. Please provide as much detail as possible."
24+
)
25+
},
26+
"email": {
27+
"help_text": (
28+
"A valid email address that Openverse can use to contact you about "
29+
"your use case or data consumption."
30+
)
31+
},
32+
}
1233

1334

1435
class OAuth2ApplicationSerializer(serializers.Serializer):

‎api/api/views/oauth2_views.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ class Register(APIView):
4949
@register
5050
def post(self, request, format=None):
5151
"""
52-
Register an application to access to API via OAuth2.
52+
Register an application for access to the Openverse API via OAuth2.
53+
54+
Provide a unique application `name`, a brief `description`, and an
55+
`email` address where Openverse can contact you. The application `name`
56+
must be unique across all registered Openverse API applications.
5357
5458
Upon registering, you will receive a `client_id` and `client_secret`,
5559
which you can then use to authenticate using the standard OAuth2 flow.
@@ -60,8 +64,8 @@ def post(self, request, format=None):
6064
> - You must keep `client_secret` confidential, as anybody with your
6165
> `client_secret` can impersonate your application.
6266
63-
You must verify your email address by click the link sent to you in an
64-
email. Until you do that, the application will be subject to the same
67+
You must verify your email address by clicking the link sent to you in
68+
an email. Until you do that, the application will be subject to the same
6569
rate limits as an anonymous user.
6670
"""
6771

0 commit comments

Comments
 (0)