Skip to content

Commit

Permalink
fix: moved DEFAULT_BASE_DOMAIN to object instantiation (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
alannix-lw committed Jan 9, 2023
1 parent aa5edbd commit 4e3e58d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion laceworksdk/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from .v2.vulnerability_policies import VulnerabilityPoliciesAPI

from laceworksdk.config import (
DEFAULT_BASE_DOMAIN,
LACEWORK_ACCOUNT_ENVIRONMENT_VARIABLE,
LACEWORK_SUBACCOUNT_ENVIRONMENT_VARIABLE,
LACEWORK_API_KEY_ENVIRONMENT_VARIABLE,
Expand Down Expand Up @@ -99,7 +100,8 @@ def __init__(self,
self._api_secret = api_secret or os.getenv(
LACEWORK_API_SECRET_ENVIRONMENT_VARIABLE)
self._base_domain = base_domain or os.getenv(
LACEWORK_API_BASE_DOMAIN_ENVIRONMENT_VARIABLE)
LACEWORK_API_BASE_DOMAIN_ENVIRONMENT_VARIABLE
) or DEFAULT_BASE_DOMAIN

config_file_path = os.path.join(
os.path.expanduser("~"), LACEWORK_CLI_CONFIG_RELATIVE_PATH)
Expand Down
3 changes: 1 addition & 2 deletions laceworksdk/http_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from laceworksdk import version
from laceworksdk.config import (
DEFAULT_BASE_DOMAIN,
DEFAULT_ACCESS_TOKEN_EXPIRATION,
DEFAULT_SUCCESS_RESPONSE_CODES,
RATE_LIMIT_RESPONSE_CODE
Expand Down Expand Up @@ -52,7 +51,7 @@ def __init__(self, account, subaccount, api_key, api_secret, base_domain):
# Set the base parameters
self._api_key = api_key
self._api_secret = api_secret
self._base_domain = base_domain or DEFAULT_BASE_DOMAIN
self._base_domain = base_domain

self._base_url = f"https://{account}.{self._base_domain}"
self._account = account
Expand Down

0 comments on commit 4e3e58d

Please sign in to comment.