Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions exosphere-runtimes/cloud-storage-runtime/nodes/list_s3_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import boto3
import os

from exospherehost import BaseNode
from typing import List
from pydantic import BaseModel
Expand All @@ -18,18 +16,17 @@ class Outputs(BaseModel):
key: str

class Secrets(BaseModel):
aws_access_key_id: str = os.getenv("S3_ACCESS_KEY_ID")
aws_secret_access_key: str = os.getenv("S3_SECRET_ACCESS_KEY")
aws_region: str = os.getenv("S3_REGION")
aws_access_key_id: str
aws_secret_access_key: str
aws_region: str

async def execute(self) -> List[Outputs]:
print(self.inputs)

s3_client = boto3.client(
's3',
aws_access_key_id=os.getenv("S3_ACCESS_KEY_ID"),
aws_secret_access_key=os.getenv("S3_SECRET_ACCESS_KEY"),
region_name=os.getenv("S3_REGION")
aws_access_key_id=self.secrets.aws_access_key_id,
aws_secret_access_key=self.secrets.aws_secret_access_key,
region_name=self.secrets.aws_region
)
response = s3_client.list_objects_v2(Bucket=self.inputs.bucket_name, Prefix=self.inputs.prefix)

Expand Down
1 change: 1 addition & 0 deletions exosphere-runtimes/cloud-storage-runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"boto3>=1.40.1",
"exospherehost==0.0.7b3",
"python-dotenv>=1.1.1",
]
438 changes: 438 additions & 0 deletions exosphere-runtimes/cloud-storage-runtime/uv.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python-sdk/exospherehost/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.0.7b3"
version = "0.0.7b4"
2 changes: 1 addition & 1 deletion python-sdk/exospherehost/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ async def _worker(self):
try:
node = self._node_mapping[state["node_name"]]
secrets = await self._get_secrets(state["state_id"])
outputs = await node()._execute(node.Inputs(**state["inputs"]), node.Secrets(**secrets))
outputs = await node()._execute(node.Inputs(**state["inputs"]), node.Secrets(**secrets["secrets"]))

if outputs is None:
outputs = []
Expand Down
8 changes: 1 addition & 7 deletions state-manager/app/models/db/graph_template_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
import base64

from .base import BaseDatabaseModel
Expand Down Expand Up @@ -47,12 +46,7 @@ def _validate_secret_value(cls, secret_value: str) -> None:
# 12 bytes nonce + minimum ciphertext + base64 encoding
if len(secret_value) < 32: # Minimum length for encrypted string
raise ValueError("Value appears to be too short for an encrypted string")

# Check if the string contains only URL-safe base64 characters
url_safe_base64_pattern = r'^[A-Za-z0-9_-]+$'
if not re.match(url_safe_base64_pattern, secret_value):
raise ValueError("Value must be URL-safe base64 encoded")


# Try to decode as base64 to ensure it's valid
try:
decoded = base64.urlsafe_b64decode(secret_value)
Expand Down
2 changes: 1 addition & 1 deletion state-manager/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def errored_state_route(namespace_name: str, state_id: str, body: ErroredR


@router.put(
"/graph-templates/{graph_name}",
"/graph/{graph_name}",
response_model=UpsertGraphTemplateResponse,
status_code=status.HTTP_201_CREATED,
response_description="Graph template upserted successfully",
Expand Down