Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add Secret Store Support

Aperta
#50 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend, security

Direzione di ricerca

Inizia con i bindings WIT in stubs/wit_world/imports/secret_store.py e confronta le API SecretStore e Secret richieste con il comportamento documentato di Fastly Secret Store. Aggiungi la coverage di Viceroy usando @on_viceroy e dati secret-store inline in test.toml. Il lavoro è completato quando sono coperti i wrapper delle risorse, l’accesso simile a un dict, i metodi per il testo in chiaro e le rappresentazioni stringa che non espongono segreti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 SecretStore resource wrapper
  • Implement Secret resource with plaintext() and plaintext_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() with get() (panics), try_get() (fallible), contains(). Secret has plaintext() returning Bytes with lazy decryption/caching. Warns against bringing secrets into memory unnecessarily.

  • Go: Open() returns *Store, Get() returns *Secret. Plaintext() decrypts to []byte. Includes SecretFromBytes() for non-store secrets and convenience Plaintext(storeName, secretName) one-liner.

  • JS: new SecretStore(name), async get() returns SecretStoreEntry | null. Entry has plaintext() (UTF-8 string) and rawBytes() (Uint8Array). Static fromBytes() 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() returning bytes, optional plaintext_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

Lingua principale
Python
Stelle
5
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fastly/compute-sdk-python

Tutte le issue di fastly/compute-sdk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.