Skip to content

Test FastlyPlatformSecretStore read path and write stubs#557

Open
prk-Jr wants to merge 25 commits intomainfrom
feature/edgezero-pr4-secret-store
Open

Test FastlyPlatformSecretStore read path and write stubs#557
prk-Jr wants to merge 25 commits intomainfrom
feature/edgezero-pr4-secret-store

Conversation

@prk-Jr
Copy link
Collaborator

@prk-Jr prk-Jr commented Mar 25, 2026

Summary

  • Adds three targeted tests to FastlyPlatformSecretStore in the Fastly adapter to prove the read path and write stubs satisfy issue Secret store trait (read-only) #485's "Done when" criteria
  • Tests cover: store-open failure (maps to PlatformError::SecretStore), create() stub (PlatformError::NotImplemented), and delete() stub (PlatformError::NotImplemented)
  • No implementation code is added — all production code already existed from prior PRs; this PR is tests only

Changes

File Change
crates/trusted-server-adapter-fastly/src/platform.rs Add three tests in the existing #[cfg(test)] block

Closes

Closes #485

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • JS tests: cd crates/js/lib && npx vitest run — N/A (no JS changes)
  • JS format: cd crates/js/lib && npm run format — N/A (no JS changes)
  • Docs format: cd docs && npm run format — N/A (no docs changes)
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1 — N/A (#[cfg(test)] code is excluded from WASM binary)
  • Manual testing via fastly compute serve — N/A (tests only)

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses tracing macros (not println!)
  • New code has tests
  • No secrets or credentials committed

prk-Jr and others added 25 commits March 18, 2026 16:54
Rename crates/common → crates/trusted-server-core and crates/fastly →
crates/trusted-server-adapter-fastly following the EdgeZero naming
convention. Add EdgeZero workspace dependencies pinned to rev 170b74b.
Update all references across docs, CI workflows, scripts, agent files,
and configuration.
Introduces trusted-server-core::platform with PlatformConfigStore,
PlatformSecretStore, PlatformKvStore, PlatformBackend, PlatformHttpClient,
and PlatformGeo traits alongside ClientInfo, PlatformError, and
RuntimeServices. Wires the Fastly adapter implementations and threads
RuntimeServices into route_request. Moves GeoInfo to platform/types as
platform-neutral data and adds geo_from_fastly for field mapping.
- Defer KV store opening: replace early error return with a local
  UnavailableKvStore fallback so routes that do not need synthetic ID
  access succeed when the KV store is missing or temporarily unavailable
- Use ConfigStore::try_open + try_get and SecretStore::try_get throughout
  FastlyPlatformConfigStore and FastlyPlatformSecretStore to honour the
  Result contract instead of panicking on open/lookup failure
- Encapsulate RuntimeServices service fields as pub(crate) with public
  getter methods (config_store, secret_store, backend, http_client, geo)
  and a pub new() constructor; adapter updated to use new()
- Reference #487 in FastlyPlatformHttpClient stub (PR 6 implements it)
- Remove unused KvPage re-export from platform/mod.rs
- Use super::KvHandle shorthand in RuntimeServices::kv_handle()
- Split fastly_storage.rs into storage/{config_store,secret_store,api_client,mod}.rs
- Add PlatformConfigStore read path via FastlyPlatformConfigStore::get using ConfigStore::try_open/try_get
- Add PlatformError::NotImplemented variant; stub write methods on FastlyPlatformConfigStore and FastlyPlatformSecretStore
- Add StoreName/StoreId newtypes with From<String>, From<&str>, AsRef<str>
- Add UnavailableKvStore to core platform module
- Add RuntimeServicesBuilder replacing 7-arg constructor
- Migrate get_active_jwks and handle_trusted_server_discovery to use &RuntimeServices
- Update call sites in signing.rs, rotation.rs, main.rs
- Add success-path test for handle_trusted_server_discovery using StubJwksConfigStore
- Fix test_parse_cookies_to_jar_empty typo (was emtpy)
@prk-Jr prk-Jr self-assigned this Mar 25, 2026
@prk-Jr prk-Jr changed the title Add tests for FastlyPlatformSecretStore read path and write stubs Wire PlatformSecretStore read path in Fastly adapter Mar 25, 2026
@prk-Jr prk-Jr changed the base branch from feature/edgezero-pr3-config-store to main March 25, 2026 11:07
@prk-Jr prk-Jr changed the title Wire PlatformSecretStore read path in Fastly adapter Test FastlyPlatformSecretStore read path and write stubs Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secret store trait (read-only)

1 participant