Skip to content

Commit 4fbc234

Browse files
authored
[Core] Add SaasOauth runtime support (#1228)
1 parent aed56f2 commit 4fbc234

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
77

88
<!-- towncrier release notes start -->
99

10+
## 0.15.0 (2024-12-12)
11+
12+
### Features
13+
14+
- Added `SaasOauth` runtime support
15+
16+
1017
## 0.14.7 (2024-12-09)
1118

1219

port_ocean/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def parse_config(model: Type[BaseModel], config: Any) -> BaseModel:
103103

104104
@validator("runtime")
105105
def validate_runtime(cls, runtime: Runtime) -> Runtime:
106-
if runtime == Runtime.Saas:
106+
if runtime.is_saas_runtime:
107107
spec = get_spec_file()
108108
if spec is None:
109109
raise ValueError(

port_ocean/core/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88

99
class Runtime(Enum):
1010
Saas = "Saas"
11+
SaasOauth = "SaasOauth"
1112
OnPrem = "OnPrem"
1213

14+
@property
15+
def is_saas_runtime(self) -> bool:
16+
return self in [Runtime.Saas, Runtime.SaasOauth]
17+
1318

1419
class Entity(BaseModel):
1520
identifier: Any

port_ocean/ocean.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from starlette.types import Scope, Receive, Send
1111

1212
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
13-
from port_ocean.core.models import Runtime
1413
from port_ocean.clients.port.client import PortClient
1514
from port_ocean.config.settings import (
1615
IntegrationConfiguration,
@@ -73,7 +72,7 @@ def __init__(
7372
self.app_initialized = False
7473

7574
def is_saas(self) -> bool:
76-
return self.config.runtime == Runtime.Saas
75+
return self.config.runtime.is_saas_runtime
7776

7877
async def _setup_scheduled_resync(
7978
self,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "port-ocean"
3-
version = "0.14.7"
3+
version = "0.15.0"
44
description = "Port Ocean is a CLI tool for managing your Port projects."
55
readme = "README.md"
66
homepage = "https://app.getport.io"

0 commit comments

Comments
 (0)