Skip to content

Commit 43513ed

Browse files
committed
Adds private app authentication API for bibxml. Fixes ietf-tools#3480. Commit ready for merge.
- Legacy-Id: 19711
1 parent 8c69753 commit 43513ed

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

ietf/api/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ def test_api_version(self):
354354
self.assertEqual(data['version'], ietf.__version__+ietf.__patch__)
355355
self.assertIn(data['date'], ietf.__date__)
356356

357-
def test_api_appauth_authortools(self):
358-
url = urlreverse('ietf.api.views.author_tools')
357+
def test_api_appauth(self):
358+
url = urlreverse('ietf.api.views.app_auth')
359359
person = PersonFactory()
360360
apikey = PersonalApiKey.objects.create(endpoint=url, person=person)
361361

ietf/api/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
url(r'^submit/?$', submit_views.api_submit),
4141
# Datatracker version
4242
url(r'^version/?$', api_views.version),
43-
# Authtools API key
44-
url(r'^appauth/authortools', api_views.author_tools),
43+
# Application authentication API key
44+
url(r'^appauth/[authortools|bibxml]', api_views.app_auth),
4545
]
4646

4747
# Additional (standard) Tastypie endpoints

ietf/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def version(request):
218218

219219
@require_api_key
220220
@csrf_exempt
221-
def author_tools(request):
221+
def app_auth(request):
222222
return HttpResponse(
223223
json.dumps({'success': True}),
224224
content_type='application/json')

ietf/ietfauth/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def test_apikey_errors(self):
655655
self.assertContains(r, 'Invalid apikey', status_code=403)
656656

657657
# invalid apikey (invalidated api key)
658-
unauthorized_url = urlreverse('ietf.api.views.author_tools')
658+
unauthorized_url = urlreverse('ietf.api.views.app_auth')
659659
invalidated_apikey = PersonalApiKey.objects.create(
660660
endpoint=unauthorized_url, person=person, valid=False)
661661
r = self.client.post(unauthorized_url, {'apikey': invalidated_apikey.hash()})

ietf/person/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ def salt():
357357
("/api/notify/meeting/registration", "/api/notify/meeting/registration", "Robot"),
358358
("/api/notify/meeting/bluesheet", "/api/notify/meeting/bluesheet", "Recording Manager"),
359359
("/api/appauth/authortools", "/api/appauth/authortools", None),
360+
("/api/appauth/bibxml", "/api/appauth/bibxml", None),
360361
]
361362
PERSON_API_KEY_ENDPOINTS = sorted(list(set([ (v, n) for (v, n, r) in PERSON_API_KEY_VALUES ])))
362363

0 commit comments

Comments
 (0)