datatracker/ietf/api/ietf_utils.py
Robert Sparks 2fe4647832
feat: endpoint for imapd to authenticate against (#5295)
* feat: endpoint for imapd to authenticate against

* chore: remove unintended whitespace

* fix: be stricter in matching User
2023-03-14 12:19:21 -05:00

16 lines
544 B
Python

# Copyright The IETF Trust 2023, All Rights Reserved
# This is not utils.py because Tastypie implicitly consumes ietf.api.utils.
# See ietf.api.__init__.py for details.
from django.conf import settings
def is_valid_token(endpoint, token):
# This is where we would consider integration with vault
# Settings implementation for now.
if hasattr(settings, "APP_API_TOKENS"):
token_store = settings.APP_API_TOKENS
if endpoint in token_store and token in token_store[endpoint]:
return True
return False