Skip to content

Commit

Permalink
[Core] Add SaasOauth runtime support (#1228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankilevitch authored Dec 12, 2024
1 parent aed56f2 commit 4fbc234
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.15.0 (2024-12-12)

### Features

- Added `SaasOauth` runtime support


## 0.14.7 (2024-12-09)


Expand Down
2 changes: 1 addition & 1 deletion port_ocean/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def parse_config(model: Type[BaseModel], config: Any) -> BaseModel:

@validator("runtime")
def validate_runtime(cls, runtime: Runtime) -> Runtime:
if runtime == Runtime.Saas:
if runtime.is_saas_runtime:
spec = get_spec_file()
if spec is None:
raise ValueError(
Expand Down
5 changes: 5 additions & 0 deletions port_ocean/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@

class Runtime(Enum):
Saas = "Saas"
SaasOauth = "SaasOauth"
OnPrem = "OnPrem"

@property
def is_saas_runtime(self) -> bool:
return self in [Runtime.Saas, Runtime.SaasOauth]


class Entity(BaseModel):
identifier: Any
Expand Down
3 changes: 1 addition & 2 deletions port_ocean/ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from starlette.types import Scope, Receive, Send

from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
from port_ocean.core.models import Runtime
from port_ocean.clients.port.client import PortClient
from port_ocean.config.settings import (
IntegrationConfiguration,
Expand Down Expand Up @@ -73,7 +72,7 @@ def __init__(
self.app_initialized = False

def is_saas(self) -> bool:
return self.config.runtime == Runtime.Saas
return self.config.runtime.is_saas_runtime

async def _setup_scheduled_resync(
self,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.14.7"
version = "0.15.0"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit 4fbc234

Please sign in to comment.