Skip to content

Commit

Permalink
#3978 must use the correct type hints for cythonization
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 26, 2024
1 parent 585396f commit b802a9d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion xpra/client/auth/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def __repr__(self):
def get_digest(self) -> str:
return ""

def handle(self, challenge: str, digest: str, prompt: str) -> str: # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str) -> str: # pylint: disable=unused-argument
return os.environ.get(self.var_name, "")
2 changes: 1 addition & 1 deletion xpra/client/auth/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __repr__(self):
def get_digest(self) -> str:
return ""

def handle(self, challenge: str, digest: str, prompt: str) -> bytes: # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str) -> bytes: # pylint: disable=unused-argument
log("handle(..) password_file=%s", self.password_file)
if not self.password_file:
return b""
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/auth/gss.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __repr__(self):
def get_digest() -> str:
return "gss"

def handle(self, challenge: str, digest, prompt: str): # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str): # pylint: disable=unused-argument
if not digest.startswith("gss:"):
# not a gss challenge
log("%s is not a gss challenge", digest)
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/auth/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __repr__(self):
def get_digest(self) -> str:
return "kerberos"

def handle(self, challenge: str, digest: str, prompt: str): # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str): # pylint: disable=unused-argument
if not digest.startswith("kerberos:"):
log("%s is not a kerberos challenge", digest)
# not a kerberos challenge
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/auth/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __repr__(self):
def get_digest(self) -> str:
return ""

def handle(self, challenge: str, digest: str, prompt: str = "password"): # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str = "password"): # pylint: disable=unused-argument
digest_type = digest.split(":", 1)[0]
if not prompt and digest_type in ("gss", "kerberos"):
prompt = f"{digest_type} token"
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/auth/u2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __repr__(self):
def get_digest() -> str:
return "u2f"

def handle(self, challenge: str, digest: str, prompt: str) -> (
def handle(self, challenge: bytes, digest: str, prompt: str) -> (
tuple[bytes, bytes] | None): # pylint: disable=unused-argument
if not digest.startswith("u2f:"):
log("%s is not a u2f challenge", digest)
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/auth/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ def __repr__(self):
def get_digest() -> str:
return ""

def handle(self, challenge: str, digest: str, prompt: str) -> str: # pylint: disable=unused-argument
def handle(self, challenge: bytes, digest: str, prompt: str) -> str: # pylint: disable=unused-argument
return self.client.password
2 changes: 1 addition & 1 deletion xpra/client/base/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def do_process_challenge(self, packet: PacketType) -> None:
while self.challenge_handlers:
handler = self.pop_challenge_handler(digest)
try:
challenge = packet[1]
challenge = strtobytes(packet[1])
prompt = "password"
if len(packet) >= 6:
prompt = std(str(packet[5]), extras="-,./: '")
Expand Down

0 comments on commit b802a9d

Please sign in to comment.