-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess.py
More file actions
34 lines (27 loc) · 784 Bytes
/
access.py
File metadata and controls
34 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import enum
from fastapi import APIRouter
from workerfacing_api.settings import (
cognito_client_id,
cognito_region,
cognito_user_pool_id,
)
router = APIRouter()
class AccessType(enum.Enum):
COGNITO = "cognito"
@router.get(
"/access_info",
response_model=dict[AccessType, dict[str, str | None]],
status_code=200,
responses={
200: {"description": "Access information retrieved successfully"},
},
description="Get information about where API users should authenticate.",
)
def get_access_info() -> dict[AccessType, dict[str, str | None]]:
return {
AccessType.COGNITO: {
"user_pool_id": cognito_user_pool_id,
"client_id": cognito_client_id,
"region": cognito_region,
},
}