Skip to content

Commit e4af270

Browse files
Adding mTLS test
1 parent 533d8ae commit e4af270

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/functional/event_handler/_pydantic/test_openapi_security_schemes.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
APIKey,
44
APIKeyIn,
55
HTTPBearer,
6+
MutualTLS,
67
OAuth2,
78
OAuthFlowImplicit,
89
OAuthFlows,
@@ -110,3 +111,22 @@ def handler():
110111
open_id_connect_scheme = security_schemes["openIdConnect"]
111112
assert open_id_connect_scheme.type_.value == "openIdConnect"
112113
assert open_id_connect_scheme.openIdConnectUrl == "https://example.com/oauth2/authorize"
114+
115+
116+
def test_openapi_security_scheme_mtls():
117+
app = APIGatewayRestResolver()
118+
119+
@app.get("/")
120+
def handler():
121+
raise NotImplementedError()
122+
123+
schema = app.get_openapi_schema(
124+
security_schemes={
125+
"mutualTLS": MutualTLS(),
126+
},
127+
)
128+
129+
security_schemes = schema.components.securitySchemes
130+
assert security_schemes is not None
131+
132+
assert "mutualTLS" in security_schemes

0 commit comments

Comments
 (0)