Skip to content

Commit

Permalink
Add endpoint for clients to check token validity
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Jun 18, 2021
1 parent 692f27c commit fb254b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions shipper/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
path('maintainers/build/<int:pk>/delete/', BuildDeleteView.as_view(), name='build_delete'),
path('maintainers/api/system/', system_information, name='system_information'),
path('maintainers/api/login/', maintainer_api_login, name='maintainer_api_login'),
path('maintainers/api/token_check/', maintainer_api_token_check, name='maintainer_api_token_check'),
path('maintainers/api/chunked_upload/', ChunkedBuildUpload.as_view(), name='chunked_build_upload'),
path('maintainers/api/chunked_upload/<uuid:pk>/', ChunkedBuildUpload.as_view(), name='chunkedupload-detail'),
]
11 changes: 11 additions & 0 deletions shipper/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ def system_information(request):
)


@csrf_exempt
@api_view(["GET"])
def maintainer_api_token_check(request):
return Response(
{
'username': request.user.username
},
status=HTTP_200_OK
)


def get_codename_from_filename(filename):
fields = os.path.splitext(filename)[0].split('-')
# Check field count
Expand Down

0 comments on commit fb254b5

Please sign in to comment.