bella-baxter/sdk
Official PHP SDK for the Bella Baxter secret management platform. Fetch environment secrets or specific versions with a simple client API. Optional end-to-end encryption (ECDH P-256 + AES-256-GCM) keeps secret values encrypted in transit end-to-end.
.env, config, or third-party vaults). It aligns well with Laravel’s dependency injection (DI) and service container patterns, enabling seamless injection of secrets into services.config:cache) or environment file loading (.env). Secrets fetched via the SDK must be manually merged into Laravel’s config system.curl extension, which is compatible with Laravel’s HttpClient facade. However, custom middleware or interceptors (e.g., for logging, retries) would require wrapping the SDK’s client.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| E2EE Performance | Medium | Benchmark cryptographic overhead in staging. Consider disabling E2EE for non-sensitive secrets. |
| Key Rotation | High | Implement a key rotation strategy (e.g., periodic regeneration of ECDH keys) and monitor for failures. |
| API Rate Limiting | Medium | Test under load; implement exponential backoff in Laravel’s HttpClient wrapper. |
| Laravel Cache Invalidation | Medium | Secrets fetched via SDK must not be cached aggressively (use short TTLs or manual invalidation). |
| Vendor Lock-in | Low | SDK is thin; migration to another vault (e.g., HashiCorp Vault) would require rewriting secret access logic. |
production, staging) or feature-flagged (e.g., per-tenant)?environmentSlug map to Laravel’s APP_ENV or custom environments?storage/ or a dedicated key management system)?.env files) or circuit breaker.// app/Providers/AppServiceProvider.php
public function register()
{
$this->app->singleton(BaxterClient::class, function ($app) {
return new BaxterClient(new BaxterClientOptions(
baxterUrl: env('BELLA_BAXTER_URL'),
clientId: env('BELLA_BAXTER_CLIENT_ID'),
clientSecret: env('BELLA_BAXTER_CLIENT_SECRET'),
environmentSlug: env('BELLA_BAXTER_ENVIRONMENT'),
enableE2ee: (bool) env('BELLA_BAXTER_E2EE', false),
));
});
}
HttpClient for retries, timeouts, and logging:
use Illuminate\Support\Facades\Http;
$client = Http::withOptions([
'headers' => [
'X-E2E-Public-Key' => $baxterClient->getPublicKey(),
],
]);
// config/baxter.php
'secrets' => [
'database_url' => null, // Will be populated at runtime
];
// In a service provider:
$secrets = $this->app->make(BaxterClient::class)->getAllSecrets();
config(['baxter.secrets' => $secrets]);
MAIL_MAILER, AWS_ACCESS_KEY).config/services.php with SDK-fetched values..env files for sensitive data.| Laravel Component | Compatibility Notes |
|---|---|
| Environment Files | .env can store BELLA_BAXTER_* credentials, but secret values should not. |
| Config Caching | Avoid caching secrets; use config:clear during deployments if secrets change. |
| Queue Workers | Secrets must be fetched per-worker (avoid sharing SDK instances). |
| Artisan Commands | Fetch secrets once per command (not per invocation). |
| Laravel Horizon | Ensure E2EE keys are regenerated per-process to avoid key leakage. |
| Laravel Vapor | Use runtime environment variables for clientId/clientSecret. |
clientId, clientSecret).APP_ENV to match Bella Baxter’s environmentSlug..env secrets with SDK-fetched values in config files or service providers..env secrets during migration.// app/Console/Commands/RegenerateE2EKeys.php
public function handle()
{
$client = app(BaxterClient::class);
$client->regenerateKeys(); // Hypothetical method; may require custom logic
}
update command cautiously; test SDK upgrades in staging.DATABASE_URL, STRIPE_SECRET_KEY) to avoid drift.How can I help you explore Laravel packages today?