Skip to content
Merged
Changes from all 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
20 changes: 17 additions & 3 deletions osc_sdk_python/credentials.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import warnings
from logging import warning

STD_PATH = os.path.join(os.path.expanduser("~"), ".osc/config.json")
DEFAULT_REGION = "eu-west-2"
Expand All @@ -18,7 +19,7 @@ def __init__(self, **kwargs):
self.direct_link: str = kwargs.pop("direct_link", None)

if kwargs:
unexpected = ", ".join(f"'{k}'" for k in kwargs.keys())
unexpected = ", ".join(f"'{k}'" for k in kwargs)
raise TypeError(
f"Endpoint() got unexpected keyword arguments: {unexpected}"
)
Expand All @@ -40,12 +41,25 @@ def __init__(self, **kwargs):
self.password: str = kwargs.pop("password", None)
self.protocol: str = kwargs.pop("protocol", None)
self.region: str = kwargs.pop("region", None)
self.endpoints: "Endpoint" = kwargs.pop(
self.endpoints: Endpoint = kwargs.pop(
"endpoints", Endpoint()
) # Forward reference

if (
self.x509_client_key_b64
or self.x509_client_cert
or self.x509_client_cert_b64
or self.x509_client_key
):
warnings.warn(
"Using X.509 client certificate authentication is deprecated. "
"Use access/secret key instead.",
Comment thread
jobs62 marked this conversation as resolved.
Resolved
DeprecationWarning,
stacklevel=3,
)

if kwargs:
unexpected = ", ".join(f"'{k}'" for k in kwargs.keys())
unexpected = ", ".join(f"'{k}'" for k in kwargs)
raise TypeError(f"Profile() got unexpected keyword arguments: {unexpected}")

@property
Expand Down
Loading