Skip to content

Commit

Permalink
fix: limit /api/appauth URLs as intended
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Oct 25, 2024
1 parent ac17461 commit f1f6f69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ietf/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# Datatracker version
url(r'^version/?$', api_views.version),
# Application authentication API key
url(r'^appauth/[authortools|bibxml]', api_views.app_auth),
url(r'^appauth/(?P<app>authortools|bibxml)$', api_views.app_auth),
# latest versions
url(r'^rfcdiff-latest-json/%(name)s(?:-%(rev)s)?(\.txt|\.html)?/?$' % settings.URL_REGEXPS, api_views.rfcdiff_latest_json),
url(r'^rfcdiff-latest-json/(?P<name>[Rr][Ff][Cc] [0-9]+?)(\.txt|\.html)?/?$', api_views.rfcdiff_latest_json),
Expand Down
4 changes: 2 additions & 2 deletions ietf/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from tastypie.utils.mime import determine_format, build_content_type
from textwrap import dedent
from traceback import format_exception, extract_tb
from typing import Iterable, Optional
from typing import Iterable, Optional, Literal

import ietf
from ietf.api import _api_list
Expand Down Expand Up @@ -251,7 +251,7 @@ def version(request):

@require_api_key
@csrf_exempt
def app_auth(request):
def app_auth(request, app: Literal["authortools", "bibxml"]):
return HttpResponse(
json.dumps({'success': True}),
content_type='application/json')
Expand Down

0 comments on commit f1f6f69

Please sign in to comment.