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
38 changes: 23 additions & 15 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Validates license keys against a remote server with local caching and an offline
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `server_url` | string | `""` | License validation server URL. Leave empty for offline/starter mode. |
| `license_key` | string | `""` | License key. Supports `$ENV_VAR` expansion. Falls back to `WORKFLOW_LICENSE_KEY` env var. |
| `license_key` | string | `""` | License key. When empty, falls back to the `WORKFLOW_LICENSE_KEY` environment variable. |
| `cache_ttl` | duration | `1h` | How long to cache a valid license result before re-validating. |
| `grace_period` | duration | `72h` | How long to allow operation when the license server is unreachable. |
| `refresh_interval` | duration | `1h` | How often the background goroutine re-validates the license. |
Expand All @@ -223,7 +223,7 @@ modules:
type: license.validator
config:
server_url: "https://license.gocodalone.com/api/v1"
license_key: "$WORKFLOW_LICENSE_KEY"
license_key: "" # leave empty to use WORKFLOW_LICENSE_KEY env var
cache_ttl: "1h"
grace_period: "72h"
refresh_interval: "1h"
Expand All @@ -233,13 +233,15 @@ modules:

### `platform.provider`

Declares a cloud infrastructure provider (e.g., Terraform, Pulumi) for use with the platform workflow handler and reconciliation trigger.
Declares a cloud infrastructure provider (e.g., AWS, Docker Compose, GCP) for use with the platform workflow handler and reconciliation trigger.

**Configuration:**

| Key | Type | Required | Description |
|-----|------|----------|-------------|
| `name` | string | yes | Provider name used to construct the service name `platform.provider.<name>`. |
| `name` | string | yes | Provider identifier (e.g., `aws`, `docker-compose`, `gcp`). Used to construct the service name `platform.provider.<name>`. |
| `config` | map[string]string | no | Provider-specific configuration (credentials, region, etc.). |
| `tiers` | JSON | no | Three-tier infrastructure layout (`infrastructure`, `shared_primitives`, `application`). |

**Example:**

Expand All @@ -249,20 +251,25 @@ modules:
type: platform.provider
config:
name: "aws"
config:
region: "us-east-1"
```

---

### `platform.resource`

Declares an infrastructure resource managed by a platform provider. Config keys are provider-specific and passed through as-is.
A capability-based resource declaration managed by the platform abstraction layer.

**Configuration:**

| Key | Type | Required | Description |
|-----|------|----------|-------------|
| `type` | string | yes | Infrastructure resource type (e.g., `database`, `queue`, `container_runtime`). |
| *(additional keys)* | any | no | Provider-specific resource properties. |
| `name` | string | yes | Unique identifier for this resource within its tier. |
| `type` | string | yes | Abstract capability type (e.g., `container_runtime`, `database`, `message_queue`). |
| `tier` | string | no | Infrastructure tier: `infrastructure`, `shared_primitive`, or `application` (default: `application`). |
| `capabilities` | JSON | no | Provider-agnostic capability properties (replicas, memory, ports, etc.). |
| `constraints` | JSON | no | Hard limits imposed by parent tiers. |

**Example:**

Expand All @@ -271,9 +278,12 @@ modules:
- name: orders-db
type: platform.resource
config:
name: orders-db
type: database
engine: postgresql
storage: "10Gi"
tier: application
capabilities:
engine: postgresql
storage: "10Gi"
```

---
Expand All @@ -286,10 +296,9 @@ Provides the execution context for platform operations. Used to identify the org

| Key | Type | Required | Description |
|-----|------|----------|-------------|
| `path` | string | yes | Path identifying this context. |
| `org` | string | no | Organization name. |
| `environment` | string | no | Deployment environment (e.g., `production`, `staging`). |
| `tier` | number | no | Platform tier level. |
| `org` | string | yes | Organization identifier. |
| `environment` | string | yes | Deployment environment (e.g., `production`, `staging`, `dev`). |
| `tier` | string | no | Infrastructure tier: `infrastructure`, `shared_primitive`, or `application` (default: `application`). |

**Example:**

Expand All @@ -298,10 +307,9 @@ modules:
- name: platform-ctx
type: platform.context
config:
path: "acme-corp/production"
org: "acme-corp"
environment: "production"
tier: 3
tier: "application"
```

---
Expand Down
14 changes: 0 additions & 14 deletions plugins/http/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,6 @@ func rateLimitMiddlewareFactory(name string, cfg map[string]any) modular.Module
}
}

// requestsPerHour takes precedence over requestsPerMinute for low-frequency
// endpoints (e.g. registration) where fractional per-minute rates are needed.
if rph, ok := cfg["requestsPerHour"].(int); ok {
return module.NewRateLimitMiddlewareWithHourlyRate(name, rph, burstSize)
} else if rph, ok := cfg["requestsPerHour"].(float64); ok {
return module.NewRateLimitMiddlewareWithHourlyRate(name, int(rph), burstSize)
}

requestsPerMinute := 60
if rpm, ok := cfg["requestsPerMinute"].(int); ok {
requestsPerMinute = rpm
} else if rpm, ok := cfg["requestsPerMinute"].(float64); ok {
requestsPerMinute = int(rpm)
}
return module.NewRateLimitMiddleware(name, requestsPerMinute, burstSize)
}

Expand Down
14 changes: 12 additions & 2 deletions plugins/observability/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,18 @@ func logCollectorFactory(name string, cfg map[string]any) modular.Module {
return module.NewLogCollector(name, lcCfg)
}

func otelTracingFactory(name string, _ map[string]any) modular.Module {
return module.NewOTelTracing(name)
func otelTracingFactory(name string, cfg map[string]any) modular.Module {
m := module.NewOTelTracing(name)
if cfg == nil {
return m
}
if v, ok := cfg["endpoint"].(string); ok && v != "" {
m.SetEndpoint(v)
}
if v, ok := cfg["serviceName"].(string); ok && v != "" {
m.SetServiceName(v)
}
return m
}

func openAPIGeneratorFactory(name string, cfg map[string]any) modular.Module {
Expand Down
Loading