Skip to content

Commit

Permalink
be able to specify felt.com in a single place
Browse files Browse the repository at this point in the history
  • Loading branch information
springmeyer committed Mar 1, 2024
1 parent dde9676 commit e28ff9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions felt/core/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
from .meta import PLUGIN_METADATA_PARSER
from .s3_upload_parameters import S3UploadParameters
from .enums import UsageType
from .constants import (
FELT_API_URL
)

PLUGIN_VERSION = "0.7.0"

Expand All @@ -50,7 +53,6 @@ class FeltApiClient:
Client for the Felt API
"""

URL = 'https://felt.com/api/v1'
USER_ENDPOINT = '/user'
WORKSPACES_ENDPOINT = '/workspaces'
CREATE_MAP_ENDPOINT = '/maps'
Expand Down Expand Up @@ -86,7 +88,7 @@ def build_url(endpoint: str) -> QUrl:
"""
Returns the full url of the specified endpoint
"""
return QUrl(FeltApiClient.URL + endpoint)
return QUrl(FELT_API_URL + endpoint)

@staticmethod
def _to_url_query(parameters: Dict[str, object]) -> QUrlQuery:
Expand Down
5 changes: 4 additions & 1 deletion felt/core/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
)

from .pkce import generate_pkce_pair
from .constants import (
FELT_API_BASE
)

OAUTH_BASE = "https://felt.com/oauth"
OAUTH_BASE = f"{FELT_API_BASE}/oauth"
AUTH_HANDLER_REDIRECT = \
OAUTH_BASE + "/success?client_id=8cb129bd-6962-4f65-8cc9-14b760e8436a"
AUTH_HANDLER_REDIRECT_CANCELLED = \
Expand Down
9 changes: 5 additions & 4 deletions felt/gui/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'


SIGNUP_URL = 'https://felt.com/signup'
TOS_URL = 'https://felt.com/terms'
PRIVACY_POLICY_URL = 'https://felt.com/privacy'
FELT_API_BASE = "https://felt.com/"
FELT_API_URL = f'{FELT_API_BASE}/api/v1'
SIGNUP_URL = f'{FELT_API_BASE}/signup'
TOS_URL = f'{FELT_API_BASE}/terms'
PRIVACY_POLICY_URL = f'{FELT_API_BASE}/privacy'

0 comments on commit e28ff9a

Please sign in to comment.