Services
Secrets
v1.0.0Default SecretsInterface implementation. Uses AES-256-GCM encryption with a site-specific key derived from WordPress salts.
Methods
public function get(string $key): ?stringDecrypt and return a stored secret. Returns null if not found.
public function set(string $key, string $value): voidEncrypt with AES-256-GCM and store.
Example
secrets.php
// Encryption is transparent:
$this->secrets->set('webhook_secret', 'whsec_...');
$secret = $this->secrets->get('webhook_secret');