Security
Divctor takes security seriously. This page explains the security features we provide and the best practices you should follow to keep your API keys and data safe.
HTTPS Encryption
All API requests are served over HTTPS (TLS 1.2 or 1.3, depending on client support). Your API keys and data are encrypted in transit and cannot be intercepted by third parties.
API Key Security
Your API key is the primary way to authenticate requests. Treat it like a password.
Best Practices
- Never expose your key in client-side code (JavaScript in the browser, mobile apps, etc.). Use a backend proxy instead.
- Store keys in environment variables (not in source code or version control).
- Rotate keys regularly (every 90 days is a good practice).
- Use separate keys for separate apps (so you can revoke one without affecting others).
- Restrict keys to specific domains (see below).
Domain Restriction
You can restrict your API key to specific domains. Requests from other domains will be rejected with a 403 DOMAIN_NOT_ALLOWED error.
To set allowed domains, go to your app details page in the Dashboard.
example.com, app.example.com
Request Signing (HMAC)
For POST requests, you can sign the request body using your signing secret and HMAC-SHA256. This ensures that the request has not been tampered with.
Include the signature in the X-Signature header as a hex string.
X-Signature: a1b2c3d4e5f6...
Rate Limiting
All API keys are subject to rate limits. Each API key can send up to 60 requests per 60 seconds. If you exceed the limit, you will receive a 429 RATE_LIMITED error.
Data Storage
All data is stored in Cloudflare D1 databases, which are distributed globally and secured with industry-standard encryption.
- API keys are stored as plain text. Note: we plan to hash them in the future. In the meantime, treat your key like a password.
- Session tokens are stored with HttpOnly and Secure cookies.
- Saved charts are stored in D1 and automatically deleted after their expiry date.
Security Checklist
- ✅ Use HTTPS for all requests.
- ✅ Store API keys in environment variables.
- ✅ Restrict keys to specific domains.
- ✅ Rotate keys regularly.
- ✅ Enable request signing (optional).
- ✅ Monitor your usage in the Dashboard.