2
0

docs: add comprehensive API reference documentation
All checks were successful
Build and Release / Tests (push) Successful in 1m26s
Build and Release / Lint (push) Successful in 1m59s
Build and Release / Create Release (push) Has been skipped

Creates new API.md with complete API reference including:
- Architecture and encryption model documentation
- Installation and configuration guides
- Authentication methods and API endpoints
- Go package API documentation
- Error codes and code examples
- License tier information

Also updates README.md to reference the new API documentation.
This commit is contained in:
2026-02-07 09:25:38 -05:00
parent 69f71cef7e
commit e9b109c464
2 changed files with 1803 additions and 44 deletions

1803
API.md Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -200,50 +200,6 @@ curl -X DELETE \
https://gitcaddy.example.com/api/v1/repos/owner/repo/vault/secrets/prod.database.password
```
### Lockbox API (E2E Encrypted Secrets)
Lockbox secrets require client-side encryption before upload and client-side decryption after retrieval. Use our SDKs for simplified lockbox operations.
**Create Lockbox Secret (using SDK):**
```go
// Go SDK
client := vault.NewClient("https://gitcaddy.example.com", token)
err := client.CreateLockbox(ctx, "prod.master-key", "super-secret-value", "my-passphrase")
```
```typescript
// TypeScript SDK
const client = new VaultClient('https://gitcaddy.example.com', token);
await client.createLockbox('prod.master-key', 'super-secret-value', 'my-passphrase');
```
```python
# Python SDK
client = VaultClient('https://gitcaddy.example.com', token)
client.create_lockbox('prod.master-key', 'super-secret-value', 'my-passphrase')
```
**Get Lockbox Secret:**
```go
// Go SDK
value, err := client.GetLockbox(ctx, "prod.master-key", "my-passphrase")
```
**Raw API (manual encryption):**
```bash
# The value must be pre-encrypted in lockbox:v1:... format
curl -X PUT \
-H "Authorization: Bearer $VAULT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "prod.master-key",
"value": "lockbox:v1:BASE64_SALT:BASE64_ENCRYPTED_DATA",
"encryption_mode": "lockbox",
"type": "key-value"
}' \
https://gitcaddy.example.com/api/v1/repos/owner/repo/vault/secrets/prod.master-key
```
### CI/CD Integration
**GitHub Actions / Gitea Actions:**