Add HTTPException with custom headers (#35)

* 📝 Update Release Notes with issue templates

*  Add HTTPException with support for headers

Including docs and tests

* 📝 Update Security docs to use new HTTPException
This commit is contained in:
Sebastián Ramírez
2019-02-16 17:01:29 +04:00
committed by GitHub
parent 7edbd9345b
commit 8772e2f2ee
16 changed files with 452 additions and 14 deletions

View File

@@ -1,12 +1,11 @@
from datetime import datetime, timedelta
import jwt
from fastapi import Depends, FastAPI, Security
from fastapi import Depends, FastAPI, Security, HTTPException
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from jwt import PyJWTError
from passlib.context import CryptContext
from pydantic import BaseModel
from starlette.exceptions import HTTPException
from starlette.status import HTTP_403_FORBIDDEN
# to get a string like this run: