Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CLI test failures caused by yarl.URL._val type change #3235

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/3235.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix CLI test failures caused by `yarl.URL._val` type change.
3 changes: 2 additions & 1 deletion src/ai/backend/client/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import secrets
from datetime import datetime
from typing import Mapping, Tuple
from urllib.parse import urlparse

import attrs
from Crypto.Cipher import AES
Expand Down Expand Up @@ -50,7 +51,7 @@ def generate_signature(
Generates the API request signature from the given parameters.
"""
hash_type = hash_type
hostname = endpoint._val.netloc # type: ignore
hostname = urlparse(str(endpoint)).netloc
jopemachine marked this conversation as resolved.
Show resolved Hide resolved
body_hash = hashlib.new(hash_type, b"").hexdigest()

sign_str = "{}\n{}\n{}\nhost:{}\ncontent-type:{}\nx-backendai-version:{}\n{}".format( # noqa
Expand Down
Loading