Unwrap secret store options at call sites
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
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())),
|
||||
);
|
||||
|
||||
|
||||
@@ -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] = {
|
||||
|
||||
Reference in new issue
Block a user