mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 06:47:42 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from tornado.httputil import HTTPHeaders
|
||||
|
||||
|
||||
@dataclass
|
||||
class LookupCredentials:
|
||||
@@ -13,7 +17,7 @@ class LookupCredentials:
|
||||
hamqth_session_id: str = "" # alternative to username/password
|
||||
|
||||
|
||||
def extract_credentials(headers):
|
||||
def extract_credentials(headers: HTTPHeaders) -> LookupCredentials | None:
|
||||
"""Build a LookupCredentials from HTTP request headers; returns None if no usable credentials are present."""
|
||||
creds = LookupCredentials(
|
||||
qrz_username=headers.get("X-QRZ-Username", ""),
|
||||
|
||||
Reference in New Issue
Block a user