feat: Adds vault client

This commit is contained in:
2024-12-15 17:27:28 -05:00
parent 6d0108da0c
commit 601869d457
7 changed files with 344 additions and 25 deletions

View File

@@ -59,6 +59,16 @@ extension ConfigurationClient: DependencyKey {
public static var liveValue: Self {
.live(environment: ProcessInfo.processInfo.environment)
}
@_spi(Internal)
public static func mock(_ configuration: Configuration = .mock) -> Self {
.init(
find: { throw MockFindError() },
generate: Self().generate,
load: { _ in configuration },
write: Self().write
)
}
}
struct LiveConfigurationClient {
@@ -229,3 +239,5 @@ enum ConfigurationError: Error {
case decodingError
case fileExists(path: String)
}
struct MockFindError: Error {}