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
1 change: 0 additions & 1 deletion docs/guides/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ The service sends this payload to the orchestrator:
"id": "my-service",
"display_name": "My Service",
"version": "1.0.0",
"summary": "Service description",
...
}
}
Expand Down
1 change: 0 additions & 1 deletion examples/app_hosting/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
id="app-hosting-demo",
display_name="App Hosting Demo",
version="1.0.0",
summary="Demonstrates hosting static web apps with servicekit",
description="This service hosts a sample dashboard app at /dashboard",
)
)
Expand Down
1 change: 0 additions & 1 deletion examples/auth_basic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
id="auth-basic-example",
display_name="Authenticated API Example",
version="1.0.0",
summary="Basic API key authentication example",
description=(
"Demonstrates API key authentication with hardcoded keys for development. "
"Shows the simplest auth setup pattern using the with_auth() method with "
Expand Down
3 changes: 0 additions & 3 deletions examples/auth_custom_header/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
id="auth-custom-header-example",
display_name="API with Custom Authentication Header",
version="1.0.0",
summary="API using custom header name for authentication",
description=(
"Demonstrates custom authentication header configuration. "
"Uses 'X-Custom-Auth-Token' instead of default 'X-API-Key'. "
"Useful for legacy system integration or compliance requirements."
),
contact={"email": "api@example.com"},
license_info={"name": "MIT"},
),
)
.with_logging()
Expand Down
3 changes: 0 additions & 3 deletions examples/auth_docker_secrets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
id="auth-docker-secrets-example",
display_name="Secure API with Docker Secrets",
version="2.0.0",
summary="Production API using Docker secrets file for authentication",
description=(
"Demonstrates Docker secrets file authentication pattern. "
"API keys are read from a file mounted as a Docker secret at runtime. "
"Compatible with Docker Compose, Docker Swarm, and Kubernetes."
),
contact={"email": "security@example.com"},
license_info={"name": "MIT"},
),
)
.with_logging()
Expand Down
3 changes: 0 additions & 3 deletions examples/auth_envvar/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
id="auth-envvar-example",
display_name="Production API with Environment Variable Auth",
version="2.0.0",
summary="Production-ready API using environment variables for authentication",
description=(
"Demonstrates the recommended approach for production deployments: "
"reading API keys from SERVICEKIT_API_KEYS environment variable. "
"Supports multiple keys for zero-downtime rotation."
),
contact={"email": "ops@example.com"},
license_info={"name": "MIT"},
),
)
.with_logging()
Expand Down
1 change: 0 additions & 1 deletion examples/core_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ async def seed_users(app: FastAPI) -> None:
id="core-user-service",
display_name="Core User Service",
version="1.0.0",
summary="User management API using core-only features",
description="Demonstrates BaseServiceBuilder with custom entities, "
"CRUD operations, health checks, and job scheduling without module dependencies.",
)
Expand Down
1 change: 0 additions & 1 deletion examples/job_scheduler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ async def get_computation_result( # pyright: ignore[reportUnusedFunction]
info = ServiceInfo(
id="job-scheduler-demo",
display_name="Job Scheduler Demo",
summary="Demonstrates async job scheduling with polling and SSE streaming",
version="1.0.0",
description=(
"Shows two patterns for monitoring long-running jobs: "
Expand Down
1 change: 0 additions & 1 deletion examples/monitoring/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
id="monitoring-example",
display_name="Monitoring Example Service",
version="1.0.0",
summary="Service with OpenTelemetry monitoring and Prometheus metrics",
description="Demonstrates automatic instrumentation of FastAPI and SQLAlchemy "
"with metrics exposed at /metrics endpoint. Includes health check endpoint.",
)
Expand Down
3 changes: 0 additions & 3 deletions examples/registration/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
id="registration-example",
display_name="Registration Example Service",
version="1.0.0",
summary="Demonstrates automatic service registration with orchestrator",
description=(
"This service automatically registers itself with an orchestrator on startup. "
"The orchestrator can then discover and monitor this service. "
"Hostname is auto-detected from Docker container name."
),
contact={"email": "ops@example.com"},
license_info={"name": "MIT"},
),
)
.with_logging()
Expand Down
1 change: 0 additions & 1 deletion examples/registration/main_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class CustomServiceInfo(ServiceInfo):
id="custom-metadata-service",
display_name="Custom Metadata Service",
version="2.0.0",
summary="Demonstrates custom ServiceInfo with additional metadata",
description=(
"This service uses a custom ServiceInfo subclass to include "
"additional metadata in the registration payload. The orchestrator "
Expand Down
1 change: 0 additions & 1 deletion examples/registration/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ async def lifespan(app: FastAPI):
id="mock-orchestrator",
display_name="Mock Orchestrator",
version="1.0.0",
summary="Simple orchestrator for testing service registration",
description=(
"Provides service registration endpoints for servicekit services to register themselves for discovery. "
f"Services must send keepalive pings within {TTL_SECONDS} seconds or they will be removed from the "
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "servicekit"
version = "0.8.0"
version = "0.8.1"
description = "Async SQLAlchemy framework with FastAPI integration - reusable foundation for building data services"
readme = "README.md"
authors = [{ name = "Morten Hansen", email = "morten@winterop.com" }]
Expand Down
23 changes: 0 additions & 23 deletions src/servicekit/api/apps/landing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,36 +100,13 @@
<div class="info-value">${info.version}</div>
</div>`);

if (info.summary) {
items.push(`<div class="info-item">
<div class="info-label">Summary</div>
<div class="info-value">${info.summary}</div>
</div>`);
}

if (info.description) {
items.push(`<div class="info-item">
<div class="info-label">Description</div>
<div class="info-value">${info.description}</div>
</div>`);
}

if (info.contact) {
const contactJson = JSON.stringify(info.contact, null, 2);
items.push(`<div class="info-item">
<div class="info-label">Contact</div>
<div class="info-value"><pre>${contactJson}</pre></div>
</div>`);
}

if (info.license_info) {
const licenseJson = JSON.stringify(info.license_info, null, 2);
items.push(`<div class="info-item">
<div class="info-label">License</div>
<div class="info-value"><pre>${licenseJson}</pre></div>
</div>`);
}

items.push(`</div>`);
const contentEl = document.getElementById('content');
contentEl.className = '';
Expand Down
11 changes: 2 additions & 9 deletions src/servicekit/api/service_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ class ServiceInfo(BaseModel):
id: str
display_name: str
version: str = "1.0.0"
summary: str | None = None
description: str | None = None
contact: dict[str, str] | None = None
license_info: dict[str, str] | None = None

model_config = ConfigDict(extra="forbid")

Expand Down Expand Up @@ -134,13 +131,9 @@ def __init__(
include_logging: bool = False,
) -> None:
"""Initialize base service builder with core options."""
if info.description is None and info.summary is not None:
# Preserve summary as description for FastAPI metadata if description missing
self.info = info.model_copy(update={"description": info.summary})
else:
self.info = info
self.info = info
self._title = self.info.display_name
self._app_description = self.info.summary or self.info.description or ""
self._app_description = self.info.description or ""
self._version = self.info.version
self._database_url = database_url
self._database_instance: Database | None = None
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.