- Updated python_coding_microproject.csv to use NVIDIA NIM Kimi K2 - Updated kali_linux_shell_simulator.csv to use NVIDIA NIM Kimi K2 - Made more general-purpose (flexible targets, expanded tools) - Added nemotron-mini-agent.csv for fast local inference via Ollama - Added nemotron-agent.csv for advanced reasoning via Ollama - Added wiki page: Projects for NVIDIA NIMs and Nemotron
20 lines
721 B
Python
20 lines
721 B
Python
"""
|
|
Authentication utilities for API endpoints
|
|
"""
|
|
|
|
from fastapi import HTTPException, Header
|
|
from app.core.security import capability_validator, CapabilityToken
|
|
|
|
|
|
async def verify_capability(authorization: str = Header(None)) -> CapabilityToken:
|
|
"""Verify capability token from Authorization header"""
|
|
if not authorization or not authorization.startswith("Bearer "):
|
|
raise HTTPException(status_code=401, detail="Missing or invalid authorization header")
|
|
|
|
token_str = authorization.replace("Bearer ", "")
|
|
token = capability_validator.verify_capability_token(token_str)
|
|
|
|
if not token:
|
|
raise HTTPException(status_code=401, detail="Invalid capability token")
|
|
|
|
return token |