Unwrap secret store options at call sites

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
Cursor AgentandJulius Marminge committed 2026-06-02 16:09:19 +00:00
1 parent 8e7cf43e19
commit 0f9d858efb
2 files changed
+8 -3

No files matched your search

@@ -208,8 +208,9 @@ it.layer(NodeServices.layer)("ServerSecretStoreLive", (it) => {
const persisted = yield* secretStore.get("session-signing-key");
assert.isTrue(Option.isSome(persisted));
assert.deepEqual(Array.from(first), Array.from(persisted.value));
assert.deepEqual(Array.from(second), Array.from(persisted.value));
const persistedBytes = Option.getOrThrow(persisted);
assert.deepEqual(Array.from(first), Array.from(persistedBytes));
assert.deepEqual(Array.from(second), Array.from(persistedBytes));
}).pipe(Effect.provide(makeConcurrentCreateSecretStoreLayer())),
);
+5 -1
View File
@@ -31,6 +31,7 @@ import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as FileSystem from "effect/FileSystem";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Path from "effect/Path";
import * as Equal from "effect/Equal";
import * as PubSub from "effect/PubSub";
@@ -349,7 +350,10 @@ const makeServerSettings = Effect.gen(function* () {
);
environment.push({
...variable,
value: secret ? textDecoder.decode(secret) : "",
value: Option.match(secret, {
onSome: (bytes) => textDecoder.decode(bytes),
onNone: () => "",
}),
});
}
providerInstances[instanceId] = {