@voxgig/sdkgen 4.50.0 → 4.52.0
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/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeExplanation.js +5 -2
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeFeatures.js +20 -6
- package/dist/cmp/ReadmeFeatures.js.map +1 -1
- package/dist/helpers/optspec.js +2 -2
- package/dist/helpers/optspec.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aontu +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/audit.aontu +1 -1
- package/project/.sdk/model/feature/cache.aontu +7 -5
- package/project/.sdk/model/feature/clienttrack.aontu +1 -1
- package/project/.sdk/model/feature/cost.aontu +1 -1
- package/project/.sdk/model/feature/debug.aontu +1 -1
- package/project/.sdk/model/feature/idempotency.aontu +1 -1
- package/project/.sdk/model/feature/log.aontu +1 -1
- package/project/.sdk/model/feature/metrics.aontu +3 -1
- package/project/.sdk/model/feature/netsim.aontu +1 -1
- package/project/.sdk/model/feature/paging.aontu +4 -1
- package/project/.sdk/model/feature/proxy.aontu +1 -1
- package/project/.sdk/model/feature/ratelimit.aontu +3 -3
- package/project/.sdk/model/feature/rbac.aontu +1 -1
- package/project/.sdk/model/feature/retry.aontu +1 -1
- package/project/.sdk/model/feature/secrets.aontu +1 -1
- package/project/.sdk/model/feature/streaming.aontu +1 -1
- package/project/.sdk/model/feature/telemetry.aontu +2 -2
- package/project/.sdk/model/feature/test.aontu +1 -1
- package/project/.sdk/model/feature/timeout.aontu +1 -1
- package/project/.sdk/model/feature/validate.aontu +1 -1
- package/project/.sdk/model/target/lua.aontu +6 -0
- package/project/.sdk/src/cmp/c/Config_c.ts +3 -134
- package/project/.sdk/src/cmp/c/TestClean_c.ts +26 -11
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +17 -10
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +10 -5
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +15 -1
- package/project/.sdk/src/cmp/csharp/TestClean_csharp.ts +9 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +30 -2
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +31 -12
- package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +13 -4
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +51 -15
- package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +17 -0
- package/project/.sdk/src/cmp/go/TestClean_go.ts +39 -3
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -2
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +42 -14
- package/project/.sdk/src/cmp/java/TestClean_java.ts +17 -4
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +21 -0
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -8
- package/project/.sdk/src/cmp/js/TestClean_js.ts +13 -5
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +26 -2
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +12 -5
- package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +31 -4
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
- package/project/.sdk/src/cmp/lua/TestClean_lua.ts +14 -4
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +42 -5
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +44 -10
- package/project/.sdk/src/cmp/lua/utility_lua.ts +2 -1
- package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +20 -5
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
- package/project/.sdk/src/cmp/perl/TestClean_perl.ts +13 -4
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +21 -0
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +31 -12
- package/project/.sdk/src/cmp/php/TestClean_php.ts +10 -3
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +33 -4
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
- package/project/.sdk/src/cmp/py/TestClean_py.ts +10 -3
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +25 -2
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +26 -12
- package/project/.sdk/src/cmp/rb/TestClean_rb.ts +11 -4
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +23 -2
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +27 -11
- package/project/.sdk/src/cmp/rust/TestClean_rust.ts +24 -17
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
- package/project/.sdk/src/cmp/scala/TestClean_scala.ts +45 -11
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +14 -0
- package/project/.sdk/src/cmp/swift/TestClean_swift.ts +31 -21
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +9 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +24 -10
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +13 -8
- package/project/.sdk/src/cmp/ts/TestClean_ts.ts +13 -5
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +26 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +12 -5
- package/project/.sdk/src/cmp/zig/TestClean_zig.ts +23 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +17 -10
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +41 -6
- package/project/.sdk/tm/c/core/context.c +1 -0
- package/project/.sdk/tm/c/core/sdk.h +7 -4
- package/project/.sdk/tm/c/feature/cache.c +243 -13
- package/project/.sdk/tm/c/feature/metrics.c +7 -0
- package/project/.sdk/tm/c/feature/paging.c +231 -2
- package/project/.sdk/tm/c/feature/ratelimit.c +5 -9
- package/project/.sdk/tm/c/feature/retry.c +51 -4
- package/project/.sdk/tm/c/feature/secrets.c +27 -38
- package/project/.sdk/tm/c/feature/streaming.c +2 -1
- package/project/.sdk/tm/c/feature/telemetry.c +19 -18
- package/project/.sdk/tm/c/feature/test.c +78 -54
- package/project/.sdk/tm/c/tests/feature_test.c +288 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
- package/project/.sdk/tm/c/utility/clean.c +26 -33
- package/project/.sdk/tm/c/utility/make_options.c +89 -17
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +14 -11
- package/project/.sdk/tm/clojure/src/sdk/client.clj +3 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +50 -22
- package/project/.sdk/tm/clojure/src/sdk/features.clj +279 -80
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +103 -1
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +1 -0
- package/project/.sdk/tm/cpp/Makefile +5 -0
- package/project/.sdk/tm/cpp/core/types.hpp +148 -72
- package/project/.sdk/tm/cpp/feature/audit.hpp +12 -8
- package/project/.sdk/tm/cpp/feature/cache.hpp +188 -9
- package/project/.sdk/tm/cpp/feature/metrics.hpp +19 -0
- package/project/.sdk/tm/cpp/feature/paging.hpp +160 -2
- package/project/.sdk/tm/cpp/feature/ratelimit.hpp +18 -14
- package/project/.sdk/tm/cpp/feature/retry.hpp +46 -5
- package/project/.sdk/tm/cpp/feature/secrets.hpp +12 -0
- package/project/.sdk/tm/cpp/feature/streaming.hpp +2 -1
- package/project/.sdk/tm/cpp/feature/telemetry.hpp +17 -10
- package/project/.sdk/tm/cpp/feature/test.hpp +63 -53
- package/project/.sdk/tm/cpp/test/feature_test.cpp +236 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +44 -12
- package/project/.sdk/tm/csharp/core/Context.cs +4 -0
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
- package/project/.sdk/tm/csharp/feature/CacheFeature.cs +126 -12
- package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +23 -0
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +130 -3
- package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +26 -19
- package/project/.sdk/tm/csharp/feature/RetryFeature.cs +41 -7
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +9 -27
- package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +2 -1
- package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +11 -9
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +55 -67
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +238 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +5 -10
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +7 -1
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +94 -24
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +2 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/cache.ex +146 -30
- package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +13 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +110 -5
- package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +6 -12
- package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +33 -9
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +10 -56
- package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +2 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +7 -7
- package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +52 -48
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +77 -47
- package/project/.sdk/tm/elixir/test/feature_test.exs +198 -0
- package/project/.sdk/tm/go/core/context.go +6 -0
- package/project/.sdk/tm/go/feature/audit_feature.go +1 -3
- package/project/.sdk/tm/go/feature/base_feature.go +11 -0
- package/project/.sdk/tm/go/feature/cache_feature.go +131 -4
- package/project/.sdk/tm/go/feature/metrics_feature.go +14 -0
- package/project/.sdk/tm/go/feature/paging_feature.go +108 -2
- package/project/.sdk/tm/go/feature/ratelimit_feature.go +19 -17
- package/project/.sdk/tm/go/feature/retry_feature.go +81 -9
- package/project/.sdk/tm/go/feature/secrets_feature.go +17 -71
- package/project/.sdk/tm/go/feature/streaming_feature.go +2 -1
- package/project/.sdk/tm/go/feature/telemetry_feature.go +18 -11
- package/project/.sdk/tm/go/feature/test_feature.go +65 -55
- package/project/.sdk/tm/go/test/feature_corpus_test.go +357 -28
- package/project/.sdk/tm/go/test/feature_test.go +93 -0
- package/project/.sdk/tm/go/utility/clean.go +5 -7
- package/project/.sdk/tm/go/utility/fetcher.go +11 -0
- package/project/.sdk/tm/go/utility/make_options.go +116 -13
- package/project/.sdk/tm/java/core/Context.java +9 -0
- package/project/.sdk/tm/java/core/SdkClient.java +43 -14
- package/project/.sdk/tm/java/feature/AuditFeature.java +5 -1
- package/project/.sdk/tm/java/feature/CacheFeature.java +123 -17
- package/project/.sdk/tm/java/feature/MetricsFeature.java +31 -0
- package/project/.sdk/tm/java/feature/PagingFeature.java +156 -2
- package/project/.sdk/tm/java/feature/RatelimitFeature.java +15 -13
- package/project/.sdk/tm/java/feature/RetryFeature.java +33 -6
- package/project/.sdk/tm/java/feature/SecretsFeature.java +9 -92
- package/project/.sdk/tm/java/feature/StreamingFeature.java +2 -1
- package/project/.sdk/tm/java/feature/TelemetryFeature.java +17 -9
- package/project/.sdk/tm/java/feature/TestFeature.java +50 -63
- package/project/.sdk/tm/java/test/FeatureCorpusTest.java +309 -17
- package/project/.sdk/tm/java/test/FeatureTest.java +60 -0
- package/project/.sdk/tm/java/utility/Clean.java +6 -10
- package/project/.sdk/tm/java/utility/Fetcher.java +5 -1
- package/project/.sdk/tm/java/utility/MakeOptions.java +131 -15
- package/project/.sdk/tm/js/src/Context.js +4 -0
- package/project/.sdk/tm/js/src/feature/cache/CacheFeature.js +118 -11
- package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +3 -2
- package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +9 -4
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +103 -5
- package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +5 -9
- package/project/.sdk/tm/js/src/feature/rbac/RbacFeature.js +4 -4
- package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +25 -3
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +16 -6
- package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +2 -1
- package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +11 -6
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +38 -1
- package/project/.sdk/tm/js/src/feature/validate/ValidateFeature.js +2 -1
- package/project/.sdk/tm/js/src/utility/CleanUtility.js +1 -1
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +61 -12
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +191 -23
- package/project/.sdk/tm/js/test/feature/harness.js +3 -3
- package/project/.sdk/tm/js/test/feature.test.js +14 -1
- package/project/.sdk/tm/js/test/pipeline.test.js +1 -1
- package/project/.sdk/tm/kotlin/core/Context.kt +3 -0
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +23 -10
- package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +5 -1
- package/project/.sdk/tm/kotlin/feature/CacheFeature.kt +102 -7
- package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +22 -0
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +125 -2
- package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +16 -13
- package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +36 -14
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +10 -20
- package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +4 -0
- package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +12 -10
- package/project/.sdk/tm/kotlin/feature/TestFeature.kt +45 -48
- package/project/.sdk/tm/kotlin/test/FeatureTest.kt +173 -0
- package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +5 -5
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +4 -0
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +86 -15
- package/project/.sdk/tm/lua/core/context.lua +6 -0
- package/project/.sdk/tm/lua/feature/cache_feature.lua +212 -15
- package/project/.sdk/tm/lua/feature/debug_feature.lua +2 -3
- package/project/.sdk/tm/lua/feature/metrics_feature.lua +5 -0
- package/project/.sdk/tm/lua/feature/paging_feature.lua +143 -2
- package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +5 -9
- package/project/.sdk/tm/lua/feature/retry_feature.lua +43 -5
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +15 -80
- package/project/.sdk/tm/lua/feature/streaming_feature.lua +2 -1
- package/project/.sdk/tm/lua/feature/telemetry_feature.lua +18 -7
- package/project/.sdk/tm/lua/feature/test_feature.lua +60 -62
- package/project/.sdk/tm/lua/test/feature_test.lua +181 -3
- package/project/.sdk/tm/lua/utility/clean.lua +6 -9
- package/project/.sdk/tm/lua/utility/fetcher.lua +9 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +60 -18
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +21 -6
- package/project/.sdk/tm/ocaml/sdk_features.ml +392 -68
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +47 -21
- package/project/.sdk/tm/ocaml/sdk_types.ml +2 -0
- package/project/.sdk/tm/ocaml/test/t_feature.ml +107 -2
- package/project/.sdk/tm/perl/core/context.pm +3 -0
- package/project/.sdk/tm/perl/feature/audit_feature.pm +4 -7
- package/project/.sdk/tm/perl/feature/cache_feature.pm +111 -15
- package/project/.sdk/tm/perl/feature/debug_feature.pm +2 -2
- package/project/.sdk/tm/perl/feature/metrics_feature.pm +5 -0
- package/project/.sdk/tm/perl/feature/paging_feature.pm +139 -2
- package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +5 -11
- package/project/.sdk/tm/perl/feature/retry_feature.pm +22 -4
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +13 -18
- package/project/.sdk/tm/perl/feature/streaming_feature.pm +2 -0
- package/project/.sdk/tm/perl/feature/telemetry_feature.pm +17 -8
- package/project/.sdk/tm/perl/feature/test_feature.pm +45 -50
- package/project/.sdk/tm/perl/t/feature.t +68 -2
- package/project/.sdk/tm/perl/t/feature_corpus.t +204 -25
- package/project/.sdk/tm/perl/utility/clean.pm +6 -8
- package/project/.sdk/tm/perl/utility/fetcher.pm +4 -0
- package/project/.sdk/tm/perl/utility/make_options.pm +38 -15
- package/project/.sdk/tm/php/core/Context.php +4 -0
- package/project/.sdk/tm/php/feature/CacheFeature.php +98 -13
- package/project/.sdk/tm/php/feature/MetricsFeature.php +8 -0
- package/project/.sdk/tm/php/feature/PagingFeature.php +128 -1
- package/project/.sdk/tm/php/feature/RatelimitFeature.php +5 -9
- package/project/.sdk/tm/php/feature/RetryFeature.php +27 -3
- package/project/.sdk/tm/php/feature/SecretsFeature.php +18 -15
- package/project/.sdk/tm/php/feature/StreamingFeature.php +2 -1
- package/project/.sdk/tm/php/feature/TelemetryFeature.php +10 -7
- package/project/.sdk/tm/php/feature/TestFeature.php +55 -47
- package/project/.sdk/tm/php/test/FeatureCorpusTest.php +262 -17
- package/project/.sdk/tm/php/test/FeatureTest.php +68 -0
- package/project/.sdk/tm/php/utility/Clean.php +3 -10
- package/project/.sdk/tm/php/utility/Fetcher.php +8 -3
- package/project/.sdk/tm/php/utility/MakeOptions.php +45 -20
- package/project/.sdk/tm/py/pkg/core/context.py +4 -0
- package/project/.sdk/tm/py/pkg/feature/cache_feature.py +79 -13
- package/project/.sdk/tm/py/pkg/feature/metrics_feature.py +7 -0
- package/project/.sdk/tm/py/pkg/feature/paging_feature.py +86 -1
- package/project/.sdk/tm/py/pkg/feature/ratelimit_feature.py +13 -16
- package/project/.sdk/tm/py/pkg/feature/retry_feature.py +31 -6
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +15 -66
- package/project/.sdk/tm/py/pkg/feature/streaming_feature.py +2 -1
- package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +10 -6
- package/project/.sdk/tm/py/pkg/feature/test_feature.py +56 -53
- package/project/.sdk/tm/py/pkg/utility/clean.py +4 -10
- package/project/.sdk/tm/py/pkg/utility/make_options.py +77 -30
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +23 -9
- package/project/.sdk/tm/py/test/test_feature.py +61 -1
- package/project/.sdk/tm/py/test/test_feature_corpus.py +197 -17
- package/project/.sdk/tm/py-data/pkg/fetch.py +6 -3
- package/project/.sdk/tm/py-data/test/test_fetch.py +7 -4
- package/project/.sdk/tm/rb/core/context.rb +4 -1
- package/project/.sdk/tm/rb/feature/audit_feature.rb +6 -5
- package/project/.sdk/tm/rb/feature/cache_feature.rb +75 -11
- package/project/.sdk/tm/rb/feature/debug_feature.rb +2 -2
- package/project/.sdk/tm/rb/feature/metrics_feature.rb +8 -0
- package/project/.sdk/tm/rb/feature/paging_feature.rb +87 -1
- package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +12 -16
- package/project/.sdk/tm/rb/feature/retry_feature.rb +19 -3
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +9 -64
- package/project/.sdk/tm/rb/feature/streaming_feature.rb +2 -1
- package/project/.sdk/tm/rb/feature/telemetry_feature.rb +11 -6
- package/project/.sdk/tm/rb/feature/test_feature.rb +42 -49
- package/project/.sdk/tm/rb/test/feature_corpus_test.rb +191 -25
- package/project/.sdk/tm/rb/test/feature_test.rb +75 -1
- package/project/.sdk/tm/rb/utility/clean.rb +6 -7
- package/project/.sdk/tm/rb/utility/fetcher.rb +6 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +37 -16
- package/project/.sdk/tm/rust/core/context.rs +8 -0
- package/project/.sdk/tm/rust/feature/audit.rs +2 -2
- package/project/.sdk/tm/rust/feature/cache.rs +120 -3
- package/project/.sdk/tm/rust/feature/metrics.rs +24 -1
- package/project/.sdk/tm/rust/feature/paging.rs +189 -3
- package/project/.sdk/tm/rust/feature/ratelimit.rs +5 -10
- package/project/.sdk/tm/rust/feature/retry.rs +59 -6
- package/project/.sdk/tm/rust/feature/secrets.rs +36 -98
- package/project/.sdk/tm/rust/feature/streaming.rs +3 -2
- package/project/.sdk/tm/rust/feature/support.rs +4 -0
- package/project/.sdk/tm/rust/feature/telemetry.rs +22 -11
- package/project/.sdk/tm/rust/feature/test.rs +63 -57
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +3 -3
- package/project/.sdk/tm/rust/tests/feature_test.rs +274 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
- package/project/.sdk/tm/rust/utility/clean.rs +35 -43
- package/project/.sdk/tm/rust/utility/fetcher.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +130 -38
- package/project/.sdk/tm/scala/core/Context.scala +4 -0
- package/project/.sdk/tm/scala/core/SdkClient.scala +45 -11
- package/project/.sdk/tm/scala/feature/AuditFeature.scala +6 -1
- package/project/.sdk/tm/scala/feature/CacheFeature.scala +117 -11
- package/project/.sdk/tm/scala/feature/MetricsFeature.scala +31 -1
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +122 -2
- package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +14 -11
- package/project/.sdk/tm/scala/feature/RetryFeature.scala +29 -7
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +11 -24
- package/project/.sdk/tm/scala/feature/StreamingFeature.scala +2 -1
- package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +12 -10
- package/project/.sdk/tm/scala/feature/TestFeature.scala +44 -44
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +69 -0
- package/project/.sdk/tm/scala/utility/Fetcher.scala +5 -0
- package/project/.sdk/tm/scala/utility/Make.scala +99 -14
- package/project/.sdk/tm/scala/utility/Misc.scala +5 -8
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +3 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CacheFeature.swift +122 -11
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +20 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +102 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +19 -13
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +40 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +9 -13
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +2 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +11 -9
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +55 -49
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +4 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +56 -17
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +4 -5
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +166 -0
- package/project/.sdk/tm/ts/src/Context.ts +4 -0
- package/project/.sdk/tm/ts/src/feature/cache/CacheFeature.ts +115 -4
- package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +3 -2
- package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +6 -1
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +103 -5
- package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +5 -9
- package/project/.sdk/tm/ts/src/feature/rbac/RbacFeature.ts +4 -4
- package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +25 -3
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +14 -2
- package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +2 -1
- package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +11 -6
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +8 -7
- package/project/.sdk/tm/ts/src/feature/validate/ValidateFeature.ts +2 -1
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +1 -1
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +63 -12
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +192 -23
- package/project/.sdk/tm/ts/test/feature/harness.ts +3 -3
- package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
- package/project/.sdk/tm/ts/test/pipeline.test.ts +1 -1
- package/project/.sdk/tm/zig/core/context.zig +5 -0
- package/project/.sdk/tm/zig/core/utility.zig +118 -17
- package/project/.sdk/tm/zig/feature/cache.zig +144 -13
- package/project/.sdk/tm/zig/feature/metrics.zig +19 -0
- package/project/.sdk/tm/zig/feature/paging.zig +172 -4
- package/project/.sdk/tm/zig/feature/ratelimit.zig +5 -11
- package/project/.sdk/tm/zig/feature/retry.zig +41 -3
- package/project/.sdk/tm/zig/feature/secrets.zig +6 -1
- package/project/.sdk/tm/zig/feature/streaming.zig +2 -0
- package/project/.sdk/tm/zig/feature/telemetry.zig +15 -9
- package/project/.sdk/tm/zig/feature/test.zig +56 -40
- package/project/.sdk/tm/zig/test/feature_test.zig +174 -0
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +2 -0
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeExplanation.ts +5 -2
- package/src/cmp/ReadmeFeatures.ts +21 -6
- package/src/helpers/optspec.ts +2 -2
package/model/sdkgen.aontu
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ main: kit: feature: cache: {
|
|
|
3
3
|
|
|
4
4
|
name: key()
|
|
5
5
|
title: "Response cache"
|
|
6
|
-
description: "
|
|
6
|
+
description: "Per-client response caching for safe read requests"
|
|
7
7
|
version: '0.0.1'
|
|
8
8
|
active: true
|
|
9
9
|
base: 'BASE'
|
|
@@ -11,17 +11,19 @@ main: kit: feature: cache: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
15
|
-
# time-to-live in milliseconds
|
|
14
|
+
active: *false | boolean
|
|
15
|
+
# time-to-live in milliseconds; a response's Cache-Control max-age caps it
|
|
16
16
|
ttl: 5000
|
|
17
|
-
# maximum cached entries (oldest evicted)
|
|
17
|
+
# maximum cached entries in this client's store (oldest evicted)
|
|
18
18
|
max: 256
|
|
19
|
-
# cacheable request methods
|
|
19
|
+
# cacheable request methods; any other but GET and HEAD is a write, which
|
|
20
|
+
# drops its own path, everything under it and its parent path's entry
|
|
20
21
|
methods: ['GET']
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
# Cache wraps the transport in init(); it dispatches no pipeline hooks.
|
|
26
|
+
# The key is the method, the URL and a keyed digest of the request headers.
|
|
25
27
|
hook: {}
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -11,7 +11,7 @@ main: kit: feature: metrics: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -26,4 +26,6 @@ main: kit: feature: metrics: {
|
|
|
26
26
|
main: kit: feature: metrics: config: optspec: {
|
|
27
27
|
# injected clock, for deterministic durations
|
|
28
28
|
now: '`$FUNCTION`'
|
|
29
|
+
# receives a copy of the counters after each operation
|
|
30
|
+
sink: '`$FUNCTION`'
|
|
29
31
|
}
|
|
@@ -11,12 +11,15 @@ main: kit: feature: paging: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
pageParam: 'page'
|
|
16
16
|
limitParam: 'limit'
|
|
17
17
|
cursorParam: 'cursor'
|
|
18
18
|
startPage: 1
|
|
19
19
|
|
|
20
|
+
# how a body `next` is read: 'auto', 'cursor' or 'url'
|
|
21
|
+
next: 'auto'
|
|
22
|
+
|
|
20
23
|
# GraphQL (relay) list ops paginate through operation variables
|
|
21
24
|
# rather than query parameters. These name the variables to bind;
|
|
22
25
|
# the cursor/hasMore response paths come from the model's per-op
|
|
@@ -11,11 +11,9 @@ main: kit: feature: ratelimit: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
# tokens per second
|
|
16
16
|
rate: 5
|
|
17
|
-
# bucket capacity (defaults to `rate` when unset)
|
|
18
|
-
burst: 5
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -25,6 +23,8 @@ main: kit: feature: ratelimit: {
|
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
main: kit: feature: ratelimit: config: optspec: {
|
|
26
|
+
# bucket capacity; `rate` when unset
|
|
27
|
+
burst: '`$NUMBER`'
|
|
28
28
|
# injected clock
|
|
29
29
|
now: '`$FUNCTION`'
|
|
30
30
|
# injected delay, so a test need not really wait
|
|
@@ -907,7 +907,7 @@ main: kit: feature: secrets: {
|
|
|
907
907
|
|
|
908
908
|
config: {
|
|
909
909
|
options: {
|
|
910
|
-
active: false
|
|
910
|
+
active: *false | boolean
|
|
911
911
|
|
|
912
912
|
# The sekreto provider chain, in first-hit order. Each entry is a
|
|
913
913
|
# sekreto ProviderSpec ({ kind, name, ... }) or a provider object.
|
|
@@ -11,7 +11,7 @@ main: kit: feature: telemetry: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -29,7 +29,7 @@ main: kit: feature: telemetry: config: optspec: {
|
|
|
29
29
|
exporter: '`$FUNCTION`'
|
|
30
30
|
# extra headers merged into the propagated context
|
|
31
31
|
headers: '`$MAP`'
|
|
32
|
-
# supplies trace and span ids
|
|
32
|
+
# supplies trace and span ids in place of random W3C ones
|
|
33
33
|
idgen: '`$FUNCTION`'
|
|
34
34
|
# injected clock
|
|
35
35
|
now: '`$FUNCTION`'
|
|
@@ -92,11 +92,10 @@ FEATURE_TEST_SRCS += $(wildcard tests/feature/${fname}/*.c)
|
|
|
92
92
|
Content(`
|
|
93
93
|
# A plugin group is active: the selected kinds and the five shared helpers
|
|
94
94
|
# they call (the socket HTTP client and its OpenSSL binding, the encoders,
|
|
95
|
-
# the clock and the child-process launcher), with the
|
|
96
|
-
#
|
|
97
|
-
# token-exchange transport of last resort in kinds.c.
|
|
95
|
+
# the clock and the child-process launcher), with the external library they
|
|
96
|
+
# bring - OpenSSL for the vault kinds' TLS.
|
|
98
97
|
FEATURE_SRCS += $(wildcard feature/${fname}/plugins/*.c)
|
|
99
|
-
LDLIBS += -lssl -lcrypto
|
|
98
|
+
LDLIBS += -lssl -lcrypto
|
|
100
99
|
`)
|
|
101
100
|
}
|
|
102
101
|
})
|
|
@@ -138,136 +137,6 @@ ${syms.map((sym: string, i: number) => ` ${fname.toUpperCase()}_KINDS[${i}] = $
|
|
|
138
137
|
return ${fname.toUpperCase()}_KINDS;
|
|
139
138
|
}
|
|
140
139
|
`}`)
|
|
141
|
-
|
|
142
|
-
if ('secrets' !== fname) return
|
|
143
|
-
|
|
144
|
-
if (0 === groups) {
|
|
145
|
-
Content(`
|
|
146
|
-
// THE EXCHANGE TRANSPORT OF LAST RESORT, when no plugin group is active: the
|
|
147
|
-
// SDK's own client (utility/http.c), called directly rather than through
|
|
148
|
-
// the transport this feature wraps, which the token request must never pass
|
|
149
|
-
// back through. Reached only by an exchange whose caller supplied no
|
|
150
|
-
// system.fetch; a chain that resolves a static credential never comes here.
|
|
151
|
-
voxgig_value* secrets_rawfetch(Context* ctx, const char* url,
|
|
152
|
-
voxgig_value* fetchdef, PNError** err) {
|
|
153
|
-
return http_fetch(ctx, url, fetchdef, err);
|
|
154
|
-
}
|
|
155
|
-
`)
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
Content(`
|
|
160
|
-
// THE EXCHANGE TRANSPORT OF LAST RESORT (go's rawExchangeFetch): plain
|
|
161
|
-
// libcurl, answering the same transport-shaped map the system.fetch seam
|
|
162
|
-
// promises ({status, statusText, headers, json(), body}). It exists so an
|
|
163
|
-
// exchange works with ordinary SDK options - requiring a custom transport
|
|
164
|
-
// for the COMMON case would refuse every live token purchase before a
|
|
165
|
-
// request was made. Deliberately NOT the SDK transport: that is what the
|
|
166
|
-
// secrets feature wraps, and sending the token request back through it
|
|
167
|
-
// would recurse on the first expiry.
|
|
168
|
-
//
|
|
169
|
-
// libcurl is linked because a plugin group is active in this model; the
|
|
170
|
-
// Makefile adds -lcurl on exactly that condition.
|
|
171
|
-
|
|
172
|
-
#include <curl/curl.h>
|
|
173
|
-
|
|
174
|
-
typedef struct {
|
|
175
|
-
char* data;
|
|
176
|
-
size_t len;
|
|
177
|
-
} SecretsBuf;
|
|
178
|
-
|
|
179
|
-
static size_t secrets_curl_write(char* ptr, size_t size, size_t nmemb, void* ud) {
|
|
180
|
-
SecretsBuf* b = (SecretsBuf*)ud;
|
|
181
|
-
size_t add = size * nmemb;
|
|
182
|
-
char* grown = (char*)realloc(b->data, b->len + add + 1);
|
|
183
|
-
if (NULL == grown) return 0;
|
|
184
|
-
b->data = grown;
|
|
185
|
-
memcpy(b->data + b->len, ptr, add);
|
|
186
|
-
b->len += add;
|
|
187
|
-
b->data[b->len] = '\\0';
|
|
188
|
-
return add;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
voxgig_value* secrets_rawfetch(Context* ctx, const char* url,
|
|
192
|
-
voxgig_value* fetchdef, PNError** err) {
|
|
193
|
-
static bool inited = false;
|
|
194
|
-
*err = NULL;
|
|
195
|
-
if (!inited) {
|
|
196
|
-
curl_global_init(CURL_GLOBAL_DEFAULT);
|
|
197
|
-
inited = true;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
CURL* curl = curl_easy_init();
|
|
201
|
-
if (NULL == curl) {
|
|
202
|
-
*err = context_make_error(ctx, "secrets_transport", "secrets: curl_easy_init failed");
|
|
203
|
-
return NULL;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const char* method = get_str(fetchdef, "method");
|
|
207
|
-
if (NULL == method || '\\0' == method[0]) method = "POST";
|
|
208
|
-
|
|
209
|
-
struct curl_slist* hdrs = NULL;
|
|
210
|
-
voxgig_value* headers = getp(fetchdef, "headers");
|
|
211
|
-
if (voxgig_is_map(headers)) {
|
|
212
|
-
voxgig_map* hm = voxgig_as_map(headers);
|
|
213
|
-
for (size_t i = 0; i < hm->len; i++) {
|
|
214
|
-
if (!voxgig_is_string(hm->entries[i].value)) continue;
|
|
215
|
-
size_t klen = strlen(hm->entries[i].key);
|
|
216
|
-
const char* v = voxgig_as_string(hm->entries[i].value);
|
|
217
|
-
char* line = (char*)malloc(klen + 2 + strlen(v) + 1);
|
|
218
|
-
sprintf(line, "%s: %s", hm->entries[i].key, v);
|
|
219
|
-
hdrs = curl_slist_append(hdrs, line);
|
|
220
|
-
free(line);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
SecretsBuf body = {NULL, 0};
|
|
225
|
-
curl_easy_setopt(curl, CURLOPT_URL, url);
|
|
226
|
-
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, method);
|
|
227
|
-
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, hdrs);
|
|
228
|
-
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
|
|
229
|
-
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
|
|
230
|
-
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, secrets_curl_write);
|
|
231
|
-
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
|
|
232
|
-
const char* reqbody = get_str(fetchdef, "body");
|
|
233
|
-
if (NULL != reqbody) {
|
|
234
|
-
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, reqbody);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
CURLcode rc = curl_easy_perform(curl);
|
|
238
|
-
long status = 0;
|
|
239
|
-
// Where a redirect points, resolved by curl, which follows none.
|
|
240
|
-
voxgig_value* rheaders = v_map();
|
|
241
|
-
if (CURLE_OK == rc) {
|
|
242
|
-
char* location = NULL;
|
|
243
|
-
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
|
|
244
|
-
curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &location);
|
|
245
|
-
if (NULL != location) setp(rheaders, "location", v_str(location));
|
|
246
|
-
}
|
|
247
|
-
curl_slist_free_all(hdrs);
|
|
248
|
-
curl_easy_cleanup(curl);
|
|
249
|
-
|
|
250
|
-
if (CURLE_OK != rc) {
|
|
251
|
-
char msg[512];
|
|
252
|
-
snprintf(msg, sizeof(msg), "secrets: token exchange transport failed: %s (URL was: \\"%s\\")",
|
|
253
|
-
curl_easy_strerror(rc), url);
|
|
254
|
-
free(body.data);
|
|
255
|
-
*err = context_make_error(ctx, "secrets_transport", msg);
|
|
256
|
-
return NULL;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
const char* text = body.data ? body.data : "";
|
|
260
|
-
voxgig_value* parsed = json_parse(text);
|
|
261
|
-
voxgig_value* out = cmap(5,
|
|
262
|
-
"status", v_num((double)status),
|
|
263
|
-
"statusText", v_str(status >= 400 ? "ERR" : "OK"),
|
|
264
|
-
"headers", rheaders,
|
|
265
|
-
"json", json_thunk(parsed),
|
|
266
|
-
"body", v_str(text));
|
|
267
|
-
free(body.data);
|
|
268
|
-
return out;
|
|
269
|
-
}
|
|
270
|
-
`)
|
|
271
140
|
})
|
|
272
141
|
})
|
|
273
142
|
}
|
|
@@ -839,18 +839,16 @@ int main(void) {
|
|
|
839
839
|
// out whichever name prepare_auth placed.
|
|
840
840
|
drive(make_sdk_with(SC_OK, NULL, NULL, cmap(1, "name", v_str("zzcred"))), op, NULL);
|
|
841
841
|
|
|
842
|
-
// A credential mistyped as a map
|
|
843
|
-
//
|
|
844
|
-
|
|
845
|
-
${Name}SDK*
|
|
842
|
+
// A credential mistyped as a map is rejected by validation, whose message
|
|
843
|
+
// quotes the value it rejected.
|
|
844
|
+
PNError* rejected = NULL;
|
|
845
|
+
${Name}SDK* refused = ${ident}_sdk_new(offline(cmap(2,
|
|
846
846
|
"apikey", cmap(1, "value", v_str(CANARY_APIKEY)),
|
|
847
|
+
"clean", cmap(1, "values", v_str(CANARY_VALUE)))), &rejected);
|
|
848
|
+
CHECK(NULL == refused && NULL != rejected, "a credential mistyped as a map should be rejected");
|
|
849
|
+
if (rejected) push_error("rejected", rejected);
|
|
850
|
+
${Name}SDK* mistyped = ${ident}_sdk_new(offline(cmap(1,
|
|
847
851
|
"clean", cmap(1, "values", v_str(CANARY_VALUE)))), NULL);
|
|
848
|
-
{
|
|
849
|
-
char quoted[256];
|
|
850
|
-
snprintf(quoted, sizeof(quoted), "apikey: expected string, got {\\"value\\":\\"%s\\"}",
|
|
851
|
-
CANARY_APIKEY);
|
|
852
|
-
push("mistyped:quoted", clean_str(sdk_get_root_ctx(mistyped), quoted));
|
|
853
|
-
}
|
|
854
852
|
|
|
855
853
|
// An error a feature hook raises, quoting the request, with explain on.
|
|
856
854
|
Feature* thrower = (Feature*)calloc(1, sizeof(CaptureFeature));
|
|
@@ -910,6 +908,20 @@ int main(void) {
|
|
|
910
908
|
"a transport failure should fail direct()");
|
|
911
909
|
push_value("direct", direct);
|
|
912
910
|
|
|
911
|
+
// The clean registry holds every credential in plain form, and is no option.
|
|
912
|
+
{
|
|
913
|
+
voxgig_value* held = sdk_options_map(${ident}_sdk_new(offline(cmap(1,
|
|
914
|
+
"apikey", v_str(CANARY_APIKEY))), NULL));
|
|
915
|
+
char* heldjson = voxgig_jsonify(held, NULL);
|
|
916
|
+
CHECK_STR_EQ(header(held, "apikey"), CANARY_APIKEY, "options_map keeps the caller's apikey");
|
|
917
|
+
char* at = strstr(heldjson, CANARY_APIKEY);
|
|
918
|
+
if (at) memmove(at, at + strlen(CANARY_APIKEY), strlen(at + strlen(CANARY_APIKEY)) + 1);
|
|
919
|
+
char heldfound[4096];
|
|
920
|
+
CHECK(0 == leaks(heldjson, heldfound, sizeof(heldfound)),
|
|
921
|
+
"options_map carries a credential beyond the option the caller set");
|
|
922
|
+
if (heldfound[0]) fprintf(stderr, "options_map: [%s]\\n", heldfound);
|
|
923
|
+
}
|
|
924
|
+
|
|
913
925
|
size_t nleaks = 0;
|
|
914
926
|
char found[4096];
|
|
915
927
|
for (size_t i = 0; i < NSINKS; i++) {
|
|
@@ -1033,13 +1045,16 @@ int main(void) {
|
|
|
1033
1045
|
// name and id, is not read at all, and nor are rbac's rules, keyed by entity
|
|
1034
1046
|
// and operation names.
|
|
1035
1047
|
{
|
|
1048
|
+
voxgig_value* providers = v_list();
|
|
1049
|
+
voxgig_list_push(voxgig_as_list(providers),
|
|
1050
|
+
cmap(2, "name", v_str("static"), "token", v_str("ZZTOKEN-feat456")));
|
|
1036
1051
|
${Name}SDK* featured = ${ident}_sdk_new(offline(cmap(3,
|
|
1037
1052
|
"apikey", v_str(CANARY_APIKEY),
|
|
1038
1053
|
"feature", cmap(3,
|
|
1039
1054
|
"secrets", cmap(3,
|
|
1040
1055
|
"active", v_bool(false),
|
|
1041
1056
|
"name", v_str("ZZNAME-feat123"),
|
|
1042
|
-
"
|
|
1057
|
+
"providers", providers),
|
|
1043
1058
|
"rbac", cmap(2,
|
|
1044
1059
|
"active", v_bool(false),
|
|
1045
1060
|
"rules", cmap(1, "zztoken.load", v_str("PLAINRULE-k7j5h3g1"))),
|
|
@@ -72,6 +72,13 @@ Entity* entyvar_entity_new(ProjectNameSDK* client, voxgig_value* entopts) {
|
|
|
72
72
|
return (Entity*)self;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// A failed step leaves through make_error, then PreDone, which it skipped.
|
|
76
|
+
static voxgig_value* entyvar_failed(Context* ctx, PNError* e, PNError** err) {
|
|
77
|
+
voxgig_value* out = make_error_util(ctx, e, err);
|
|
78
|
+
feature_hook_util(ctx, "PreDone");
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
|
|
75
82
|
// Pipeline: make_point -> make_spec -> make_request -> make_response ->
|
|
76
83
|
// make_result -> post_done -> done. Feature hooks fire between stages.
|
|
77
84
|
static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
|
|
@@ -83,31 +90,31 @@ static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
|
|
|
83
90
|
// #PrePoint-Hook
|
|
84
91
|
|
|
85
92
|
voxgig_value* point = make_point_util(ctx, &e);
|
|
86
|
-
if (e) return
|
|
93
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
87
94
|
ctx_out_set_point_val(ctx, point);
|
|
88
95
|
|
|
89
96
|
// #PreSpec-Hook
|
|
90
97
|
|
|
91
98
|
Spec* spec = make_spec_util(ctx, &e);
|
|
92
|
-
if (e) return
|
|
99
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
93
100
|
ctx->out_spec = spec;
|
|
94
101
|
|
|
95
102
|
// #PreRequest-Hook
|
|
96
103
|
|
|
97
104
|
Response* resp = make_request_util(ctx, &e);
|
|
98
|
-
if (e) return
|
|
105
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
99
106
|
ctx->out_request = resp;
|
|
100
107
|
|
|
101
108
|
// #PreResponse-Hook
|
|
102
109
|
|
|
103
110
|
Response* resp2 = make_response_util(ctx, &e);
|
|
104
|
-
if (e) return
|
|
111
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
105
112
|
ctx->out_response = resp2;
|
|
106
113
|
|
|
107
114
|
// #PreResult-Hook
|
|
108
115
|
|
|
109
116
|
SdkResult* result = make_result_util(ctx, &e);
|
|
110
|
-
if (e) return
|
|
117
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
111
118
|
ctx->out_result = result;
|
|
112
119
|
|
|
113
120
|
// #PreDone-Hook
|
|
@@ -176,27 +183,27 @@ voxgig_value* entyvar_stream(Entity* e, const char* action, voxgig_value* args,
|
|
|
176
183
|
|
|
177
184
|
feature_hook_util(ctx, "PrePoint");
|
|
178
185
|
voxgig_value* point = make_point_util(ctx, &pe);
|
|
179
|
-
if (pe) return entyvar_stream_items(
|
|
186
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
180
187
|
ctx_out_set_point_val(ctx, point);
|
|
181
188
|
|
|
182
189
|
feature_hook_util(ctx, "PreSpec");
|
|
183
190
|
Spec* spec = make_spec_util(ctx, &pe);
|
|
184
|
-
if (pe) return entyvar_stream_items(
|
|
191
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
185
192
|
ctx->out_spec = spec;
|
|
186
193
|
|
|
187
194
|
feature_hook_util(ctx, "PreRequest");
|
|
188
195
|
Response* resp = make_request_util(ctx, &pe);
|
|
189
|
-
if (pe) return entyvar_stream_items(
|
|
196
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
190
197
|
ctx->out_request = resp;
|
|
191
198
|
|
|
192
199
|
feature_hook_util(ctx, "PreResponse");
|
|
193
200
|
Response* resp2 = make_response_util(ctx, &pe);
|
|
194
|
-
if (pe) return entyvar_stream_items(
|
|
201
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
195
202
|
ctx->out_response = resp2;
|
|
196
203
|
|
|
197
204
|
feature_hook_util(ctx, "PreResult");
|
|
198
205
|
SdkResult* result = make_result_util(ctx, &pe);
|
|
199
|
-
if (pe) return entyvar_stream_items(
|
|
206
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
200
207
|
ctx->out_result = result;
|
|
201
208
|
|
|
202
209
|
feature_hook_util(ctx, "PreDone");
|
|
@@ -432,9 +432,8 @@ ${candidates(entity)}
|
|
|
432
432
|
;; The generated config's own clean block is read beside the
|
|
433
433
|
;; caller's, and is not changed by it.
|
|
434
434
|
(let [config (vs/jm "options" (vs/jm "clean" (vs/jm "keys" "zzsens" "values" (:config CANARY))))
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
cfgctx (atom {:options built})
|
|
435
|
+
cfgctx (atom {:config config :options (vs/jm "clean" (vs/jm "values" (:value CANARY)))})
|
|
436
|
+
_ (core/oset! cfgctx :options (core/u-make-options cfgctx))
|
|
438
437
|
seeded (core/u-clean cfgctx (str "config " (:config CANARY) " caller " (:value CANARY)))]
|
|
439
438
|
(swap! sinks conj {:name "config-clean" :text (str seeded)})
|
|
440
439
|
(t/is-eq seeded (str "config " MASK " caller " MASK) "the config's clean values are registered")
|
|
@@ -465,6 +464,12 @@ ${candidates(entity)}
|
|
|
465
464
|
:record (core/u-clean root "record PLAINRECORD-t5r3e1w9")
|
|
466
465
|
:alias (core/u-clean root "alias PLAINALIAS-m2n4b6v8")
|
|
467
466
|
:rule (core/u-clean root "rule PLAINRULE-k7j5h3g1")}))
|
|
467
|
+
;; The clean registry holds every credential in plain form, and is no option.
|
|
468
|
+
(let [held (core/client-options-map (construct (vs/jm "apikey" (:apikey CANARY))))
|
|
469
|
+
text (pr-str held)]
|
|
470
|
+
(t/is-eq (vs/getprop held "apikey") (:apikey CANARY) "options-map keeps the caller's apikey")
|
|
471
|
+
(t/is-eq (leaks (str/replace-first text (:apikey CANARY) "")) []
|
|
472
|
+
(str "options-map carries a credential beyond the option the caller set: " text)))
|
|
468
473
|
(let [leaked (filterv (fn [s] (seq (leaks (:text s)))) @sinks)]
|
|
469
474
|
(println (str "clean: swept " (count @sinks) " surface(s), " (count leaked) " leak(s)"))
|
|
470
475
|
(t/is-eq (count leaked) 0
|
|
@@ -531,7 +536,7 @@ ${candidates(entity)}
|
|
|
531
536
|
(t/run-check rec "clean-a-registered-value-used-as-a-property-name"
|
|
532
537
|
(fn []
|
|
533
538
|
(let [cfg (core/make-clean-config (vs/jm "keys" "key,secret,token"))
|
|
534
|
-
ctx (atom {:
|
|
539
|
+
ctx (atom {:cleancfg cfg})]
|
|
535
540
|
(core/u-clean-add ctx "ZZVAL-abc123")
|
|
536
541
|
(core/u-clean-add ctx "ZZVAL-xyz789")
|
|
537
542
|
(let [out (core/u-clean ctx (vs/jm "ZZVAL-abc123" 1 "ZZVAL-xyz789" 2 "plain" 3))]
|
|
@@ -543,7 +548,7 @@ ${candidates(entity)}
|
|
|
543
548
|
(t/run-check rec "clean-add-sensitive-registers-every-scalar-under-a-sensitive-name"
|
|
544
549
|
(fn []
|
|
545
550
|
(let [cfg (core/make-clean-config (vs/jm "keys" "key,secret,token"))
|
|
546
|
-
ctx (atom {:
|
|
551
|
+
ctx (atom {:cleancfg cfg})
|
|
547
552
|
_ (core/u-clean-add-sensitive ctx (vs/jm "apikey" (vs/jm "value" "NESTED-SECRET-1")
|
|
548
553
|
"headers" (vs/jm "X-Api-Token" (vs/jt "LISTED-SECRET-2"))
|
|
549
554
|
"secret" 123456789
|