Background
PR #77 introduced unified environment/geo/device APIs. Comment #77 (comment) identified that context.env uses the deprecated Dictionary API.
Current Implementation
src/template/fastly-adapter.js:74 creates context.env using:
context.env: new Proxy(new Dictionary('secrets'), {
get: (target, prop) => {
try {
return target.get(prop);
} catch {
// fallback to package params fetch
}
}
})
Required Changes
Replace Dictionary with modern Fastly APIs:
For secrets:
import { SecretStore } from 'fastly:secret-store';
const secrets = new SecretStore('secrets');
const value = await secrets.get('key');
const plaintext = value.plaintext();
For config:
import { ConfigStore } from 'fastly:config-store';
const config = new ConfigStore('config');
const value = config.get('key');
Implementation Notes
SecretStore.get() is async, returns object with plaintext() method
ConfigStore.get() is sync, returns string directly
- Update Proxy handler to handle async secret retrieval
- Both require resource link names matching Fastly service config
- Only available during request processing, not at build-time
References
Background
PR #77 introduced unified environment/geo/device APIs. Comment #77 (comment) identified that
context.envuses the deprecatedDictionaryAPI.Current Implementation
src/template/fastly-adapter.js:74 creates
context.envusing:Required Changes
Replace
Dictionarywith modern Fastly APIs:For secrets:
For config:
Implementation Notes
SecretStore.get()is async, returns object withplaintext()methodConfigStore.get()is sync, returns string directlyReferences