Skip to content

Commit 6717aa8

Browse files
committed
move TLSInfo to _types
1 parent accd5f8 commit 6717aa8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

uvicorn/_types.py

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ class LifespanScope(TypedDict):
9696
WWWScope = Union[HTTPScope, WebSocketScope]
9797
Scope = Union[HTTPScope, WebSocketScope, LifespanScope]
9898

99+
class TLSInfo(TypedDict, total=False):
100+
type: Literal["extensions.tls"]
101+
server_cert: str | None
102+
client_cert_chain: list[str]
103+
tls_version: str | None
104+
cipher_suite: str | None
99105

100106
class HTTPRequestEvent(TypedDict):
101107
type: Literal["http.request"]

uvicorn/protocols/utils.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import asyncio
44
import ssl
55
import urllib.parse
6-
from typing import TypedDict
76

8-
from uvicorn._types import WWWScope
7+
from uvicorn._types import WWWScope, TLSInfo
98
from uvicorn.config import Config
109

1110

@@ -59,13 +58,6 @@ def get_path_with_query_string(scope: WWWScope) -> str:
5958
return path_with_query_string
6059

6160

62-
class TLSInfo(TypedDict, total=False):
63-
server_cert: str | None
64-
client_cert_chain: list[str]
65-
tls_version: str | None
66-
cipher_suite: str | None
67-
68-
6961
def get_tls_info(transport: asyncio.Transport, server_config: Config) -> TLSInfo:
7062
###
7163
# server_cert: Unable to set from transport information, need to set from server_config

0 commit comments

Comments
 (0)