Buckets:
| # e.g., src/OSSS/api/debug.py | |
| from fastapi import APIRouter, Depends, HTTPException, status | |
| from OSSS.auth.jwt import verify_and_decode | |
| from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials | |
| from OSSS.auth.roles import extract_roles | |
| from OSSS.settings import settings | |
| router = APIRouter(prefix="/debug", tags=["_debug"]) | |
| bearer = HTTPBearer(auto_error=False) | |
| async def me(creds: HTTPAuthorizationCredentials = Depends(bearer)): | |
| if not creds: | |
| raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Not authenticated") | |
| decoded = await verify_and_decode(creds.credentials) | |
| return { | |
| "iss": decoded.get("iss"), | |
| "aud": decoded.get("aud"), | |
| "azp": decoded.get("azp"), | |
| "preferred_username": decoded.get("preferred_username"), | |
| "roles": sorted(list(extract_roles(decoded, settings.KEYCLOAK_AUDIENCE))), | |
| } | |
Xet Storage Details
- Size:
- 909 Bytes
- Xet hash:
- bd09b2d4804b9aa826a82e7912cc069a1cd20abf72b427064e5555df9cffb59a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.