@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,145 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/boru.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 boru vault, as a voxgig/plugin definition.
|
|
5
|
+
//
|
|
6
|
+
// A PLUGIN, not a built-in: it spawns a child process, or opens a socket.
|
|
7
|
+
// A `Sekreto` can build the `boru` kind only if the calling project
|
|
8
|
+
// imported this file and passed `boru` in the `plugins` option
|
|
9
|
+
// (docs/design/plugin-providers.md).
|
|
10
|
+
//
|
|
11
|
+
// A port of typescript/plugins/boru.ts, which is canonical.
|
|
12
|
+
|
|
13
|
+
import 'dart:async';
|
|
14
|
+
|
|
15
|
+
import '../src/addr.dart';
|
|
16
|
+
import '../src/json.dart';
|
|
17
|
+
import '../src/provider.dart';
|
|
18
|
+
import '../src/sekreto.dart';
|
|
19
|
+
import '../src/support.dart';
|
|
20
|
+
|
|
21
|
+
import 'httpjson.dart';
|
|
22
|
+
|
|
23
|
+
/// Does this boru failure mean "no such secret" rather than "I could not
|
|
24
|
+
/// answer"? Matched on boru's own wording for a missing alias.
|
|
25
|
+
bool borumiss(String reason) => reason.contains('no alias named');
|
|
26
|
+
|
|
27
|
+
/// A boru vault (https://github.com/boru-lang/boru).
|
|
28
|
+
///
|
|
29
|
+
/// Two ways in, both boru's own.
|
|
30
|
+
///
|
|
31
|
+
/// With no `addr`, the CLI: `boru vault get --reveal <alias>` prints the
|
|
32
|
+
/// secret on stdout and nothing else. The passphrase is read by boru itself
|
|
33
|
+
/// from `BORU_VAULT_PASSPHRASE`; sekreto never accepts it as config and
|
|
34
|
+
/// never puts it on a command line, where it would show up in the process
|
|
35
|
+
/// table.
|
|
36
|
+
///
|
|
37
|
+
/// With an `addr`, boru's wire protocol: `boru vault serve` publishes a
|
|
38
|
+
/// read-only, HashiCorp-shaped provision API, authenticated by a capability
|
|
39
|
+
/// token from `boru vault grant`. A sekreto name is already a valid boru
|
|
40
|
+
/// alias, and boru aliases keep their dots, so `api.token` is the single
|
|
41
|
+
/// path segment `api.token` - not the `api`/`token` split a HashiCorp KV
|
|
42
|
+
/// gets. The value is the `value` field. A 404 is a miss; anything else the
|
|
43
|
+
/// server refuses (a revoked capability, a sealed vault) is an error.
|
|
44
|
+
class Boru extends Provider {
|
|
45
|
+
final String command;
|
|
46
|
+
final String? namespace;
|
|
47
|
+
final String? home;
|
|
48
|
+
final String addr;
|
|
49
|
+
final String token;
|
|
50
|
+
final String mount;
|
|
51
|
+
|
|
52
|
+
Boru({
|
|
53
|
+
String? command,
|
|
54
|
+
this.namespace,
|
|
55
|
+
this.home,
|
|
56
|
+
String? addr,
|
|
57
|
+
String? token,
|
|
58
|
+
String? mount,
|
|
59
|
+
}) : command = (null == command || command.isEmpty) ? 'boru' : command,
|
|
60
|
+
addr = null == addr ? '' : trimslash(addr),
|
|
61
|
+
token = token ?? '',
|
|
62
|
+
mount = (null == mount || mount.isEmpty) ? 'secret' : mount;
|
|
63
|
+
|
|
64
|
+
@override
|
|
65
|
+
FutureOr<String?> lookup(String name) {
|
|
66
|
+
checkname(name);
|
|
67
|
+
|
|
68
|
+
if (addr.isNotEmpty) {
|
|
69
|
+
checkaddr(addr);
|
|
70
|
+
return _wire(name);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
final space = namespace;
|
|
74
|
+
final alias =
|
|
75
|
+
(null != space && space.isNotEmpty) ? '$space:$name' : name;
|
|
76
|
+
|
|
77
|
+
final ran = runcmd(
|
|
78
|
+
[command, 'vault', 'get', '--reveal', alias],
|
|
79
|
+
command,
|
|
80
|
+
// Merged over the parent environment, not replacing it: boru needs
|
|
81
|
+
// the rest of it, BORU_VAULT_PASSPHRASE included.
|
|
82
|
+
extraenv: (null != home && home!.isNotEmpty)
|
|
83
|
+
? {'BORU_HOME': home!}
|
|
84
|
+
: null,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
if (0 == ran.status) {
|
|
88
|
+
// boru prints the value and one newline, and nothing else.
|
|
89
|
+
return dropsuffix(ran.out, '\n');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// "no alias named" is boru saying it does not hold this secret, which is
|
|
93
|
+
// a miss: the chain carries on to the next provider. A locked vault or a
|
|
94
|
+
// wrong passphrase is not a miss - treating it as one would fall through
|
|
95
|
+
// to a weaker store without saying so.
|
|
96
|
+
if (borumiss(ran.why)) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
throw SekretoError(
|
|
101
|
+
'sekreto: boru vault error: '
|
|
102
|
+
'${ran.why.isEmpty ? 'exit ${ran.status}' : ran.why}',
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Future<String?> _wire(String name) async {
|
|
107
|
+
// The dotted name stays one path segment: boru aliases keep dots.
|
|
108
|
+
final space = namespace;
|
|
109
|
+
final alias =
|
|
110
|
+
(null != space && space.isNotEmpty) ? '$space/$name' : name;
|
|
111
|
+
final url = '$addr/v1/$mount/data/$alias';
|
|
112
|
+
|
|
113
|
+
final res = await fetchjson('GET', url, headers: {'X-Vault-Token': token});
|
|
114
|
+
|
|
115
|
+
if (404 == res.status) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
if (200 != res.status) {
|
|
119
|
+
throw SekretoError('sekreto: boru serve error: ${res.status}: $url');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return res.body.dig('data', 'data', 'value').text;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@override
|
|
126
|
+
String describe() {
|
|
127
|
+
if (addr.isNotEmpty) {
|
|
128
|
+
return 'boru:$addr';
|
|
129
|
+
}
|
|
130
|
+
return 'boru${(null != namespace && namespace!.isNotEmpty) ? ':$namespace' : ''}';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/// The `boru` provider kind. Pass it in `plugins` to name it in a chain.
|
|
135
|
+
final Definition boru = providerplugin(
|
|
136
|
+
'boru',
|
|
137
|
+
(spec) => Boru(
|
|
138
|
+
command: spec.command,
|
|
139
|
+
namespace: spec.namespace,
|
|
140
|
+
home: spec.home,
|
|
141
|
+
addr: spec.addr,
|
|
142
|
+
token: spec.token,
|
|
143
|
+
mount: spec.mount,
|
|
144
|
+
),
|
|
145
|
+
);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/crypto.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
|
+
// SHA-256 and HMAC-SHA256, hand-rolled.
|
|
5
|
+
//
|
|
6
|
+
// UNDER `plugins/`, WITH THE AWS PLUGIN, because the core of no port
|
|
7
|
+
// imports a hash function: `sigv4` is the aws plugin's own business and
|
|
8
|
+
// this is what it is built from. A chain of the four built-in kinds never
|
|
9
|
+
// compiles a round of SHA-256.
|
|
10
|
+
//
|
|
11
|
+
// dart:io has no cryptography and package:crypto is a third-party package,
|
|
12
|
+
// so the two primitives AWS request signing is built from are written out
|
|
13
|
+
// here. Both are small, published and completely specified: SHA-256 is FIPS
|
|
14
|
+
// 180-4 and HMAC is RFC 2104.
|
|
15
|
+
//
|
|
16
|
+
// Correctness is not asserted by unit tests of the digests themselves. A
|
|
17
|
+
// SigV4 signature is a chain of these two primitives over a canonical
|
|
18
|
+
// request, so one wrong bit anywhere fails the five known-answer vectors in
|
|
19
|
+
// the shared spec - including AWS's own published `get-vanilla` case.
|
|
20
|
+
//
|
|
21
|
+
// A port of rust/src/crypto.rs, which is the reference hand-rolled pair.
|
|
22
|
+
|
|
23
|
+
import 'dart:convert';
|
|
24
|
+
import 'dart:typed_data';
|
|
25
|
+
|
|
26
|
+
/// The 64 round constants: the first 32 bits of the fractional parts of the
|
|
27
|
+
/// cube roots of the first 64 primes.
|
|
28
|
+
const List<int> _K = [
|
|
29
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
|
30
|
+
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
31
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
|
32
|
+
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
33
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
|
|
34
|
+
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
35
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
|
|
36
|
+
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
37
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
|
38
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
39
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
|
|
40
|
+
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
41
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
|
|
42
|
+
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
43
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
|
44
|
+
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/// The eight initial hash words: the fractional parts of the square roots of
|
|
48
|
+
/// the first eight primes.
|
|
49
|
+
const List<int> _H0 = [
|
|
50
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
|
51
|
+
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const int _MASK = 0xffffffff;
|
|
55
|
+
|
|
56
|
+
/// Rotate right within 32 bits. Dart integers are 64-bit, so every shift
|
|
57
|
+
/// and every addition below is masked back down explicitly - an unmasked
|
|
58
|
+
/// carry would quietly widen a word and change the digest.
|
|
59
|
+
int _rotr(int word, int by) =>
|
|
60
|
+
((word >> by) | (word << (32 - by))) & _MASK;
|
|
61
|
+
|
|
62
|
+
/// The SHA-256 digest of some bytes: 32 bytes.
|
|
63
|
+
Uint8List sha256(List<int> data) {
|
|
64
|
+
// Padding: a single 1 bit, zeros up to 56 bytes mod 64, then the message
|
|
65
|
+
// length in BITS as a big-endian 64-bit integer.
|
|
66
|
+
final bitlen = data.length * 8;
|
|
67
|
+
var padded = data.length + 1;
|
|
68
|
+
while (56 != padded % 64) {
|
|
69
|
+
padded++;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
final block = Uint8List(padded + 8);
|
|
73
|
+
block.setRange(0, data.length, data);
|
|
74
|
+
block[data.length] = 0x80;
|
|
75
|
+
|
|
76
|
+
for (var at = 0; at < 8; at++) {
|
|
77
|
+
block[padded + at] = (bitlen >> (8 * (7 - at))) & 0xff;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
final hash = List<int>.from(_H0);
|
|
81
|
+
final schedule = List<int>.filled(64, 0);
|
|
82
|
+
|
|
83
|
+
for (var start = 0; start < block.length; start += 64) {
|
|
84
|
+
for (var at = 0; at < 16; at++) {
|
|
85
|
+
final base = start + at * 4;
|
|
86
|
+
schedule[at] = (block[base] << 24) |
|
|
87
|
+
(block[base + 1] << 16) |
|
|
88
|
+
(block[base + 2] << 8) |
|
|
89
|
+
block[base + 3];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (var at = 16; at < 64; at++) {
|
|
93
|
+
final low = schedule[at - 15];
|
|
94
|
+
final high = schedule[at - 2];
|
|
95
|
+
final s0 = _rotr(low, 7) ^ _rotr(low, 18) ^ (low >> 3);
|
|
96
|
+
final s1 = _rotr(high, 17) ^ _rotr(high, 19) ^ (high >> 10);
|
|
97
|
+
schedule[at] =
|
|
98
|
+
(schedule[at - 16] + s0 + schedule[at - 7] + s1) & _MASK;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var a = hash[0];
|
|
102
|
+
var b = hash[1];
|
|
103
|
+
var c = hash[2];
|
|
104
|
+
var d = hash[3];
|
|
105
|
+
var e = hash[4];
|
|
106
|
+
var f = hash[5];
|
|
107
|
+
var g = hash[6];
|
|
108
|
+
var h = hash[7];
|
|
109
|
+
|
|
110
|
+
for (var at = 0; at < 64; at++) {
|
|
111
|
+
final sum1 = _rotr(e, 6) ^ _rotr(e, 11) ^ _rotr(e, 25);
|
|
112
|
+
final choice = (e & f) ^ (~e & _MASK & g);
|
|
113
|
+
final temp1 = (h + sum1 + choice + _K[at] + schedule[at]) & _MASK;
|
|
114
|
+
final sum0 = _rotr(a, 2) ^ _rotr(a, 13) ^ _rotr(a, 22);
|
|
115
|
+
final major = (a & b) ^ (a & c) ^ (b & c);
|
|
116
|
+
final temp2 = (sum0 + major) & _MASK;
|
|
117
|
+
|
|
118
|
+
h = g;
|
|
119
|
+
g = f;
|
|
120
|
+
f = e;
|
|
121
|
+
e = (d + temp1) & _MASK;
|
|
122
|
+
d = c;
|
|
123
|
+
c = b;
|
|
124
|
+
b = a;
|
|
125
|
+
a = (temp1 + temp2) & _MASK;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
hash[0] = (hash[0] + a) & _MASK;
|
|
129
|
+
hash[1] = (hash[1] + b) & _MASK;
|
|
130
|
+
hash[2] = (hash[2] + c) & _MASK;
|
|
131
|
+
hash[3] = (hash[3] + d) & _MASK;
|
|
132
|
+
hash[4] = (hash[4] + e) & _MASK;
|
|
133
|
+
hash[5] = (hash[5] + f) & _MASK;
|
|
134
|
+
hash[6] = (hash[6] + g) & _MASK;
|
|
135
|
+
hash[7] = (hash[7] + h) & _MASK;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
final out = Uint8List(32);
|
|
139
|
+
for (var at = 0; at < 8; at++) {
|
|
140
|
+
out[at * 4] = (hash[at] >> 24) & 0xff;
|
|
141
|
+
out[at * 4 + 1] = (hash[at] >> 16) & 0xff;
|
|
142
|
+
out[at * 4 + 2] = (hash[at] >> 8) & 0xff;
|
|
143
|
+
out[at * 4 + 3] = hash[at] & 0xff;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/// HMAC-SHA256, RFC 2104, block size 64.
|
|
150
|
+
///
|
|
151
|
+
/// The argument order is (key, data), which is the order every port here
|
|
152
|
+
/// uses. Some standard libraries take (data, key); getting it backwards
|
|
153
|
+
/// produces a signature that is wrong but perfectly well-formed.
|
|
154
|
+
Uint8List hmacsha256(List<int> key, List<int> data) {
|
|
155
|
+
var block = List<int>.from(key);
|
|
156
|
+
|
|
157
|
+
if (64 < block.length) {
|
|
158
|
+
block = List<int>.from(sha256(block));
|
|
159
|
+
}
|
|
160
|
+
while (block.length < 64) {
|
|
161
|
+
block.add(0);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
final inner = Uint8List(64 + data.length);
|
|
165
|
+
final outer = Uint8List(64 + 32);
|
|
166
|
+
|
|
167
|
+
for (var at = 0; at < 64; at++) {
|
|
168
|
+
inner[at] = block[at] ^ 0x36;
|
|
169
|
+
outer[at] = block[at] ^ 0x5c;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
inner.setRange(64, inner.length, data);
|
|
173
|
+
outer.setRange(64, outer.length, sha256(inner));
|
|
174
|
+
|
|
175
|
+
return sha256(outer);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/// Lowercase hex, two digits per byte.
|
|
179
|
+
String hex(List<int> bytes) {
|
|
180
|
+
final out = StringBuffer();
|
|
181
|
+
|
|
182
|
+
for (final byte in bytes) {
|
|
183
|
+
final value = byte & 0xff;
|
|
184
|
+
out.write(_HEXDIGITS[value >> 4]);
|
|
185
|
+
out.write(_HEXDIGITS[value & 0x0f]);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return out.toString();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const String _HEXDIGITS = '0123456789abcdef';
|
|
192
|
+
|
|
193
|
+
/// The SHA-256 of some text, as lowercase hex.
|
|
194
|
+
String sha256hex(String text) => hex(sha256(utf8.encode(text)));
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/doppler.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
|
+
// Doppler, as a voxgig/plugin definition.
|
|
5
|
+
//
|
|
6
|
+
// A PLUGIN, not a built-in: it opens a socket. A `Sekreto` can build the
|
|
7
|
+
// `doppler` kind only if the calling project imported this file and passed
|
|
8
|
+
// `doppler` in the `plugins` option (docs/design/plugin-providers.md).
|
|
9
|
+
//
|
|
10
|
+
// A port of typescript/plugins/doppler.ts, which is canonical.
|
|
11
|
+
|
|
12
|
+
import 'dart:async';
|
|
13
|
+
|
|
14
|
+
import '../src/addr.dart';
|
|
15
|
+
import '../src/json.dart';
|
|
16
|
+
import '../src/provider.dart';
|
|
17
|
+
import '../src/sekreto.dart';
|
|
18
|
+
import '../src/support.dart';
|
|
19
|
+
|
|
20
|
+
import 'httpjson.dart';
|
|
21
|
+
|
|
22
|
+
/// Doppler.
|
|
23
|
+
///
|
|
24
|
+
/// The whole config is downloaded once - Doppler's own bulk endpoint - and
|
|
25
|
+
/// answered from memory, like a remote .env: `api.token` is the `API_TOKEN`
|
|
26
|
+
/// entry. A service token is config-scoped, so project and config are only
|
|
27
|
+
/// needed with broader tokens.
|
|
28
|
+
class Doppler extends Provider {
|
|
29
|
+
final String? token;
|
|
30
|
+
final String? project;
|
|
31
|
+
final String? config;
|
|
32
|
+
final String? addr;
|
|
33
|
+
|
|
34
|
+
Map<String, String>? _values;
|
|
35
|
+
|
|
36
|
+
Doppler({this.token, this.project, this.config, this.addr});
|
|
37
|
+
|
|
38
|
+
@override
|
|
39
|
+
FutureOr<String?> lookup(String name) {
|
|
40
|
+
final loaded = _values;
|
|
41
|
+
if (null != loaded) {
|
|
42
|
+
return loaded[envkey(name)];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
final useaddr = trimslash(first([addr, 'https://api.doppler.com']));
|
|
46
|
+
checkaddr(useaddr);
|
|
47
|
+
|
|
48
|
+
return _load(useaddr).then((values) => values[envkey(name)]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Future<Map<String, String>> _load(String useaddr) async {
|
|
52
|
+
var url = '$useaddr/v3/configs/config/secrets/download?format=json';
|
|
53
|
+
if (null != project && project!.isNotEmpty) {
|
|
54
|
+
url += '&project=${uriescape(project!)}';
|
|
55
|
+
}
|
|
56
|
+
if (null != config && config!.isNotEmpty) {
|
|
57
|
+
url += '&config=${uriescape(config!)}';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
final res = await fetchjson('GET', url,
|
|
61
|
+
headers: {'authorization': 'Bearer ${token ?? ''}'});
|
|
62
|
+
|
|
63
|
+
final body = res.body.asobj;
|
|
64
|
+
if (200 != res.status || null == body) {
|
|
65
|
+
throw SekretoError('sekreto: doppler error: ${res.status}');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
final loaded = <String, String>{};
|
|
69
|
+
body.forEach((key, value) {
|
|
70
|
+
// A null value is not a secret; it is a declared name with nothing
|
|
71
|
+
// behind it.
|
|
72
|
+
final text = value.text;
|
|
73
|
+
if (null != text) {
|
|
74
|
+
loaded[key] = text;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Only a successful load is remembered, so a failure retries.
|
|
79
|
+
_values = loaded;
|
|
80
|
+
return loaded;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@override
|
|
84
|
+
String describe() {
|
|
85
|
+
if (null != project && project!.isNotEmpty) {
|
|
86
|
+
return 'doppler:$project/${config ?? ''}';
|
|
87
|
+
}
|
|
88
|
+
return 'doppler';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// The `doppler` provider kind. Pass it in `plugins` to name it in a chain.
|
|
93
|
+
final Definition doppler = providerplugin(
|
|
94
|
+
'doppler',
|
|
95
|
+
(spec) => Doppler(
|
|
96
|
+
token: spec.token,
|
|
97
|
+
project: spec.project,
|
|
98
|
+
config: spec.config,
|
|
99
|
+
addr: spec.addr,
|
|
100
|
+
),
|
|
101
|
+
);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/gcpsecrets.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
|
+
// GCP Secret Manager, as a voxgig/plugin definition.
|
|
5
|
+
//
|
|
6
|
+
// A PLUGIN, not a built-in: it opens a socket. A `Sekreto` can build the
|
|
7
|
+
// `gcpsecrets` kind only if the calling project imported this file and
|
|
8
|
+
// passed `gcpsecrets` in the `plugins` option
|
|
9
|
+
// (docs/design/plugin-providers.md).
|
|
10
|
+
//
|
|
11
|
+
// A port of typescript/plugins/gcpsecrets.ts, which is canonical.
|
|
12
|
+
|
|
13
|
+
import 'dart:async';
|
|
14
|
+
|
|
15
|
+
import '../src/addr.dart';
|
|
16
|
+
import '../src/json.dart';
|
|
17
|
+
import '../src/provider.dart';
|
|
18
|
+
import '../src/providers.dart';
|
|
19
|
+
import '../src/sekreto.dart';
|
|
20
|
+
import '../src/support.dart';
|
|
21
|
+
|
|
22
|
+
import 'httpjson.dart';
|
|
23
|
+
|
|
24
|
+
/// GCP Secret Manager.
|
|
25
|
+
///
|
|
26
|
+
/// `api.token` reads secret `api_token` (dots flattened to `_`; Secret
|
|
27
|
+
/// Manager ids have no hierarchy and reject dots), latest version. The token
|
|
28
|
+
/// comes from config, then `GOOGLE_OAUTH_ACCESS_TOKEN`, then the GCE/GKE
|
|
29
|
+
/// metadata server - so on Google's own platform no credential configuration
|
|
30
|
+
/// is needed at all.
|
|
31
|
+
///
|
|
32
|
+
/// The metadata call itself is plain http to a link-local host by platform
|
|
33
|
+
/// design; no credential rides on it, so `checkaddr` guards the Secret
|
|
34
|
+
/// Manager address instead.
|
|
35
|
+
class Gcpsecrets extends Provider {
|
|
36
|
+
final String? project;
|
|
37
|
+
final String? token;
|
|
38
|
+
final String? addr;
|
|
39
|
+
final String? metadataaddr;
|
|
40
|
+
|
|
41
|
+
// A configured token is kept forever; a metadata-server token carries
|
|
42
|
+
// expires_in and is renewed shortly before it runs out.
|
|
43
|
+
String? _livetoken;
|
|
44
|
+
int _renewat = NEVER;
|
|
45
|
+
|
|
46
|
+
Gcpsecrets({this.project, this.token, this.addr, this.metadataaddr});
|
|
47
|
+
|
|
48
|
+
String _metadataaddr() {
|
|
49
|
+
if (null != metadataaddr && metadataaddr!.isNotEmpty) {
|
|
50
|
+
return metadataaddr!;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
final host = getenv('GCE_METADATA_HOST');
|
|
54
|
+
if (null != host && host.isNotEmpty) {
|
|
55
|
+
return 'http://$host';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return 'http://metadata.google.internal';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Future<String> _login() async {
|
|
62
|
+
final configured = first([token, getenv('GOOGLE_OAUTH_ACCESS_TOKEN')]);
|
|
63
|
+
if (configured.isNotEmpty) {
|
|
64
|
+
return configured;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
final url = '${trimslash(_metadataaddr())}'
|
|
68
|
+
'/computeMetadata/v1/instance/service-accounts/default/token';
|
|
69
|
+
|
|
70
|
+
final res =
|
|
71
|
+
await fetchjson('GET', url, headers: {'Metadata-Flavor': 'Google'});
|
|
72
|
+
|
|
73
|
+
final got = res.body.dig('access_token').text;
|
|
74
|
+
if (200 != res.status || null == got || got.isEmpty) {
|
|
75
|
+
throw SekretoError(
|
|
76
|
+
'sekreto: gcp: no token and metadata server did not answer',
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
_renewat = renewtime(res.body.dig('expires_in'));
|
|
81
|
+
|
|
82
|
+
return got;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@override
|
|
86
|
+
FutureOr<String?> lookup(String name) {
|
|
87
|
+
final useproject = project ?? '';
|
|
88
|
+
if (useproject.isEmpty) {
|
|
89
|
+
throw SekretoError('sekreto: gcp: no project');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
final useaddr = first([addr, 'https://secretmanager.googleapis.com']);
|
|
93
|
+
checkaddr(useaddr);
|
|
94
|
+
|
|
95
|
+
return _read(useproject, useaddr, name);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Future<String?> _read(String useproject, String useaddr, String name) async {
|
|
99
|
+
if (null == _livetoken || DateTime.now().millisecondsSinceEpoch >= _renewat) {
|
|
100
|
+
_livetoken = await _login();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
final url = '${trimslash(useaddr)}/v1/projects/$useproject/secrets/'
|
|
104
|
+
'${flatname(name, '_')}/versions/latest:access';
|
|
105
|
+
|
|
106
|
+
final res = await fetchjson('GET', url,
|
|
107
|
+
headers: {'authorization': 'Bearer ${_livetoken ?? ''}'});
|
|
108
|
+
|
|
109
|
+
if (404 == res.status) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
if (200 != res.status) {
|
|
113
|
+
throw SekretoError('sekreto: gcp error: ${res.status}: $url');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
final data = res.body.dig('payload', 'data').asstr;
|
|
117
|
+
if (null == data) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
final decoded = unbase64(data);
|
|
122
|
+
if (null == decoded) {
|
|
123
|
+
throw SekretoError('sekreto: gcp: undecodable secret');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return decoded;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@override
|
|
130
|
+
String describe() => 'gcpsecrets:${project ?? ''}';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// The `gcpsecrets` provider kind. Pass it in `plugins` to name it in a
|
|
134
|
+
/// chain.
|
|
135
|
+
final Definition gcpsecrets = providerplugin(
|
|
136
|
+
'gcpsecrets',
|
|
137
|
+
(spec) => Gcpsecrets(
|
|
138
|
+
project: spec.project,
|
|
139
|
+
token: spec.token,
|
|
140
|
+
addr: spec.addr,
|
|
141
|
+
metadataaddr: spec.metadataaddr,
|
|
142
|
+
),
|
|
143
|
+
);
|