Add Secret Store Support
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the WIT bindings in stubs/wit_world/imports/secret_store.py and compare the requested SecretStore and Secret APIs with the documented Fastly Secret Store behavior. Add Viceroy coverage using @on_viceroy and inline test.toml secret-store data. Done means the resource wrappers, dict-like access, plaintext methods, and non-leaking string representations are covered.
Written by the indexing model from the issue text.
Description
Overview
Add support for Fastly's Secret Store, providing secure access to sensitive credentials and secrets at the edge.
WIT Interface
interface secret-store {
resource secret {
from-bytes: static func(bytes: list<u8>) -> result<secret, error>;
plaintext: func(max-len: u64) -> result<list<u8>, error>;
}
resource store {
open: static func(name: string) -> result<store, open-error>;
get: func(key: string) -> result<option<secret>, error>;
}
}
WIT bindings: stubs/wit_world/imports/secret_store.py
API Design
- Implement
SecretStoreresource wrapper - Implement
Secretresource withplaintext()andplaintext_str()methods - Override
__str__and__repr__to return"<Secret>"to prevent accidental exposure in logs - Provide dict-like interface:
__getitem__,__contains__ from_bytes()available but discouraged (for API compatibility when secrets come from non-store sources)
Cross-SDK Comparison:
-
Rust:
SecretStore::open()withget()(panics),try_get()(fallible),contains().Secrethasplaintext()returningByteswith lazy decryption/caching. Warns against bringing secrets into memory unnecessarily. -
Go:
Open()returns*Store,Get()returns*Secret.Plaintext()decrypts to[]byte. IncludesSecretFromBytes()for non-store secrets and conveniencePlaintext(storeName, secretName)one-liner. -
JS:
new SecretStore(name), asyncget()returnsSecretStoreEntry | null. Entry hasplaintext()(UTF-8 string) andrawBytes()(Uint8Array). StaticfromBytes()for creating entry from raw data.
Recommended Python approach:
- Dict-like access:
store[key]raises if not found,store.get(key, default=None)returns None if missing - Secret object with lazy
plaintext()returningbytes, optionalplaintext_str()for UTF-8 text - Consider context manager for secrets to encourage memory cleanup
- Security warnings in docstrings about keeping secrets in memory
Viceroy Testing
Viceroy supports Secret Store with inline or file-based test data via test.toml:
[local_server]
# Inline secrets
secret_stores.my_secrets = [
{key = "api_key", data = "secret-value-123"},
{key = "cert", file = "path/to/cert.pem"},
{key = "from_env", env = "MY_ENV_VAR"}
]
# Or JSON file format
secret_stores.json_secrets = { file = "data/secrets.json", format = "json" }
Secrets can be provided inline, from files, or from environment variables. Tests can use @on_viceroy with inline TOML configuration.
Reference
- Dominant language
- Python
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fastly/compute-sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fastly/compute-sdk-python#116 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fastly/compute-sdk-python#98 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fastly/compute-sdk-python#74 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fastly/compute-sdk-python#61 ·
-
fastly/compute-sdk-python#60 · 1 assignee ·
All issues in fastly/compute-sdk-python
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·