@voxgig/sdkgen-langpack 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.sdk/model/target/dart.aon +63 -0
- package/.sdk/model/target/haskell.aon +72 -0
- package/.sdk/model/target/lean.aon +91 -0
- package/.sdk/src/cmp/dart/Config_dart.ts +248 -0
- package/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
- package/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
- package/.sdk/src/cmp/dart/EntityTypes_dart.ts +207 -0
- package/.sdk/src/cmp/dart/Entity_dart.ts +87 -0
- package/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
- package/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
- package/.sdk/src/cmp/dart/Main_dart.ts +178 -0
- package/.sdk/src/cmp/dart/Package_dart.ts +82 -0
- package/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +177 -0
- package/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
- package/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
- package/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +152 -0
- package/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
- package/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
- package/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
- package/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
- package/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +225 -0
- package/.sdk/src/cmp/dart/ReadmeRef_dart.ts +397 -0
- package/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
- package/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +106 -0
- package/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
- package/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
- package/.sdk/src/cmp/dart/TestDirect_dart.ts +516 -0
- package/.sdk/src/cmp/dart/TestEntity_dart.ts +628 -0
- package/.sdk/src/cmp/dart/Test_dart.ts +138 -0
- package/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/Config.fragment.dart +70 -0
- package/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
- package/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +29 -0
- package/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +28 -0
- package/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +302 -0
- package/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
- package/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +108 -0
- package/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/Main.fragment.dart +339 -0
- package/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +26 -0
- package/.sdk/src/cmp/dart/tsconfig.json +15 -0
- package/.sdk/src/cmp/dart/utility_dart.ts +155 -0
- package/.sdk/src/cmp/haskell/Config_haskell.ts +98 -0
- package/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
- package/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
- package/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
- package/.sdk/src/cmp/haskell/Package_haskell.ts +60 -0
- package/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +186 -0
- package/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
- package/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
- package/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
- package/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
- package/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
- package/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +162 -0
- package/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
- package/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +241 -0
- package/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +408 -0
- package/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
- package/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
- package/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
- package/.sdk/src/cmp/haskell/Test_haskell.ts +297 -0
- package/.sdk/src/cmp/haskell/tsconfig.json +15 -0
- package/.sdk/src/cmp/haskell/utility_haskell.ts +166 -0
- package/.sdk/src/cmp/lean/Config_lean.ts +93 -0
- package/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/.sdk/src/cmp/lean/Package_lean.ts +93 -0
- package/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +39 -0
- package/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/.sdk/src/cmp/lean/ReadmeRef_lean.ts +40 -0
- package/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +19 -0
- package/.sdk/src/cmp/lean/Test_lean.ts +261 -0
- package/.sdk/src/cmp/lean/utility_lean.ts +129 -0
- package/.sdk/tm/dart/LICENSE +22 -0
- package/.sdk/tm/dart/Makefile +50 -0
- package/.sdk/tm/dart/lib/Context.dart +150 -0
- package/.sdk/tm/dart/lib/Control.dart +15 -0
- package/.sdk/tm/dart/lib/Operation.dart +31 -0
- package/.sdk/tm/dart/lib/Point.dart +51 -0
- package/.sdk/tm/dart/lib/Response.dart +32 -0
- package/.sdk/tm/dart/lib/Result.dart +39 -0
- package/.sdk/tm/dart/lib/Spec.dart +49 -0
- package/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
- package/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
- package/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
- package/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
- package/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
- package/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
- package/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
- package/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
- package/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +240 -0
- package/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
- package/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
- package/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
- package/.sdk/tm/dart/lib/feature/secrets/SecretsFeature.dart +649 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/capability.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/catalog.dart +46 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/config.dart +297 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/depend.dart +198 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/env.dart +144 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/export.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/graph.dart +160 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/host.dart +1067 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/order.dart +172 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/plugin.dart +23 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/point.dart +117 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/ref.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/resolve.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/types.dart +201 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/version.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/aws.dart +285 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/azuresecrets.dart +178 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/boru.dart +145 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/crypto.dart +194 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/doppler.dart +101 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/gcpsecrets.dart +143 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/hashicorp.dart +190 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/httpjson.dart +363 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/infisical.dart +149 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/onepassword.dart +146 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/secretspec.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/sigv4.dart +237 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/addr.dart +138 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/json.dart +276 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/provider.dart +31 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/providers.dart +243 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/sekreto.dart +730 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/spec.dart +200 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/support.dart +217 -0
- package/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
- package/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
- package/.sdk/tm/dart/lib/feature/test/TestFeature.dart +328 -0
- package/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
- package/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
- package/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
- package/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
- package/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/FetcherUtility.dart +104 -0
- package/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
- package/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
- package/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +71 -0
- package/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
- package/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +233 -0
- package/.sdk/tm/dart/lib/utility/MakePointUtility.dart +130 -0
- package/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +66 -0
- package/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +59 -0
- package/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
- package/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +77 -0
- package/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
- package/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
- package/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
- package/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
- package/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +30 -0
- package/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
- package/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
- package/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
- package/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
- package/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
- package/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
- package/.sdk/tm/dart/lib/utility/Utility.dart +239 -0
- package/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2462 -0
- package/.sdk/tm/dart/src/feature/README.md +3 -0
- package/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/secrets/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/dart/test/custom_test.dart +65 -0
- package/.sdk/tm/dart/test/exists_test.dart +12 -0
- package/.sdk/tm/dart/test/feature/harness.dart +347 -0
- package/.sdk/tm/dart/test/feature/secrets/secrets_test.dart +1107 -0
- package/.sdk/tm/dart/test/feature_test.dart +1193 -0
- package/.sdk/tm/dart/test/harness.dart +153 -0
- package/.sdk/tm/dart/test/netsim_test.dart +48 -0
- package/.sdk/tm/dart/test/omni.dart +520 -0
- package/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/.sdk/tm/dart/test/pipeline_test.dart +608 -0
- package/.sdk/tm/dart/test/primary_test.dart +476 -0
- package/.sdk/tm/dart/test/sdk-test-control.json +19 -0
- package/.sdk/tm/dart/test/struct_test.dart +468 -0
- package/.sdk/tm/dart/test/utility.dart +198 -0
- package/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/.sdk/tm/haskell/LICENSE +21 -0
- package/.sdk/tm/haskell/Makefile +22 -0
- package/.sdk/tm/haskell/VERSION +1 -0
- package/.sdk/tm/haskell/src/SdkFeatures.hs +1440 -0
- package/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
- package/.sdk/tm/haskell/src/SdkJson.hs +111 -0
- package/.sdk/tm/haskell/src/SdkRuntime.hs +1279 -0
- package/.sdk/tm/haskell/src/SdkTypes.hs +195 -0
- package/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
- package/.sdk/tm/haskell/src/Vregex.hs +237 -0
- package/.sdk/tm/haskell/src/feature/README.md +5 -0
- package/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/haskell/test/Harness.hs +281 -0
- package/.sdk/tm/haskell/test/OmniResolver.hs +252 -0
- package/.sdk/tm/haskell/test/Runner.hs +49 -0
- package/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
- package/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
- package/.sdk/tm/haskell/test/TFeature.hs +794 -0
- package/.sdk/tm/haskell/test/TNetsim.hs +50 -0
- package/.sdk/tm/haskell/test/TPipeline.hs +334 -0
- package/.sdk/tm/haskell/test/TPrimaryCorpus.hs +263 -0
- package/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
- package/.sdk/tm/haskell/test/Testutil.hs +59 -0
- package/.sdk/tm/haskell/test/vendor/omni/Omni.hs +1147 -0
- package/.sdk/tm/lean/LICENSE +21 -0
- package/.sdk/tm/lean/Makefile +32 -0
- package/.sdk/tm/lean/VERSION +1 -0
- package/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/.sdk/tm/lean/src/SdkFeatures.lean +787 -0
- package/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/.sdk/tm/lean/src/SdkRuntime.lean +374 -0
- package/.sdk/tm/lean/src/SdkUtility.lean +809 -0
- package/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/.sdk/tm/lean/src/feature/README.md +5 -0
- package/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/.sdk/tm/lean/test/StructCorpus.lean +368 -0
- package/.sdk/tm/lean/test/TFeature.lean +281 -0
- package/.sdk/tm/lean/test/TPrimaryUtility.lean +227 -0
- package/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/package.json +78 -0
- package/sdkgen-package.json +22 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/src/json.dart)
|
|
2
|
+
// Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// Minimal JSON support for sekreto.
|
|
5
|
+
//
|
|
6
|
+
// `dart:convert` is part of the SDK, so the scanner itself is not
|
|
7
|
+
// hand-rolled here as it is in the ports whose standard library has none.
|
|
8
|
+
// What is written out is everything around it: a closed value model, a
|
|
9
|
+
// parse that says "this text is not JSON" without saying "this text is the
|
|
10
|
+
// literal null", a depth bound, a rejection of non-finite numbers, and a
|
|
11
|
+
// writer whose output is byte-identical to every other port's.
|
|
12
|
+
//
|
|
13
|
+
// A sealed class rather than plain `dynamic`: a vault answering `null`,
|
|
14
|
+
// `false`, `0` and "no such key" means four different things, and a closed
|
|
15
|
+
// model keeps them apart at compile time rather than by convention.
|
|
16
|
+
//
|
|
17
|
+
// A port of typescript/src/Json.ts, which is canonical.
|
|
18
|
+
|
|
19
|
+
import 'dart:convert';
|
|
20
|
+
|
|
21
|
+
/// How deep a response body may nest before it is refused. A body arrives
|
|
22
|
+
/// before any trust check has been made of what sent it, and `[[[[...`
|
|
23
|
+
/// costs nothing to write; the walk below is recursive, so the bound is
|
|
24
|
+
/// what keeps a hostile body from taking the process down with it.
|
|
25
|
+
const int MAXDEPTH = 128;
|
|
26
|
+
|
|
27
|
+
/// Thrown while converting malformed JSON; never escapes [jsonparse].
|
|
28
|
+
class _JsonError implements Exception {
|
|
29
|
+
final String message;
|
|
30
|
+
_JsonError(this.message);
|
|
31
|
+
@override
|
|
32
|
+
String toString() => message;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// A JSON value: exactly six shapes, and no seventh.
|
|
36
|
+
sealed class Json {
|
|
37
|
+
const Json();
|
|
38
|
+
|
|
39
|
+
/// The string, or nothing when this is not a string.
|
|
40
|
+
String? get asstr => null;
|
|
41
|
+
|
|
42
|
+
/// The number, or nothing when this is not a number.
|
|
43
|
+
double? get asnum => null;
|
|
44
|
+
|
|
45
|
+
/// The array, or nothing when this is not an array.
|
|
46
|
+
List<Json>? get asarr => null;
|
|
47
|
+
|
|
48
|
+
/// The object, or nothing when this is not an object.
|
|
49
|
+
Map<String, Json>? get asobj => null;
|
|
50
|
+
|
|
51
|
+
/// This value as the text a caller would print, or nothing when there is
|
|
52
|
+
/// no value at all. A JSON null is "no value": every provider here treats
|
|
53
|
+
/// it as a miss rather than as the string "null".
|
|
54
|
+
String? get text => jsonstringify(this);
|
|
55
|
+
|
|
56
|
+
/// Walk nested objects; nothing the moment a step is not there.
|
|
57
|
+
Json? dig(String key, [String? key2, String? key3]) {
|
|
58
|
+
Json? at = this;
|
|
59
|
+
|
|
60
|
+
for (final step in [key, key2, key3]) {
|
|
61
|
+
if (null == step) {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
final fields = at?.asobj;
|
|
65
|
+
at = null == fields ? null : fields[step];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return at;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class JsonNull extends Json {
|
|
73
|
+
const JsonNull();
|
|
74
|
+
@override
|
|
75
|
+
String? get text => null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
class JsonBool extends Json {
|
|
79
|
+
final bool value;
|
|
80
|
+
const JsonBool(this.value);
|
|
81
|
+
@override
|
|
82
|
+
String? get text => value ? 'true' : 'false';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
class JsonNum extends Json {
|
|
86
|
+
final double value;
|
|
87
|
+
const JsonNum(this.value);
|
|
88
|
+
@override
|
|
89
|
+
double? get asnum => value;
|
|
90
|
+
@override
|
|
91
|
+
String? get text => numstr(value);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
class JsonStr extends Json {
|
|
95
|
+
final String value;
|
|
96
|
+
const JsonStr(this.value);
|
|
97
|
+
@override
|
|
98
|
+
String? get asstr => value;
|
|
99
|
+
@override
|
|
100
|
+
String? get text => value;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
class JsonArr extends Json {
|
|
104
|
+
final List<Json> value;
|
|
105
|
+
const JsonArr(this.value);
|
|
106
|
+
@override
|
|
107
|
+
List<Json>? get asarr => value;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
class JsonObj extends Json {
|
|
111
|
+
/// Insertion-ordered: Dart map literals and `jsonDecode` both answer a
|
|
112
|
+
/// LinkedHashMap, and a payload's field order is signed.
|
|
113
|
+
final Map<String, Json> value;
|
|
114
|
+
const JsonObj(this.value);
|
|
115
|
+
@override
|
|
116
|
+
Map<String, Json>? get asobj => value;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// The same reads on a value that may not be there at all - a response body
|
|
120
|
+
/// is `Json?`, because a store may not have answered with JSON - so a
|
|
121
|
+
/// provider can walk it without unwrapping at every step.
|
|
122
|
+
extension JsonMaybe on Json? {
|
|
123
|
+
Json? dig(String key, [String? key2, String? key3]) =>
|
|
124
|
+
this?.dig(key, key2, key3);
|
|
125
|
+
String? get text => this?.text;
|
|
126
|
+
String? get asstr => this?.asstr;
|
|
127
|
+
double? get asnum => this?.asnum;
|
|
128
|
+
List<Json>? get asarr => this?.asarr;
|
|
129
|
+
Map<String, Json>? get asobj => this?.asobj;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/// Parse JSON text. Nothing for anything unreadable - which the caller must
|
|
133
|
+
/// tell apart from a literal `null` body, since only the first means the
|
|
134
|
+
/// store could not answer coherently.
|
|
135
|
+
///
|
|
136
|
+
/// `jsonDecode` drives its own explicit stack, so a deeply nested body does
|
|
137
|
+
/// not recurse until it arrives here; [_convert] is what bounds it.
|
|
138
|
+
Json? jsonparse(String? text) {
|
|
139
|
+
if (null == text || text.isEmpty) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
return _convert(jsonDecode(text), 0);
|
|
145
|
+
} catch (_) {
|
|
146
|
+
// No error escapes: "not JSON" is a value, not an exception.
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
Json _convert(Object? value, int depth) {
|
|
152
|
+
if (MAXDEPTH < depth) {
|
|
153
|
+
throw _JsonError('sekreto: json: too deeply nested');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (null == value) {
|
|
157
|
+
return const JsonNull();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (value is bool) {
|
|
161
|
+
return JsonBool(value);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (value is num) {
|
|
165
|
+
final asdouble = value.toDouble();
|
|
166
|
+
// JSON has no infinity, and `1e999` decodes to one. Left alone it
|
|
167
|
+
// reaches a token-expiry computation as a number that is not a number.
|
|
168
|
+
if (asdouble.isNaN || asdouble.isInfinite) {
|
|
169
|
+
throw _JsonError('sekreto: json: number is not finite');
|
|
170
|
+
}
|
|
171
|
+
return JsonNum(asdouble);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (value is String) {
|
|
175
|
+
return JsonStr(value);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (value is List) {
|
|
179
|
+
return JsonArr(
|
|
180
|
+
value.map<Json>((entry) => _convert(entry, depth + 1)).toList(),
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (value is Map) {
|
|
185
|
+
final out = <String, Json>{};
|
|
186
|
+
value.forEach((key, entry) => out['$key'] = _convert(entry, depth + 1));
|
|
187
|
+
return JsonObj(out);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
throw _JsonError('sekreto: json: unreadable value');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/// Render a value as compact JSON: no spaces, no newlines.
|
|
194
|
+
String jsonstringify(Json value) {
|
|
195
|
+
final out = StringBuffer();
|
|
196
|
+
_write(value, out);
|
|
197
|
+
return out.toString();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
void _write(Json value, StringBuffer out) {
|
|
201
|
+
switch (value) {
|
|
202
|
+
case JsonNull():
|
|
203
|
+
out.write('null');
|
|
204
|
+
case JsonBool(value: final entry):
|
|
205
|
+
out.write(entry ? 'true' : 'false');
|
|
206
|
+
case JsonNum(value: final entry):
|
|
207
|
+
out.write(numstr(entry));
|
|
208
|
+
case JsonStr(value: final entry):
|
|
209
|
+
out.write(jsonquote(entry));
|
|
210
|
+
case JsonArr(value: final entries):
|
|
211
|
+
out.write('[');
|
|
212
|
+
for (var at = 0; at < entries.length; at++) {
|
|
213
|
+
if (0 < at) {
|
|
214
|
+
out.write(',');
|
|
215
|
+
}
|
|
216
|
+
_write(entries[at], out);
|
|
217
|
+
}
|
|
218
|
+
out.write(']');
|
|
219
|
+
case JsonObj(value: final entries):
|
|
220
|
+
out.write('{');
|
|
221
|
+
var first = true;
|
|
222
|
+
entries.forEach((key, entry) {
|
|
223
|
+
if (!first) {
|
|
224
|
+
out.write(',');
|
|
225
|
+
}
|
|
226
|
+
first = false;
|
|
227
|
+
out.write(jsonquote(key));
|
|
228
|
+
out.write(':');
|
|
229
|
+
_write(entry, out);
|
|
230
|
+
});
|
|
231
|
+
out.write('}');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/// Render a string as a JSON string literal, quotes included. Public
|
|
236
|
+
/// because the CLI assembles its one line of output field by field.
|
|
237
|
+
String jsonquote(String text) {
|
|
238
|
+
final out = StringBuffer('"');
|
|
239
|
+
|
|
240
|
+
for (final unit in text.codeUnits) {
|
|
241
|
+
if (0x22 == unit) {
|
|
242
|
+
out.write(r'\"');
|
|
243
|
+
} else if (0x5c == unit) {
|
|
244
|
+
out.write(r'\\');
|
|
245
|
+
} else if (0x0a == unit) {
|
|
246
|
+
out.write(r'\n');
|
|
247
|
+
} else if (0x0d == unit) {
|
|
248
|
+
out.write(r'\r');
|
|
249
|
+
} else if (0x09 == unit) {
|
|
250
|
+
out.write(r'\t');
|
|
251
|
+
} else if (0x20 > unit) {
|
|
252
|
+
out.write('\\u${unit.toRadixString(16).padLeft(4, '0')}');
|
|
253
|
+
} else {
|
|
254
|
+
out.writeCharCode(unit);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
out.write('"');
|
|
259
|
+
return out.toString();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// Render a number the way every other port does: a whole number has no
|
|
263
|
+
/// fractional tail, so a JSON `1` read back and printed stays `1`. Dart
|
|
264
|
+
/// prints an integral double as `1.0`, which would diverge from every other
|
|
265
|
+
/// port's output and from the shared spec.
|
|
266
|
+
String numstr(double value) {
|
|
267
|
+
if (value.isNaN || value.isInfinite) {
|
|
268
|
+
return 'null';
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (value == value.truncateToDouble() && 9007199254740992.0 > value.abs()) {
|
|
272
|
+
return value.toInt().toString();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return value.toString();
|
|
276
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/src/provider.dart)
|
|
2
|
+
// Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// A source of secrets.
|
|
5
|
+
//
|
|
6
|
+
// A provider answers one question: "do you have this secret?" It returns
|
|
7
|
+
// the value, or null to mean "ask the next one". Nothing else about a
|
|
8
|
+
// provider is visible to the caller - which is the point: an app reads
|
|
9
|
+
// `api.token` and never learns whether it came from the environment, a
|
|
10
|
+
// .env file, HashiCorp Vault or a boru vault.
|
|
11
|
+
|
|
12
|
+
import 'dart:async';
|
|
13
|
+
|
|
14
|
+
abstract class Provider {
|
|
15
|
+
/// The value, or null if this provider does not have it.
|
|
16
|
+
///
|
|
17
|
+
/// `FutureOr` rather than `Future`, and the distinction is load-bearing.
|
|
18
|
+
/// A provider that reads the environment, a file or a child process
|
|
19
|
+
/// answers without yielding, and so does the chain that holds it: the
|
|
20
|
+
/// whole read completes synchronously, which is what lets a caller who
|
|
21
|
+
/// only ever configures local stores - the conformance suite among them -
|
|
22
|
+
/// use the result directly. A provider that opens a socket answers with a
|
|
23
|
+
/// Future, and the chain returns one in turn.
|
|
24
|
+
///
|
|
25
|
+
/// Whichever it is, `await` reads it. A caller writes `await get(...)`
|
|
26
|
+
/// once and does not care which providers are in the chain.
|
|
27
|
+
FutureOr<String?> lookup(String name);
|
|
28
|
+
|
|
29
|
+
/// A short description, shown by `Sekreto.sources()`.
|
|
30
|
+
String describe();
|
|
31
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/src/providers.dart)
|
|
2
|
+
// Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// THE BUILT-IN PROVIDER KINDS - the same four in every port.
|
|
5
|
+
//
|
|
6
|
+
// A provider answers one question: "do you have this secret?" It returns
|
|
7
|
+
// the value, or null to mean "ask the next one". Nothing else about a
|
|
8
|
+
// provider is visible to the caller - which is the point: an app reads
|
|
9
|
+
// `api.token` and never learns whether it came from the environment, a
|
|
10
|
+
// .env file or a mounted secret directory.
|
|
11
|
+
//
|
|
12
|
+
// What makes a kind built in is that it reads AT MOST A LOCAL FILE: no
|
|
13
|
+
// socket, no TLS, no crypto, no child process. These four are the floor
|
|
14
|
+
// every chain stands on, and a chain that reads secrets from options, the
|
|
15
|
+
// environment, a plaintext `.env` and a mounted secret directory works with
|
|
16
|
+
// no plugin loaded at all. Everything else - the vault clients, the cloud
|
|
17
|
+
// stores, the two CLIs, and `sigv4` with them - is a voxgig/plugin
|
|
18
|
+
// definition under `plugins/`, and this file is the reason the core imports
|
|
19
|
+
// none of it (docs/design/plugin-providers.md).
|
|
20
|
+
//
|
|
21
|
+
// Two failure shapes, and they are never interchangeable. A store that does
|
|
22
|
+
// not hold the secret is a MISS (null) - the chain carries on. A store that
|
|
23
|
+
// could not answer - bad credentials, unreachable host, missing
|
|
24
|
+
// configuration - is an ERROR: falling through there would quietly reach
|
|
25
|
+
// for a weaker store.
|
|
26
|
+
//
|
|
27
|
+
// A port of typescript/src/provider/, which is canonical.
|
|
28
|
+
|
|
29
|
+
import 'dart:io';
|
|
30
|
+
|
|
31
|
+
import 'provider.dart';
|
|
32
|
+
import 'sekreto.dart';
|
|
33
|
+
import 'support.dart';
|
|
34
|
+
|
|
35
|
+
/// An environment variable, or null.
|
|
36
|
+
String? getenv(String name) => Platform.environment[name];
|
|
37
|
+
|
|
38
|
+
/// What a failure has to say for itself, never the empty string.
|
|
39
|
+
String why(Object err) {
|
|
40
|
+
if (err is FileSystemException) {
|
|
41
|
+
final os = err.osError;
|
|
42
|
+
return null != os ? os.message : err.message;
|
|
43
|
+
}
|
|
44
|
+
if (err is SocketException) {
|
|
45
|
+
final os = err.osError;
|
|
46
|
+
return null != os ? os.message : err.message;
|
|
47
|
+
}
|
|
48
|
+
final text = '$err';
|
|
49
|
+
return text.isEmpty ? '$err.runtimeType' : text;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// The two errno values that mean "no secrets here" rather than "I could not
|
|
53
|
+
// answer". A path that is not there, and a path whose parent is a plain
|
|
54
|
+
// file, are both absence; permission denied (EACCES) and "is a directory"
|
|
55
|
+
// (EISDIR) are not, and must raise rather than fall through to a weaker
|
|
56
|
+
// store.
|
|
57
|
+
const int _ENOENT = 2;
|
|
58
|
+
const int _ENOTDIR = 20;
|
|
59
|
+
|
|
60
|
+
bool absent(FileSystemException err) {
|
|
61
|
+
final code = err.osError?.errorCode;
|
|
62
|
+
return _ENOENT == code || _ENOTDIR == code;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// `<dir>/<name>`, with an empty dir meaning the working directory.
|
|
66
|
+
String joinpath(String dir, String name) {
|
|
67
|
+
if (dir.isEmpty) {
|
|
68
|
+
return name;
|
|
69
|
+
}
|
|
70
|
+
return dir.endsWith('/') ? '$dir$name' : '$dir/$name';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ------------------------------------------------------------ the kinds
|
|
74
|
+
|
|
75
|
+
/// Environment variables: `api.token` from `API_TOKEN`.
|
|
76
|
+
class Env extends Provider {
|
|
77
|
+
final String? prefix;
|
|
78
|
+
|
|
79
|
+
/// An injected environment, for tests. The spec never passes one.
|
|
80
|
+
final Map<String, String>? source;
|
|
81
|
+
|
|
82
|
+
Env({this.prefix, this.source});
|
|
83
|
+
|
|
84
|
+
@override
|
|
85
|
+
String? lookup(String name) {
|
|
86
|
+
final key = envkey(name, prefix);
|
|
87
|
+
return null == source ? getenv(key) : source![key];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@override
|
|
91
|
+
String describe() =>
|
|
92
|
+
'env${(null != prefix && prefix!.isNotEmpty) ? ':$prefix' : ''}';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// A `.env` file, read once, keyed exactly like the environment.
|
|
96
|
+
class Dotenv extends Provider {
|
|
97
|
+
final String file;
|
|
98
|
+
final String? prefix;
|
|
99
|
+
|
|
100
|
+
// Read LAZILY, on the first lookup. An eager read would open whatever
|
|
101
|
+
// `.env` happens to sit in the working directory just because a dotenv
|
|
102
|
+
// provider is in a chain that is never read from.
|
|
103
|
+
Map<String, String>? _values;
|
|
104
|
+
|
|
105
|
+
Dotenv(this.file, {this.prefix});
|
|
106
|
+
|
|
107
|
+
Map<String, String> _load() {
|
|
108
|
+
final loaded = _values;
|
|
109
|
+
if (null != loaded) {
|
|
110
|
+
return loaded;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
Map<String, String> values;
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
values = parsedotenv(File(file).readAsStringSync());
|
|
117
|
+
} on FileSystemException catch (err) {
|
|
118
|
+
// An absent file - or an absent directory - means "no secrets here",
|
|
119
|
+
// exactly like the file provider. Anything else (permission denied, an
|
|
120
|
+
// unreadable mount) is a store that could not answer.
|
|
121
|
+
if (!absent(err)) {
|
|
122
|
+
throw SekretoError(
|
|
123
|
+
'sekreto: dotenv provider cannot read $file: ${why(err)}',
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
values = <String, String>{};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
_values = values;
|
|
130
|
+
return values;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@override
|
|
134
|
+
String? lookup(String name) => _load()[envkey(name, prefix)];
|
|
135
|
+
|
|
136
|
+
@override
|
|
137
|
+
String describe() => 'dotenv:$file';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// Literal values, keyed like environment variables. The spec uses this to
|
|
141
|
+
/// test chain behaviour without touching the outside world.
|
|
142
|
+
class Memory extends Provider {
|
|
143
|
+
final Map<String, String> values;
|
|
144
|
+
final String? prefix;
|
|
145
|
+
|
|
146
|
+
Memory({Map<String, String>? source, this.prefix})
|
|
147
|
+
: values = source ?? const {};
|
|
148
|
+
|
|
149
|
+
@override
|
|
150
|
+
String? lookup(String name) => values[envkey(name, prefix)];
|
|
151
|
+
|
|
152
|
+
@override
|
|
153
|
+
String describe() =>
|
|
154
|
+
'memory${(null != prefix && prefix!.isNotEmpty) ? ':$prefix' : ''}';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/// A directory of one-secret-per-file entries, keyed like the environment:
|
|
158
|
+
/// `api.token` reads `<dir>/API_TOKEN`.
|
|
159
|
+
///
|
|
160
|
+
/// This is the shape of a mounted Kubernetes Secret, a Docker or Swarm
|
|
161
|
+
/// secret, and a systemd credentials directory, so those all work with no
|
|
162
|
+
/// further configuration. Read on every lookup and never cached: a mounted
|
|
163
|
+
/// secret is rotated underneath a running process.
|
|
164
|
+
///
|
|
165
|
+
/// One trailing newline is stripped - tools that write these files disagree
|
|
166
|
+
/// about it, and a newline is never part of a secret on purpose.
|
|
167
|
+
class SecretFile extends Provider {
|
|
168
|
+
final String dir;
|
|
169
|
+
final String? prefix;
|
|
170
|
+
|
|
171
|
+
SecretFile(this.dir, {this.prefix});
|
|
172
|
+
|
|
173
|
+
@override
|
|
174
|
+
String? lookup(String name) {
|
|
175
|
+
final path = joinpath(dir, envkey(name, prefix));
|
|
176
|
+
|
|
177
|
+
final String body;
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
body = File(path).readAsStringSync();
|
|
181
|
+
} on FileSystemException catch (err) {
|
|
182
|
+
if (absent(err)) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
throw SekretoError(
|
|
186
|
+
'sekreto: file provider cannot read $path: ${why(err)}',
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (body.endsWith('\r\n')) {
|
|
191
|
+
return body.substring(0, body.length - 2);
|
|
192
|
+
}
|
|
193
|
+
if (body.endsWith('\n')) {
|
|
194
|
+
return body.substring(0, body.length - 1);
|
|
195
|
+
}
|
|
196
|
+
return body;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@override
|
|
200
|
+
String describe() => 'file:$dir';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ------------------------------------------------------- the definitions
|
|
204
|
+
|
|
205
|
+
/// The four built-in kinds, as voxgig/plugin definitions - made by exactly
|
|
206
|
+
/// the same helper as every plugin kind and every custom one.
|
|
207
|
+
///
|
|
208
|
+
/// `Sekreto` puts these into its catalog first, then whatever `plugins`
|
|
209
|
+
/// handed in, so a plugin naming a built-in kind replaces it: a host
|
|
210
|
+
/// substituting an implementation, never an accident, because these four
|
|
211
|
+
/// names are documented.
|
|
212
|
+
final List<Definition> BUILTINS = [
|
|
213
|
+
providerplugin('env', (spec) => Env(prefix: spec.prefix)),
|
|
214
|
+
providerplugin(
|
|
215
|
+
'memory', (spec) => Memory(source: spec.values, prefix: spec.prefix)),
|
|
216
|
+
providerplugin(
|
|
217
|
+
'dotenv', (spec) => Dotenv(spec.file ?? '.env', prefix: spec.prefix)),
|
|
218
|
+
providerplugin(
|
|
219
|
+
'file', (spec) => SecretFile(spec.dir ?? '', prefix: spec.prefix)),
|
|
220
|
+
];
|
|
221
|
+
|
|
222
|
+
/// Every kind this library ships, built in or as a plugin, so that a kind
|
|
223
|
+
/// sekreto has never heard of can be told from one that exists as a plugin
|
|
224
|
+
/// and was not passed in.
|
|
225
|
+
///
|
|
226
|
+
/// Ten strings, not ten imports: the core knows the plugin NAMES without
|
|
227
|
+
/// reaching a single plugin file.
|
|
228
|
+
class KINDS {
|
|
229
|
+
static const List<String> builtin = ['env', 'memory', 'dotenv', 'file'];
|
|
230
|
+
|
|
231
|
+
static const List<String> plugin = [
|
|
232
|
+
'hashicorp',
|
|
233
|
+
'boru',
|
|
234
|
+
'awssecrets',
|
|
235
|
+
'awsparams',
|
|
236
|
+
'gcpsecrets',
|
|
237
|
+
'azuresecrets',
|
|
238
|
+
'onepassword',
|
|
239
|
+
'doppler',
|
|
240
|
+
'infisical',
|
|
241
|
+
'secretspec',
|
|
242
|
+
];
|
|
243
|
+
}
|