Konsep Dasar
Sebelum masuk SDK + API reference, mari kenalan dengan konsep kunci:
Team (Organisasi)
Team adalah unit isolasi utama di Calvery. Setiap team punya:
- Slug unik global (
acme-corp) — identifier di URL dan SDK - Secrets terisolasi — team A tidak bisa akses secrets team B
- Members dengan role berbeda
- Plan: starter (gratis) / professional / enterprise
Satu user bisa jadi anggota multiple team.
Environment
Environment = namespace di dalam team. Default:
productionstagingdevelopment
Satu nama secret bisa punya value berbeda per environment:
| Name | production | staging | development |
|---|---|---|---|
DATABASE_URL | postgres://prod-db... | postgres://staging-db... | postgres://local... |
STRIPE_KEY | sk_live_xxx | sk_test_xxx | sk_test_xxx |
SDK otomatis baca default production, bisa di-override per-call.
Role (RBAC)
Setiap member di team punya salah satu dari 4 role:
| Role | Baca secret | Buat/edit | Hapus | Audit log | Invite member |
|---|---|---|---|---|---|
| Owner | ✅ | ✅ | ✅ | ✅ | ✅ |
| Admin | ✅ | ✅ | ✅ | ✅ | ✅ |
| Member | ✅ | ✅ | ❌ | ❌ | ❌ |
| Viewer | ✅ | ❌ | ❌ | ❌ | ❌ |
Owner cuma satu — tidak bisa dihapus kecuali transfer ownership.
Access Token
Token API untuk akses programmatic — SDK, CI/CD, script.
- Format:
cvsm_+ 64 karakter random hex - Stored hashed (SHA-256) — tidak bisa dilihat ulang setelah dibuat
- Punya
name,expires_at(optional),last_used_at - Bisa di-revoke kapan saja tanpa affect secret lain
Token mewarisi permission user yang membuatnya. Kalau user di-suspend, semua token-nya otomatis invalid.
Audit Log
Setiap operasi critical di-log:
createsecretreadsecret (termasuk via SDK)updatesecretdeletesecretlogin/logoutuserinvite/jointeam
Log immutable — tidak bisa diedit, cuma retention policy yang bisa di-config (starter: 30 hari, pro: 90 hari, enterprise: unlimited).
Versioning
Setiap update secret nyimpan versi lama di tabel secret_versions. Bisa dilihat history + rollback via dashboard.
Encryption model
Secret di-encrypt sebelum masuk database dengan:
- Algoritma: AES-256-GCM
- Key: 32-byte (256-bit), disimpan di
ENCRYPTION_KEYenv var server — tidak di database - Nonce: unik 96-bit random per secret (regenerate tiap update)
Artinya:
- Bahkan kalau database di-dump, isinya sampah tanpa encryption key
- Admin CVSM tidak bisa baca secret tanpa akses ke server env
- Compromised backup tidak mengekspos secret
Self-host vs Managed
| Aspek | Managed (dash.calvery.xyz) | Self-host (Docker/K8s) |
|---|---|---|
| Setup | 2 menit (sign up) | 10-30 menit |
| Update | Otomatis | Manual git pull + rebuild |
| Backup | Kami urus | Kamu urus |
| Data residency | Singapore | Di mana saja |
| SLA | 99.9% uptime | Up to you |
| Biaya | Starter gratis, Pro Rp299K | Infra only (VPS ~Rp50K/bulan) |
Keduanya pakai codebase + SDK yang sama — migrasi cuma ganti baseUrl di SDK.