@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,116 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (dart/lib/version.dart)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/// Versions and ranges (section 11.2).
|
|
5
|
+
///
|
|
6
|
+
/// TWO FIELDS AND ONE PREDICATE. A capability declares `version`, a
|
|
7
|
+
/// concrete version. A requirement declares `range`. A requirement is
|
|
8
|
+
/// satisfied when the names match, the `match` passes, and the provider's
|
|
9
|
+
/// `version` falls inside the requirement's `range`.
|
|
10
|
+
///
|
|
11
|
+
/// That is the whole rule. There is no third field and no second
|
|
12
|
+
/// comparison - an earlier draft added a provider-side `compat` range,
|
|
13
|
+
/// which left three values and no statement of how they combine, and three
|
|
14
|
+
/// defensible readings of one declaration is worse than the ambiguity it
|
|
15
|
+
/// was introduced to fix.
|
|
16
|
+
library;
|
|
17
|
+
|
|
18
|
+
import 'types.dart' as t;
|
|
19
|
+
|
|
20
|
+
final _versionRe = RegExp(r'^(\d+)(?:\.(\d+))?(?:\.(\d+))?$');
|
|
21
|
+
|
|
22
|
+
/// A COMPONENT IS BOUNDED, and the bound is the model's, not the host
|
|
23
|
+
/// language's. A dart `int` is 64-bit and javascript stops being exact past
|
|
24
|
+
/// 2**53, so `9223372036854775808.0.0` parsed to an exact value here and a
|
|
25
|
+
/// rounded one there. 2**31-1 is the smallest bound every target language
|
|
26
|
+
/// holds exactly, which makes it the model's.
|
|
27
|
+
const componentMax = 2147483647;
|
|
28
|
+
|
|
29
|
+
int _component(String digits, String whole, String field) {
|
|
30
|
+
// BigInt, not int.parse: a component of forty digits overflows a 64-bit
|
|
31
|
+
// int silently in a release build, and the check below would then pass
|
|
32
|
+
// for a value that is plainly out of range.
|
|
33
|
+
final value = BigInt.parse(digits);
|
|
34
|
+
if (BigInt.from(componentMax) < value) {
|
|
35
|
+
t.fail('plugin_bad_range',
|
|
36
|
+
'version component out of range in $whole: $digits', {field: whole});
|
|
37
|
+
}
|
|
38
|
+
return value.toInt();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// Two forms and no more (section 11.2):
|
|
42
|
+
///
|
|
43
|
+
/// '2.1' >= 2.1.0 and < 3.0.0
|
|
44
|
+
/// '~2.1' >= 2.1.0 and < 2.2.0
|
|
45
|
+
Map<String, dynamic> parseRange(dynamic range) {
|
|
46
|
+
if (range is! String || range.isEmpty) {
|
|
47
|
+
t.fail('plugin_bad_range', 'invalid range: $range', {'range': range});
|
|
48
|
+
}
|
|
49
|
+
final tilde = range.startsWith('~');
|
|
50
|
+
final body = tilde ? range.substring(1) : range;
|
|
51
|
+
final m = _versionRe.firstMatch(body);
|
|
52
|
+
if (m == null) {
|
|
53
|
+
t.fail('plugin_bad_range', 'invalid range: $range', {'range': range});
|
|
54
|
+
}
|
|
55
|
+
final major = _component(m.group(1)!, range, 'range');
|
|
56
|
+
final minor = m.group(2) == null ? 0 : _component(m.group(2)!, range, 'range');
|
|
57
|
+
final patch = m.group(3) == null ? 0 : _component(m.group(3)!, range, 'range');
|
|
58
|
+
return {
|
|
59
|
+
'lo': [major, minor, patch],
|
|
60
|
+
'hi': tilde ? [major, minor + 1, 0] : [major + 1, 0, 0],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
List<int> parseVersion(dynamic version) {
|
|
65
|
+
if (version is! String) {
|
|
66
|
+
t.fail('plugin_bad_range', 'invalid version: $version',
|
|
67
|
+
{'version': version});
|
|
68
|
+
}
|
|
69
|
+
final m = _versionRe.firstMatch(version);
|
|
70
|
+
if (m == null) {
|
|
71
|
+
t.fail('plugin_bad_range', 'invalid version: $version',
|
|
72
|
+
{'version': version});
|
|
73
|
+
}
|
|
74
|
+
return [
|
|
75
|
+
_component(m.group(1)!, version, 'version'),
|
|
76
|
+
m.group(2) == null ? 0 : _component(m.group(2)!, version, 'version'),
|
|
77
|
+
m.group(3) == null ? 0 : _component(m.group(3)!, version, 'version'),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
int versionCmp(List<dynamic> a, List<dynamic> b) {
|
|
82
|
+
for (var i = 0; i < 3; i++) {
|
|
83
|
+
final x = (i < a.length ? a[i] : 0) as int;
|
|
84
|
+
final y = (i < b.length ? b[i] : 0) as int;
|
|
85
|
+
if (x != y) return x < y ? -1 : 1;
|
|
86
|
+
}
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// The one satisfaction predicate: lo <= version < hi.
|
|
91
|
+
bool satisfies(dynamic version, dynamic range) {
|
|
92
|
+
final v = parseVersion(version);
|
|
93
|
+
final r = parseRange(range);
|
|
94
|
+
return versionCmp(v, r['lo'] as List) >= 0 &&
|
|
95
|
+
versionCmp(v, r['hi'] as List) < 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/// `satisfies` for the internal callers that treat an unparseable version
|
|
99
|
+
/// or range as "does not satisfy" - Capability and Graph, both of which run
|
|
100
|
+
/// over data the corpus has already admitted.
|
|
101
|
+
bool satisfiesq(dynamic version, dynamic range) {
|
|
102
|
+
try {
|
|
103
|
+
return satisfies(version, range);
|
|
104
|
+
} on t.PluginError {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/// The numeric parts of a version, or zeros - a SORT KEY, never a check.
|
|
110
|
+
List<int> versionParts(String text) {
|
|
111
|
+
try {
|
|
112
|
+
return parseVersion(text);
|
|
113
|
+
} on t.PluginError {
|
|
114
|
+
return [0, 0, 0];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/aws.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 two AWS stores, as voxgig/plugin definitions - and `sigv4` with them.
|
|
5
|
+
//
|
|
6
|
+
// PLUGINS, not built-ins, and this is the file the design names: request
|
|
7
|
+
// signing is HMAC-SHA256, and the core of no port imports a hash function.
|
|
8
|
+
// `sigv4.dart` and `crypto.dart` sit beside this file rather than under
|
|
9
|
+
// `src/`, so a chain of the four built-in kinds compiles neither.
|
|
10
|
+
// A `Sekreto` can build `awssecrets` or `awsparams` only if the calling
|
|
11
|
+
// project imported this file and passed them in the `plugins` option
|
|
12
|
+
// (docs/design/plugin-providers.md).
|
|
13
|
+
//
|
|
14
|
+
// A port of typescript/plugins/aws.ts, which is canonical.
|
|
15
|
+
|
|
16
|
+
import 'dart:async';
|
|
17
|
+
|
|
18
|
+
import '../src/addr.dart';
|
|
19
|
+
import '../src/json.dart';
|
|
20
|
+
import '../src/provider.dart';
|
|
21
|
+
import '../src/providers.dart';
|
|
22
|
+
import '../src/sekreto.dart';
|
|
23
|
+
import '../src/support.dart';
|
|
24
|
+
|
|
25
|
+
import 'httpjson.dart';
|
|
26
|
+
import 'sigv4.dart';
|
|
27
|
+
|
|
28
|
+
/// Now, as the `YYYYMMDDTHHMMSSZ` timestamp SigV4 wants.
|
|
29
|
+
String awsnow() {
|
|
30
|
+
final now = DateTime.now().toUtc();
|
|
31
|
+
String two(int value) => value.toString().padLeft(2, '0');
|
|
32
|
+
|
|
33
|
+
return '${now.year.toString().padLeft(4, '0')}${two(now.month)}'
|
|
34
|
+
'${two(now.day)}T${two(now.hour)}${two(now.minute)}'
|
|
35
|
+
'${two(now.second)}Z';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// One signed AWS call, prepared without touching the network.
|
|
39
|
+
class _Awscall {
|
|
40
|
+
final String url;
|
|
41
|
+
final Map<String, String> headers;
|
|
42
|
+
final String payload;
|
|
43
|
+
const _Awscall(this.url, this.headers, this.payload);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// Region and credentials, from config first and the standard AWS_*
|
|
47
|
+
/// environment variables second - those are AWS's own convention, and a pod
|
|
48
|
+
/// or CI job that has them set should just work. Missing either is an error:
|
|
49
|
+
/// an AWS store with no credentials could not answer.
|
|
50
|
+
///
|
|
51
|
+
/// Resolved, checked and signed synchronously, so a chain with no
|
|
52
|
+
/// credentials fails where it is configured rather than somewhere inside a
|
|
53
|
+
/// network call.
|
|
54
|
+
_Awscall awsprep({
|
|
55
|
+
String? region,
|
|
56
|
+
String? keyid,
|
|
57
|
+
String? secret,
|
|
58
|
+
String? session,
|
|
59
|
+
String? addr,
|
|
60
|
+
required String service,
|
|
61
|
+
required String target,
|
|
62
|
+
required String payload,
|
|
63
|
+
}) {
|
|
64
|
+
final useregion =
|
|
65
|
+
first([region, getenv('AWS_REGION'), getenv('AWS_DEFAULT_REGION')]);
|
|
66
|
+
final usekeyid = first([keyid, getenv('AWS_ACCESS_KEY_ID')]);
|
|
67
|
+
final usesecret = first([secret, getenv('AWS_SECRET_ACCESS_KEY')]);
|
|
68
|
+
final usesession = first([session, getenv('AWS_SESSION_TOKEN')]);
|
|
69
|
+
|
|
70
|
+
if (useregion.isEmpty) {
|
|
71
|
+
throw SekretoError('sekreto: aws: no region (set region or AWS_REGION)');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (usekeyid.isEmpty || usesecret.isEmpty) {
|
|
75
|
+
throw SekretoError(
|
|
76
|
+
'sekreto: aws: no credentials'
|
|
77
|
+
' (set keyid/secret or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)',
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// The China partition lives under its own suffix; every other commercial
|
|
82
|
+
// region is plain amazonaws.com.
|
|
83
|
+
final suffix =
|
|
84
|
+
useregion.startsWith('cn-') ? '.amazonaws.com.cn' : '.amazonaws.com';
|
|
85
|
+
final useaddr = first([addr, 'https://$service.$useregion$suffix']);
|
|
86
|
+
checkaddr(useaddr);
|
|
87
|
+
|
|
88
|
+
final url = '${trimslash(useaddr)}/';
|
|
89
|
+
|
|
90
|
+
final extras = <String, String>{
|
|
91
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
92
|
+
'x-amz-target': target,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
final signed = sigv4(Signing(
|
|
96
|
+
method: 'POST',
|
|
97
|
+
url: url,
|
|
98
|
+
service: service,
|
|
99
|
+
region: useregion,
|
|
100
|
+
keyid: usekeyid,
|
|
101
|
+
secret: usesecret,
|
|
102
|
+
datetime: awsnow(),
|
|
103
|
+
headers: extras,
|
|
104
|
+
body: payload,
|
|
105
|
+
session: usesession.isEmpty ? null : usesession,
|
|
106
|
+
));
|
|
107
|
+
|
|
108
|
+
final headers = <String, String>{...extras, ...signed};
|
|
109
|
+
|
|
110
|
+
return _Awscall(url, headers, payload);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/// Does this AWS error body name one of the not-found types? Those are a
|
|
114
|
+
/// miss; every other failure is a store that could not answer.
|
|
115
|
+
///
|
|
116
|
+
/// A containment test, because AWS sends the type fully qualified:
|
|
117
|
+
/// `com.amazonaws.service#ResourceNotFoundException`.
|
|
118
|
+
bool awsmiss(Json? body, String type) {
|
|
119
|
+
final errtype = body.dig('__type').asstr;
|
|
120
|
+
return null != errtype && errtype.contains(type);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/// AWS Secrets Manager.
|
|
124
|
+
///
|
|
125
|
+
/// `api.token` reads the secret named `api` (the vaultref path, so
|
|
126
|
+
/// `db.pass.main` reads `db/pass`) and takes the `token` field of its JSON
|
|
127
|
+
/// SecretString - the AWS idiom of one JSON map per secret. A SecretString
|
|
128
|
+
/// that is not JSON is the value itself, under the conventional field
|
|
129
|
+
/// `value`. Requests are SigV4-signed in-tree; see sigv4.dart.
|
|
130
|
+
class Awssecrets extends Provider {
|
|
131
|
+
final String? region;
|
|
132
|
+
final String? keyid;
|
|
133
|
+
final String? secret;
|
|
134
|
+
final String? session;
|
|
135
|
+
final String? addr;
|
|
136
|
+
|
|
137
|
+
Awssecrets({this.region, this.keyid, this.secret, this.session, this.addr});
|
|
138
|
+
|
|
139
|
+
@override
|
|
140
|
+
FutureOr<String?> lookup(String name) {
|
|
141
|
+
final ref = vaultref(name);
|
|
142
|
+
|
|
143
|
+
final call = awsprep(
|
|
144
|
+
region: region,
|
|
145
|
+
keyid: keyid,
|
|
146
|
+
secret: secret,
|
|
147
|
+
session: session,
|
|
148
|
+
addr: addr,
|
|
149
|
+
service: 'secretsmanager',
|
|
150
|
+
target: 'secretsmanager.GetSecretValue',
|
|
151
|
+
payload: jsonstringify(JsonObj({'SecretId': JsonStr(ref.path)})),
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
return _read(call, ref);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
Future<String?> _read(_Awscall call, VaultRef ref) async {
|
|
158
|
+
final res = await fetchjson('POST', call.url,
|
|
159
|
+
headers: call.headers, body: call.payload);
|
|
160
|
+
|
|
161
|
+
if (400 == res.status && awsmiss(res.body, 'ResourceNotFoundException')) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
if (200 != res.status) {
|
|
165
|
+
throw SekretoError('sekreto: aws secretsmanager error: ${res.status}');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
final text = res.body.dig('SecretString').asstr;
|
|
169
|
+
|
|
170
|
+
if (null == text) {
|
|
171
|
+
// A binary secret has no fields to address; only the conventional
|
|
172
|
+
// `value` field can mean "the bytes themselves".
|
|
173
|
+
final binary = res.body.dig('SecretBinary').asstr;
|
|
174
|
+
|
|
175
|
+
if (null == binary || 'value' != ref.field) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
final decoded = unbase64(binary);
|
|
180
|
+
if (null == decoded) {
|
|
181
|
+
throw SekretoError('sekreto: aws secretsmanager: undecodable secret');
|
|
182
|
+
}
|
|
183
|
+
return decoded;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
final parsed = jsonparse(text);
|
|
187
|
+
final fields = parsed.asobj;
|
|
188
|
+
|
|
189
|
+
if (null != fields) {
|
|
190
|
+
return fields[ref.field].text;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// A plain-string secret is the whole value; it has no named fields.
|
|
194
|
+
return 'value' == ref.field ? text : null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Config only, never the environment: describe() feeds the spec's sources
|
|
198
|
+
// group, which must answer the same everywhere.
|
|
199
|
+
@override
|
|
200
|
+
String describe() => 'awssecrets:${region ?? ''}';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/// AWS SSM Parameter Store.
|
|
204
|
+
///
|
|
205
|
+
/// `db.pass.main` reads the parameter `/db/pass/main` (under an optional
|
|
206
|
+
/// prefix path), decrypted. Parameter Store carries flat strings, so there
|
|
207
|
+
/// is no field indirection.
|
|
208
|
+
class Awsparams extends Provider {
|
|
209
|
+
final String? region;
|
|
210
|
+
final String? keyid;
|
|
211
|
+
final String? secret;
|
|
212
|
+
final String? session;
|
|
213
|
+
final String? addr;
|
|
214
|
+
final String? prefix;
|
|
215
|
+
|
|
216
|
+
Awsparams({
|
|
217
|
+
this.region,
|
|
218
|
+
this.keyid,
|
|
219
|
+
this.secret,
|
|
220
|
+
this.session,
|
|
221
|
+
this.addr,
|
|
222
|
+
this.prefix,
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
@override
|
|
226
|
+
FutureOr<String?> lookup(String name) {
|
|
227
|
+
final call = awsprep(
|
|
228
|
+
region: region,
|
|
229
|
+
keyid: keyid,
|
|
230
|
+
secret: secret,
|
|
231
|
+
session: session,
|
|
232
|
+
addr: addr,
|
|
233
|
+
service: 'ssm',
|
|
234
|
+
target: 'AmazonSSM.GetParameter',
|
|
235
|
+
payload: jsonstringify(JsonObj({
|
|
236
|
+
'Name': JsonStr(awsparam(name, prefix)),
|
|
237
|
+
'WithDecryption': const JsonBool(true),
|
|
238
|
+
})),
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
return _read(call);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
Future<String?> _read(_Awscall call) async {
|
|
245
|
+
final res = await fetchjson('POST', call.url,
|
|
246
|
+
headers: call.headers, body: call.payload);
|
|
247
|
+
|
|
248
|
+
if (400 == res.status && awsmiss(res.body, 'ParameterNotFound')) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
if (200 != res.status) {
|
|
252
|
+
throw SekretoError('sekreto: aws ssm error: ${res.status}');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return res.body.dig('Parameter', 'Value').text;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@override
|
|
259
|
+
String describe() => 'awsparams:${region ?? ''}${prefix ?? ''}';
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// The `awssecrets` provider kind - AWS Secrets Manager.
|
|
263
|
+
final Definition awssecrets = providerplugin(
|
|
264
|
+
'awssecrets',
|
|
265
|
+
(spec) => Awssecrets(
|
|
266
|
+
region: spec.region,
|
|
267
|
+
keyid: spec.keyid,
|
|
268
|
+
secret: spec.secret,
|
|
269
|
+
session: spec.session,
|
|
270
|
+
addr: spec.addr,
|
|
271
|
+
),
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
/// The `awsparams` provider kind - AWS SSM Parameter Store.
|
|
275
|
+
final Definition awsparams = providerplugin(
|
|
276
|
+
'awsparams',
|
|
277
|
+
(spec) => Awsparams(
|
|
278
|
+
region: spec.region,
|
|
279
|
+
keyid: spec.keyid,
|
|
280
|
+
secret: spec.secret,
|
|
281
|
+
session: spec.session,
|
|
282
|
+
addr: spec.addr,
|
|
283
|
+
prefix: spec.prefix,
|
|
284
|
+
),
|
|
285
|
+
);
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (dart/plugins/azuresecrets.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
|
+
// Azure Key Vault, as a voxgig/plugin definition.
|
|
5
|
+
//
|
|
6
|
+
// A PLUGIN, not a built-in: it opens a socket. A `Sekreto` can build the
|
|
7
|
+
// `azuresecrets` kind only if the calling project imported this file and
|
|
8
|
+
// passed `azuresecrets` in the `plugins` option
|
|
9
|
+
// (docs/design/plugin-providers.md).
|
|
10
|
+
//
|
|
11
|
+
// A port of typescript/plugins/azuresecrets.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
|
+
/// The Key Vault audience an Azure token is minted for.
|
|
24
|
+
const String RESOURCE = 'https://vault.azure.net';
|
|
25
|
+
|
|
26
|
+
/// Azure Key Vault.
|
|
27
|
+
///
|
|
28
|
+
/// `api.token` reads secret `api-token` (dots flattened to `-`; Key Vault
|
|
29
|
+
/// names allow nothing else), current version. The token comes from config,
|
|
30
|
+
/// then a client-credentials login when tenant/clientid/clientsecret are
|
|
31
|
+
/// given, then the IMDS managed-identity endpoint - so on Azure's own
|
|
32
|
+
/// platform no credential configuration is needed.
|
|
33
|
+
///
|
|
34
|
+
/// As with GCP, the IMDS call is plain http to a link-local host by platform
|
|
35
|
+
/// design and carries no credential; the login and vault addresses are
|
|
36
|
+
/// `checkaddr`-guarded.
|
|
37
|
+
class Azuresecrets extends Provider {
|
|
38
|
+
final String? vault;
|
|
39
|
+
final String? token;
|
|
40
|
+
final String? tenant;
|
|
41
|
+
final String? clientid;
|
|
42
|
+
final String? clientsecret;
|
|
43
|
+
final String? loginaddr;
|
|
44
|
+
final String? imdsaddr;
|
|
45
|
+
final String? apiversion;
|
|
46
|
+
|
|
47
|
+
// A configured token is kept forever; logged-in and IMDS tokens carry
|
|
48
|
+
// expires_in and are renewed shortly before they run out.
|
|
49
|
+
String? _livetoken;
|
|
50
|
+
int _renewat = NEVER;
|
|
51
|
+
|
|
52
|
+
Azuresecrets({
|
|
53
|
+
this.vault,
|
|
54
|
+
this.token,
|
|
55
|
+
this.tenant,
|
|
56
|
+
this.clientid,
|
|
57
|
+
this.clientsecret,
|
|
58
|
+
this.loginaddr,
|
|
59
|
+
this.imdsaddr,
|
|
60
|
+
this.apiversion,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
bool get _hasclient =>
|
|
64
|
+
null != tenant &&
|
|
65
|
+
tenant!.isNotEmpty &&
|
|
66
|
+
null != clientid &&
|
|
67
|
+
clientid!.isNotEmpty &&
|
|
68
|
+
null != clientsecret &&
|
|
69
|
+
clientsecret!.isNotEmpty;
|
|
70
|
+
|
|
71
|
+
Future<String> _login() async {
|
|
72
|
+
if (null != token && token!.isNotEmpty) {
|
|
73
|
+
return token!;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (_hasclient) {
|
|
77
|
+
final useloginaddr =
|
|
78
|
+
first([loginaddr, 'https://login.microsoftonline.com']);
|
|
79
|
+
checkaddr(useloginaddr);
|
|
80
|
+
|
|
81
|
+
final url = '${trimslash(useloginaddr)}/${tenant!}/oauth2/v2.0/token';
|
|
82
|
+
final form = 'grant_type=client_credentials'
|
|
83
|
+
'&client_id=${uriescape(clientid!)}'
|
|
84
|
+
'&client_secret=${uriescape(clientsecret!)}'
|
|
85
|
+
'&scope=${uriescape('$RESOURCE/.default')}';
|
|
86
|
+
|
|
87
|
+
final res = await fetchjson(
|
|
88
|
+
'POST',
|
|
89
|
+
url,
|
|
90
|
+
headers: {'content-type': 'application/x-www-form-urlencoded'},
|
|
91
|
+
body: form,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
final got = res.body.dig('access_token').text;
|
|
95
|
+
if (200 != res.status || null == got || got.isEmpty) {
|
|
96
|
+
throw SekretoError('sekreto: azure login failed: ${res.status}');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_renewat = renewtime(res.body.dig('expires_in'));
|
|
100
|
+
return got;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
final imds = '${trimslash(first([imdsaddr, 'http://169.254.169.254']))}'
|
|
104
|
+
'/metadata/identity/oauth2/token?api-version=2018-02-01'
|
|
105
|
+
'&resource=${uriescape(RESOURCE)}';
|
|
106
|
+
|
|
107
|
+
final res = await fetchjson('GET', imds, headers: {'Metadata': 'true'});
|
|
108
|
+
|
|
109
|
+
final got = res.body.dig('access_token').text;
|
|
110
|
+
if (200 != res.status || null == got || got.isEmpty) {
|
|
111
|
+
throw SekretoError(
|
|
112
|
+
'sekreto: azure: no token, no client credentials, and IMDS did not answer',
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// IMDS sends expires_in as a STRING, where everyone else sends a number.
|
|
117
|
+
_renewat = renewtime(res.body.dig('expires_in'));
|
|
118
|
+
return got;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@override
|
|
122
|
+
FutureOr<String?> lookup(String name) {
|
|
123
|
+
final usevault = vault ?? '';
|
|
124
|
+
if (usevault.isEmpty) {
|
|
125
|
+
throw SekretoError('sekreto: azure: no vault');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Only an explicit scheme is a URL; a vault NAMED httpvault must still
|
|
129
|
+
// become https://httpvault.vault.azure.net.
|
|
130
|
+
final vaulturl =
|
|
131
|
+
(usevault.startsWith('http://') || usevault.startsWith('https://'))
|
|
132
|
+
? usevault
|
|
133
|
+
: 'https://$usevault.vault.azure.net';
|
|
134
|
+
checkaddr(vaulturl);
|
|
135
|
+
|
|
136
|
+
return _read(vaulturl, name);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Future<String?> _read(String vaulturl, String name) async {
|
|
140
|
+
if (null == _livetoken || DateTime.now().millisecondsSinceEpoch >= _renewat) {
|
|
141
|
+
_livetoken = await _login();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
final url = '${trimslash(vaulturl)}/secrets/${flatname(name, '-')}'
|
|
145
|
+
'?api-version=${first([apiversion, '7.4'])}';
|
|
146
|
+
|
|
147
|
+
final res = await fetchjson('GET', url,
|
|
148
|
+
headers: {'authorization': 'Bearer ${_livetoken ?? ''}'});
|
|
149
|
+
|
|
150
|
+
if (404 == res.status) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
if (200 != res.status) {
|
|
154
|
+
throw SekretoError('sekreto: azure error: ${res.status}: ${bare(url)}');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return res.body.dig('value').text;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@override
|
|
161
|
+
String describe() => 'azuresecrets:${vault ?? ''}';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/// The `azuresecrets` provider kind. Pass it in `plugins` to name it in a
|
|
165
|
+
/// chain.
|
|
166
|
+
final Definition azuresecrets = providerplugin(
|
|
167
|
+
'azuresecrets',
|
|
168
|
+
(spec) => Azuresecrets(
|
|
169
|
+
vault: spec.vault,
|
|
170
|
+
token: spec.token,
|
|
171
|
+
tenant: spec.tenant,
|
|
172
|
+
clientid: spec.clientid,
|
|
173
|
+
clientsecret: spec.clientsecret,
|
|
174
|
+
loginaddr: spec.loginaddr,
|
|
175
|
+
imdsaddr: spec.imdsaddr,
|
|
176
|
+
apiversion: spec.apiversion,
|
|
177
|
+
),
|
|
178
|
+
);
|