536: Add endpoint to resolve frontend user by auth method and username (#539)

* Add endpoint to resolve frontend user by auth method and username

* Require client ID for frontend user lookup

* Remove unnecessary if check

* Fix PromptRepository -> UserRepository

* Convert to protocol User

* Move User prep

* Address review comments

* 404 -> HTTP_404_NOT_FOUND
This commit is contained in:
Oliver Stanley
2023-01-10 18:20:56 +01:00
committed by GitHub
parent 1318c213d3
commit e5abb2dc85
3 changed files with 44 additions and 1 deletions
@@ -9,7 +9,7 @@ class OasstErrorCode(IntEnum):
Ranges:
0-1000: general errors
1000-2000: tasks endpoint
2000-3000: prompt_repository
2000-3000: prompt_repository, task_repository, user_repository
3000-4000: external resources
"""
@@ -45,6 +45,7 @@ class OasstErrorCode(IntEnum):
TASK_NOT_ACK = 2104
TASK_ALREADY_DONE = 2105
TASK_NOT_COLLECTIVE = 2106
USER_NOT_FOUND = 2200
# 3000-4000: external resources
HUGGINGFACE_API_ERROR = 3001