Reference
Configuration Reference
All CoreSDK configuration options.
Configuration Reference
Config file
coresdk.toml is the primary configuration file, read at sidecar startup.
[sdk]
sidecar_addr = "[::1]:50051"
tenant_id = "acme-corp"
service_name = "my-api"
fail_mode = "open"
dev_mode = false
[observability]
service_version = "0.1.0"
otel_endpoint = ""Environment variables
Environment variables override coresdk.toml values. See the Environment Variables reference for the full list.
| Variable | Description |
|---|---|
CORESDK_SIDECAR_ADDR | gRPC address of the sidecar daemon (e.g. [::1]:50051) |
CORESDK_TENANT_ID | Tenant ID for this service instance |
CORESDK_SERVICE_NAME | Value of the service.name OTel resource attribute |
CORESDK_FAIL_MODE | open (default) or closed |
CORESDK_JWKS_URL | HTTPS URL of the JWKS endpoint |
CORESDK_POLICY_DIR | Directory of .rego policy files |
CORESDK_LOG_LEVEL | trace | debug | info | warn | error |
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP gRPC endpoint for traces and metrics |
SDK initialisation
Python
from coresdk import CoreSDKClient, SDKConfig
# Explicit config
sdk = CoreSDKClient(SDKConfig(
sidecar_addr="[::1]:50051",
tenant_id="acme-corp",
service_name="my-api",
fail_mode="open",
))
# From environment variables (CORESDK_*)
sdk = CoreSDKClient(SDKConfig.from_env())Rust
use coresdk_engine::{Engine, EngineConfig};
let engine = Engine::from_env()?;Middleware
Python — FastAPI
from coresdk.middleware.fastapi import CoreSDKMiddleware
app.add_middleware(CoreSDKMiddleware, sdk=sdk)Python — Flask
from coresdk.middleware.flask import CoreSDKFlask
CoreSDKFlask(app, sdk=sdk)Go, TypeScript, Java SDKs
Go, TypeScript, and Java SDKs ship in Phase 2. Configuration for those languages will be documented when the SDKs are available.