-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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 withplaintext()methodConfigStore.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
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request