8
8
9
9
from flask_openapi3 import Info , Tag
10
10
from flask_openapi3 import OpenAPI
11
- from flask_openapi3 .models .security import HTTPBearer , OAuth2 , OAuthFlows , OAuthFlowImplicit , APIKey
11
+ from flask_openapi3 .models .security import HTTPBearer , OAuth2 , OAuthFlows , OAuthFlowImplicit , APIKey , HTTPBase
12
12
13
13
info = Info (title = 'book API' , version = '1.0.0' )
14
- jwt = HTTPBearer (bearerFormat = "JWT" )
14
+ basic = HTTPBase ()
15
+ jwt = HTTPBearer ()
15
16
api_key = APIKey (name = 'api key' )
16
17
oauth2 = OAuth2 (flows = OAuthFlows (
17
18
implicit = OAuthFlowImplicit (
21
22
"read:pets" : "read your pets"
22
23
}
23
24
)))
24
- security_schemes = {"jwt" : jwt , "api_key" : api_key , "oauth2" : oauth2 }
25
+ security_schemes = {"jwt" : jwt , "api_key" : api_key , "oauth2" : oauth2 , "basic" : basic }
25
26
26
27
27
28
class NotFoundResponse (BaseModel ):
@@ -34,7 +35,8 @@ class NotFoundResponse(BaseModel):
34
35
book_tag = Tag (name = 'book' , description = 'Some Book' )
35
36
security = [
36
37
{"jwt" : []},
37
- {"oauth2" : ["write:pets" , "read:pets" ]}
38
+ {"oauth2" : ["write:pets" , "read:pets" ]},
39
+ {"basic" : basic }
38
40
]
39
41
40
42
app .config ["VALIDATE_RESPONSE" ] = True
0 commit comments