Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters