Skip to content

Commit f85145a

Browse files
authored
Merge pull request #31 from softwareone-platform/MPT-7794_consume_optscale_through_k8s_services
MPT-7794 Split OptScale Global URL into Auth and RestAPI services URLs
2 parents 4b28aef + bfccd41 commit f85145a

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

app/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class Settings(BaseSettings):
1212
secret: str
1313
issuer: str
1414
audience: str
15-
opt_scale_api_url: str
15+
opt_scale_auth_api_url: str
16+
opt_scale_rest_api_url: str
1617
admin_token: str
1718
api_v1_prefix: str = "/modifier/v1"
1819
debug: bool = False

app/optscale_api/auth_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def build_bearer_token_header(bearer_token: str) -> dict[str, str]:
3333

3434
class OptScaleAuth:
3535
def __init__(self):
36-
self.api_client = APIClient(base_url=settings.opt_scale_api_url)
36+
self.api_client = APIClient(base_url=settings.opt_scale_auth_api_url)
3737

3838
async def check_user_allowed_to_create_cloud_account(
3939
self, bearer_token: str, org_id: str

app/optscale_api/cloud_accounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class OptScaleCloudAccountAPI:
1717
def __init__(self):
18-
self.api_client = APIClient(base_url=settings.opt_scale_api_url)
18+
self.api_client = APIClient(base_url=settings.opt_scale_rest_api_url)
1919

2020
async def link_cloud_account_with_org(
2121
self, user_access_token: str, org_id: str, conf: dict[str, str]

app/optscale_api/invitation_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class OptScaleInvitationAPI:
2020
def __init__(self):
21-
self.api_client = APIClient(base_url=settings.opt_scale_api_url)
21+
self.api_client = APIClient(base_url=settings.opt_scale_rest_api_url)
2222

2323
async def decline_invitation(self, user_access_token: str, invitation_id: str):
2424
"""

app/optscale_api/orgs_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class OptScaleOrgAPI:
2929
def __init__(self):
30-
self.api_client = APIClient(base_url=settings.opt_scale_api_url)
30+
self.api_client = APIClient(base_url=settings.opt_scale_rest_api_url)
3131

3232
async def get_user_org_list(
3333
self, user_access_token: str

app/optscale_api/users_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class OptScaleUserAPI:
1616
def __init__(self):
17-
self.api_client = APIClient(base_url=settings.opt_scale_api_url)
17+
self.api_client = APIClient(base_url=settings.opt_scale_auth_api_url)
1818

1919
# todo: check the password lenght and strength
2020
async def create_user(

env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ FFC_MODIFIER_PROJECT_NAME="CloudSpend API Modifier"
77
FFC_MODIFIER_VERSION="0.1.0"
88
FFC_MODIFIER_DESCRIPTION="Service to provide custom users and org management"
99
# CLoudSpend API
10-
FFC_MODIFIER_OPT_SCALE_API_URL="https://your-optscaledomain.com"
10+
FFC_MODIFIER_OPT_SCALE_AUTH_API_URL="https://your-optscaledomain.com"
11+
FFC_MODIFIER_OPT_SCALE_REST_API_URL="https://your-optscaledomain.com"
1112
# JWT TOKEN
1213
FFC_MODIFIER_SECRET="my_super_secret_here"
1314
FFC_MODIFIER_ALGORITHM=HS256

0 commit comments

Comments
 (0)